{"_id":"@material/mwc-textfield","_rev":"714-3674f316a5c0dde46b30fd46bbabf423","name":"@material/mwc-textfield","dist-tags":{"latest":"0.27.0","canary":"0.26.0-canary.0af8ade5.0"},"versions":{"0.7.0":{"name":"@material/mwc-textfield","version":"0.7.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"^3.0.0","@material/mwc-base":"^0.7.0","@material/mwc-floating-label":"^0.7.0","@material/mwc-icon":"^0.7.0","@material/mwc-line-ripple":"^0.7.0","@material/mwc-notched-outline":"^0.7.0","@material/shape":"^3.0.0","@material/textfield":"^3.0.0","@material/theme":"^3.0.0","lit-html":"^1.0.0"},"publishConfig":{"access":"public"},"gitHead":"c8c5d01ad2103af63e3d7656b5d1acc5ccaa05db","_id":"@material/mwc-textfield@0.7.0","_nodeVersion":"10.11.0","_npmVersion":"lerna/3.14.1/node@v10.11.0+x64 (linux)","dist":{"integrity":"sha512-cVMwAmNgqpbppsgyxlpS2Ga452/5P/67k8UccBiV9ZQQvOg8S2SqxM4ijiSFiIOkC+ppLPiBEk6mtzd1NDPaUQ==","shasum":"b07d586dc057c08e3820fc9a075073f9f8f78c73","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.7.0.tgz","fileCount":20,"unpackedSize":245943,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdZZ9pCRA9TVsSAnZWagAA8g4P/ApPyGlrqBZu5DH5tA6w\nOmJx6RuDkGEq+S/nQ4yH0uxRIRcQpP7aATvZNaNU+1dVnRNV0CVRQiNZl4fO\ncEvkjBY+JFBY6YXt7sny7XB8i85pXRhgkwnopxCjvQ3sSTppwDPg2rHYoJYU\nrLQ/jhlxlrcpdt5Yoo13q2hYoKycOP455Yat3M5KPi58osIgc+NNoP0yop+/\nh4BL7+VVpx9D7eNfq6ye5P0DCwpuPlvwH9MUbtDfwRH2KeV1wWJCU6fIx9rd\nlXiTme2VzjpVDZvzC/B+0VOJoUSbAO7aJsfOyh0uX8FNmpOv7s6DZrB/s5pE\np7S/qDoxTJiSGK+mmRX1vZQCBzRtkVCmubvwkewEfUtdFDW3PUllQDa7pkB5\n/BIvVagTF62IE+UZKy3UQ5fnjiG32DmLcpCkKlVZvEYq3D1V+5qkTj1b40oh\nwzrwrJBYnKSxmkw/Tj/8xi4r6itxzKMfRXqhP0YJ2msy2Kh0TuRFPlC1S4xs\nYTiIth+4vX7iFfvVEqKrkky574XSu1NHnCdyvVjf1NHe0AyIvA0LlBNQIc9x\nf2Bs6Ci0y1hDn89pufsgsToLp3Hu/f55i70W7TW/o9vgWdQ5uqmfd+D4McJ2\n1f6Gb9dC/uQ8vJLLAAH87waNHy4kk7aW3WURIh+tjDB0cXphxoEqa+aisZOp\nXPwL\r\n=MnHW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD3/TXP8sS7Yk/2TX2ilWQmaffTypRAqO7UjfPTJ+vwfAIhANydk9vwjNZ7dw8vlpxULP2i7lqLa97+WrWKYRQ8xaq7"}]},"maintainers":[{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmUser":{"name":"aomarks","email":"aomarks@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.7.0_1566941032587_0.8041948122203697"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.7.1":{"name":"@material/mwc-textfield","version":"0.7.1","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"^3.0.0","@material/mwc-base":"^0.7.0","@material/mwc-floating-label":"^0.7.1","@material/mwc-icon":"^0.7.1","@material/mwc-line-ripple":"^0.7.1","@material/mwc-notched-outline":"^0.7.1","@material/shape":"^3.0.0","@material/textfield":"^3.0.0","@material/theme":"^3.0.0","lit-html":"^1.0.0"},"publishConfig":{"access":"public"},"gitHead":"f8389e38b66e6261a8578f4a748efcb7367da176","_id":"@material/mwc-textfield@0.7.1","_nodeVersion":"11.12.0","_npmVersion":"lerna/3.14.1/node@v11.12.0+x64 (darwin)","dist":{"integrity":"sha512-u5vdlJZiuwfo/cwI8nUzp6on+7RxotLc3Qb3qR1Fp7zFoqHtMuJpujgGhRJIqEENWJt/CGPJ6Da0UNv8UCky1w==","shasum":"8b2629c71fa22abcb00a9031726795f5219f6e86","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.7.1.tgz","fileCount":20,"unpackedSize":245969,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdZezrCRA9TVsSAnZWagAAtXQP/05iJ+tZvWddHMnEuYIX\nah3g6AA+qz4oqmkyeYX03CPYBda4QMOcUfgObDlyBSjcm8fz9xyKpx8hyYfm\nIYahMrqYwNYH1OXXLdM5iQw6R0RCbIyYlPSEysu4fzAgs8FqESm+j4lG/Uee\nO2n6d9orzICm74prnBAVSq7r+NOjXS0C38PjavAgjgpUMCrEF1eTzuZysYhf\nzgPaxWcGi2ywl5gF16jjb1ytOqyTArOXPGwRl+AJHOfUHZm+OeDc0J7EOx51\n1MUMHiitnc394hlkt6lP7W4RK3eRNLWvRLeTgStzQmb6k5oCPVMptvjCBqUj\nX6G7E/k120aaHGbLD0rpmKAEeKRFX2REl4btR8KIZmhRMMR4dOKMtPCvw8fs\nNT9Lb4QxcLHCNpjFMnLVcjblYKNnvlUjnfXrxHhiz+76zegCs3S5fHYlqxaZ\nlK9cBMjIwFaZehLzAwfpNXbFWea7FkzUeMAyl/OuaqpUs/F12pmLCrR92uuB\n1DACCNXJgx+JW7mSKPK/wkV2aH5qimCdYbXP0E+XtJowJ9PQe1zHl+8gLzcI\nnjN0ukJ8uBMRTBS+KqVPOlQOGfPTu+WWNBR3mcmEuhr4FBFLFJgJgCIyiLAK\nS29YFQslKxRaC2ILM+s+wAkYp6nuMAPHRi0XuempDlMr4iIS+XMOm5l4WI/4\nOL0g\r\n=Piaf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDn/K+wNFcVtB4R7mhgdUngqfyNqTJ4RTjtce29Royt0wIgJfTOjw8wOEuDJ2x19C8+O7/8lPzNOv9bPqZjY9ZrJXc="}]},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmUser":{"name":"emarquez","email":"emarquez@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.7.1_1566960871280_0.9462805966062828"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.8.0":{"name":"@material/mwc-textfield","version":"0.8.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"^3.0.0","@material/mwc-base":"^0.8.0","@material/mwc-floating-label":"^0.8.0","@material/mwc-icon":"^0.8.0","@material/mwc-line-ripple":"^0.8.0","@material/mwc-notched-outline":"^0.8.0","@material/shape":"^3.0.0","@material/textfield":"^3.0.0","@material/theme":"^3.0.0","lit-html":"^1.0.0","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"e47de0d9d6e556ce8c4b0b92f87be25a3e18da79","_id":"@material/mwc-textfield@0.8.0","_nodeVersion":"10.11.0","_npmVersion":"lerna/3.16.4/node@v10.11.0+x64 (linux)","dist":{"integrity":"sha512-WMNvvpAa/UPi7t+465idlYnaiPf0eRN/Pn5CILOmZvc6Xibse8ivFq+jWrqUDm4nFOKn2pARcOM/w242ud92FQ==","shasum":"82673cdef0f028dc4cdea9a588f26cd66c5a1c3a","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.8.0.tgz","fileCount":20,"unpackedSize":244992,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdbv+VCRA9TVsSAnZWagAAHGcP/2C9yThxv/oVJe2w1Fy7\nDL/iPncQ1V0DSxNXTAlmSf2vE4cowqnBwRcBR+kOO8tBMFWdJStyzeWpzvkX\nos1w9QwnHEVljL03BQuueCGZly0Z9KG6xCGQvN6IuN6PLmJcF5jGkvNajvP5\n/1YUo7QqFYi5243ufrHVc6m+Kc03aSs5wVb/GuFvBXMU36kb5ZI7Vj9yKMy9\nB8dtc5yS8Qe0fs1ZsZMF/96HAVJXI0xACIKZpuuJBlXJmJcC7uK7AcBkRMGg\nBh5CBFxD7SDnoRP5Id3I9letJSch0jLE8aPhwvpYbK79wQ8ujXl3EhrimqIY\npoBc0BFAfp88afcpm25jfhBdREraBgQ9gwQc0fr12MyssQ8EHu7q8nFpHn5g\noYpcJUqvKk/ICBZ6QQDipFEfveVaSnhs5yM40TJis3Vdc1ybbUMBOL9Jib6M\nKBcvY2Thn89d0DS3YrrrFeBCRE848vJJ0fKAzMwnV5Hqoz8jG4kFYRXYCPjL\nRFxmKB1U0XWKmQ6Nqt+epHTM/rGP6II08zlYRnBiEBaGm68SYRc4cuJmSo8n\nSvRC+N6/276OuFd757eR9Zv+gsb+gBDKxRm9sC503mmrSArzfvqWlvmMxIAp\nWMp+nQcU4YoVshef5LyCyBqu5ermOkqoEXK4rWDLLkIOa8xICqnr3nt0Ptak\nfeGz\r\n=dVb9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHgfRr84L2Uls8AklC9oQW1ML/bUoDQQm7aqIq53LK2qAiBZly3bEzkilR10QG43JUsSwtoJwC4YePWCGKGUyx8A2A=="}]},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmUser":{"name":"aomarks","email":"aomarks@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.8.0_1567555476543_0.9122107904335961"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.9.0":{"name":"@material/mwc-textfield","version":"0.9.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"^3.0.0","@material/line-ripple":"^3.0.0","@material/mwc-base":"^0.9.0","@material/mwc-floating-label":"^0.9.0","@material/mwc-icon":"^0.9.0","@material/mwc-line-ripple":"^0.9.0","@material/mwc-notched-outline":"^0.9.0","@material/shape":"^3.0.0","@material/textfield":"^3.0.0","@material/theme":"^3.0.0","lit-element":"^2.2.1","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"d6db9ceafe4b21572f967ac4acae9189da8c9c4f","_id":"@material/mwc-textfield@0.9.0","_nodeVersion":"11.12.0","_npmVersion":"lerna/3.14.1/node@v11.12.0+x64 (darwin)","dist":{"integrity":"sha512-qisrvu9KbLyAc1oAFw5y+aw7CAzWK9z+giHzPWsUNCtAfhEoWRJwVC4NljrHw2vH/4B3eOgaaUT+wbqlw10jWg==","shasum":"f30204cfd46508a0354a090d05647074f65fde5c","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.9.0.tgz","fileCount":29,"unpackedSize":315785,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdjWeUCRA9TVsSAnZWagAAFssP/10e7wQih0SCZc4oYFri\nPmLRoq1e/bg/Z4BkqnwoNGCwiqGUvATrUy787CXg8fyeT+myIYDtosY6oi1+\nqyTZyzeERUt/tOC90daPOMaQngOmAtpmZJ+Jj7IkqvSDo3U9pDUUXNvu0KO/\nWZKESbRNtkB/AYrTNmNrZadOcSQqx9tt026j6JKhy9qr0oZYfx1roJri5r8I\nbKhnAWRxMkK5Mr6QiIr1ehpMqkdyDMMrY9gNycucba8uC0YTx4ykldNNKDWr\nKxLbH+E/j44LbxpqgyAaRrQ8KiIrth0w28idIk/cN3GKvPuSaJRYgDsCJQXw\nxL5EPcCTyJ5qaX5Ggndk6t+fv9dzaXlilsdZF89s7CNZUWICljGW1hspjUxG\nP+RTXck8nY4hBNkDTnX2eqYp7adx4OjiDZ0oyXO1Fg/gAuo9lP318exFK4kD\n41LcUoWWCKa7EiZlQLuHgck/cvf477LuwOaECfKafiaWNA1aZC6efQ7ndRLp\ndWlvXeUPVFJIiBTXaTKyx4n5/udzAOQ/4K5ZmtdfL/0X2Vn1lNWeHTspzSP0\n3A2zR/ypbqtmvB+kDZlJ3az/+2Juh7o6uxJZmZrcL4jO4ZoY6sqLPpZ9X01m\nHKVuimY7FkOg0+xKEGyH6gQc5JY9DcVLz7pQDSAuQ4ffCuDvc65PmwHHGhn6\nu18+\r\n=B5uB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCCzlPxHv68D3U6/oWu3cLm4h4Q0vmlOWG6nBda7m5tTQIhANxtyDYs2GYWPu8W4XNSFNAKI6lWoj60I97C8N/Bai84"}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"emarquez","email":"emarquez@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.9.0_1569548180174_0.6843792752313018"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.9.1":{"name":"@material/mwc-textfield","version":"0.9.1","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=4.0.0-canary.e851d4f40.0","@material/line-ripple":"=4.0.0-canary.e851d4f40.0","@material/mwc-base":"^0.9.1","@material/mwc-floating-label":"^0.9.1","@material/mwc-icon":"^0.9.1","@material/mwc-line-ripple":"^0.9.1","@material/mwc-notched-outline":"^0.9.1","@material/shape":"=4.0.0-canary.e851d4f40.0","@material/textfield":"=4.0.0-canary.e851d4f40.0","@material/theme":"=4.0.0-canary.e851d4f40.0","lit-element":"^2.2.1","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"2b2676d71b8d393aa61348cb8e3d9ed03dd8dc08","_id":"@material/mwc-textfield@0.9.1","_nodeVersion":"11.12.0","_npmVersion":"lerna/3.16.4/node@v11.12.0+x64 (darwin)","dist":{"integrity":"sha512-03CFWGyAqjNGnNDUzUEkDY3vNrx/XLsKakh0iNgREQmOLT3iybOgVUmSZ21bcDxSnQd7/Fc4gclzCNVsPhI6xg==","shasum":"3024d243d4f48b80e94241fb403355070e4ee6f4","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.9.1.tgz","fileCount":29,"unpackedSize":316709,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdkm38CRA9TVsSAnZWagAAW5AP/iqQXBHQqSahSpQgTE5Z\n7Ny2M1oLxr0ej+RTKugZqNHSTZxhUJiVQtBXqKaCJl+l5H7RmJmZpI0/JEbL\nOq5N7vkHB62Lq5I2OJg/yngDRszu64Kbz2lrB0DeFJpzAa6v2yzNJWMjz2LA\n9+4VeYVwrPsbp/Ym31RkKycfBsDVjOkzUYwTQk8+0csFc1QxGzAWKGjOATEo\nXzCFEQVelN0bBHkfN1pEaBLP8clFhu6nID7widvfrI5vudiIg2pjDSfAsQfN\n4uYRiujm/0ghrVGM8oQtkxc/jpYQVYNcdROY9dvTgezLf+vkSnGpF9lg2TmT\n7frq+BLhR753pOjEq4CUh+Mry+3zsjkBsrKpdbJ9+JNkGSoh1MAqja6DSdwI\n9FJb8pTGmKe8zUApOaLPIQRxWhilvcswR5/EaQnhAS9L4zIJimVj3ADKzlQZ\nf5sKlMPNDWpwpTbWNHlf31X16eP6elfcahWfjZOoN6vzkKiD8sAU/3eXFCLY\n26IZwpvmcXYhyYGuBGoEJEQhfIhVOROTCIzjr7VwLa1aVbqlTnewDZOHdvkc\n/VVvjRTWzitOpt0RBx+4rQl/LIj3BHejlS1lhquL5/g6QUHmHhe71EUVOMbV\nm564rwexG+qcOFmVKMjkVllLJJEfxfv1U5WszlSRx87fKnaY8s3x+4MJVH85\nX2zp\r\n=MSUw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC22ZV6vc4R8UDqLEEyejbc9xqfNfO7VvCrJPcfjAxmSgIhALemflt3mjQcOzC/cWzFN2wF/oZzELNI/4e/yjHnA/Pa"}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"emarquez","email":"emarquez@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.9.1_1569877500096_0.35061057812528373"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.10.0":{"name":"@material/mwc-textfield","version":"0.10.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=4.0.0-canary.e851d4f40.0","@material/line-ripple":"=4.0.0-canary.e851d4f40.0","@material/mwc-base":"^0.10.0","@material/mwc-floating-label":"^0.10.0","@material/mwc-icon":"^0.10.0","@material/mwc-line-ripple":"^0.10.0","@material/mwc-notched-outline":"^0.10.0","@material/shape":"=4.0.0-canary.e851d4f40.0","@material/textfield":"=4.0.0-canary.e851d4f40.0","@material/theme":"=4.0.0-canary.e851d4f40.0","lit-element":"^2.2.1","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"631e70e3a39330ccade8210d1a72edc0f22ddc0a","_id":"@material/mwc-textfield@0.10.0","_nodeVersion":"12.9.1","_npmVersion":"lerna/3.16.4/node@v12.9.1+x64 (darwin)","dist":{"integrity":"sha512-5HLEhcosLrCOJLJBpB9BpqpMqiWl8xtjBIoHs4SFUiqg87wbQx/qtSGMyP1U7q4TfPbvcoRQVreqrYbwr3pxOg==","shasum":"bd67a49e4b8329ef8577881467bcbe6fdebe8817","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.10.0.tgz","fileCount":23,"unpackedSize":276475,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdoRAYCRA9TVsSAnZWagAAY6UP/0RwEb+RyyWHESFmcv/0\nwuMZzuCJwoQ7IPYIV5/zCPMb4CdhDyYz82cneHKfDgc38dslacqJiAewo6B9\nlX85tVJhZw9q3JmMKSkv8Lj67YasDhzee+DVoQ8DJdIZ8TV0u3O75PXDNroa\nJikHdcDyuIvoMVoFI6jl8mbSqK84ED7lAMtso4MskVRg7tqEiSVxVf4Eu3kd\nO6rekMNI/ytKBtlnPs3rsrNE1PO+5JrdUqEQolVLGJFyjDVLtIBincfAah5S\nc2iIohAMZQ5A0UFw4dcRMiIsH9fUKvZ0RnzUUeXAwsTo9uoytdC5L/S6dVQp\nEePWE2H6FaMU6qoV76l8bPEBiJGYy1ebeaRiQYSAzrq0105VZ63e5nEvdErK\nfFwn0ujhfVq9YJNLFNoFHz0sgAMoIw6hjrLsSTMGm+aBLpXTjEdrToc0HUUY\nRrRgTJCm4zhlbZqD+l4kIOz1cIWcgkmICAhv8j09FBbc1oBq846c/PUUJM0T\noUK3hk3wYmSCfRl70n5C0zwGUTGsTw9aZd3SUk9+3NGpG7Esy/H+4wLXQlSb\nElj5/jzozc2F66bnNVfzNVpZ8hPR9tayeXx7aKGftUnVxxWIflcw+WA8e5qT\nPcrzqexEU5fjqixW820uNT21XS7tkH73YkQWOYArH90fgSabLka+8f1oFSVs\nlHtK\r\n=002/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC+NmrELi0eGWmCM+M6QwYEuxy7qSUIAWvd+ywAlFOH4gIhAOuIC4C5rrjHfu4hddKx/qNat8Asz46W9FtxmHUO9UTv"}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"aomarks","email":"aomarks@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.10.0_1570836503416_0.884633306897346"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.11.0":{"name":"@material/mwc-textfield","version":"0.11.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=5.0.0-canary.5729943ba.0","@material/line-ripple":"=5.0.0-canary.5729943ba.0","@material/mwc-base":"^0.11.0","@material/mwc-floating-label":"^0.11.0","@material/mwc-icon":"^0.11.0","@material/mwc-line-ripple":"^0.11.0","@material/mwc-notched-outline":"^0.11.0","@material/shape":"=5.0.0-canary.5729943ba.0","@material/textfield":"=5.0.0-canary.5729943ba.0","@material/theme":"=5.0.0-canary.5729943ba.0","lit-element":"^2.2.1","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"147d9789d99bf7a5ed28f6b066b8db58f5b9ab0a","_id":"@material/mwc-textfield@0.11.0","_nodeVersion":"10.17.0","_npmVersion":"lerna/3.18.1/node@v10.17.0+x64 (darwin)","dist":{"integrity":"sha512-JvbQ+qCKnpwdIhDUZ7KoCHbf2eqsaFKfkdsRBy3OjqWKY/w7D0FMkhyC/pbQI1AeyLGunOmtS4Qct7U1eUcPGw==","shasum":"c9fb2f8d1739fe602d92c2276d8641c10f35e7c7","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.11.0.tgz","fileCount":20,"unpackedSize":269062,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd3Z3vCRA9TVsSAnZWagAAoiwP/jcZV8S+MXF+t5bZvbyT\nblEwZHxzIoNUQwpOArJce/1dvHdIQAYMjoDrUiyyNgdVYP217hM3WrL1BBRf\nRM6lWfTxBUvaunwUjNv6d3GNFS6Zo9aed62vKw0EF+el358iTuaocfHppa/z\njeOMD+DFBcwT0qnOQ4/qgDlKDhAAmKTAYzwH9O88dkvR7ac6K35CHeCY2HOO\nXFGikr1SnC5wc7aBBgiRj615VDd8lB/YywiGdYeJWhTp6NjxFOYaGgmFod5k\nC+cqfpqcUuYrzKQcObrZprcCggwt/H2u73dHrDsKtBWkgOE+txPLtekZKbC/\nGJDxiHHYxoaSa0o1S05BXTu1igHy/BuO6zsWS7MlQBeXP01/ZCseGuN5hTIM\nBCLGDI7maIdEH0kWv2IfE9q1HhuJfmm5elrdvvzyzRdEYhLI5A+xAUffSXyS\nO182ZnVpYGDAQXzYvmLckFHmm4StnpXVGg9WArvScAxj1MP4fAAmizmp8BHf\nyTNRej0z/v8hg4Gb3DtY2B+2LrLuQ0SbeaQIvKrG1CFDJfZNDQVYf627hQR8\nZINYiD3RaYjH3wuEUhaH3JUAgSVYwsPCSEOctWPonXbeN/AGMMDujlcTHCMT\nj4KFkZpgsJrcyGF56MsuGK9ObEEhdVigXjABYFm1eJImOm1eEmEQ2YXPsPfK\n1ouI\r\n=A4xB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHqy3XZslGcL6P4oExICy9sWkh7MOKelpNXWMsq591PdAiEAx6khaNNqPOoB9VmD6+OanHWXr6NqNUDyU8DjroTl+ZE="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"asyncliz","email":"asyncliz@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.11.0_1574804975166_0.8333979409634713"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.11.1":{"name":"@material/mwc-textfield","version":"0.11.1","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=5.0.0-canary.5729943ba.0","@material/line-ripple":"=5.0.0-canary.5729943ba.0","@material/mwc-base":"^0.11.1","@material/mwc-floating-label":"^0.11.1","@material/mwc-icon":"^0.11.1","@material/mwc-line-ripple":"^0.11.1","@material/mwc-notched-outline":"^0.11.1","@material/shape":"=5.0.0-canary.5729943ba.0","@material/textfield":"=5.0.0-canary.5729943ba.0","@material/theme":"=5.0.0-canary.5729943ba.0","lit-element":"^2.2.1","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"395c02244bf15c2658cb110eb405ff2e4c0477fc","_id":"@material/mwc-textfield@0.11.1","_nodeVersion":"10.17.0","_npmVersion":"lerna/3.18.1/node@v10.17.0+x64 (darwin)","dist":{"integrity":"sha512-YOXNfryuaNcpnBX4ro+lKbJNgYqGCVAhbruJS70WdRTZv7V2I6ICz0pB62jWC+1QrJd26rX+IDLMXjm0X6cvlw==","shasum":"223b97c5278c9c37c01f5012335713341568fb52","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.11.1.tgz","fileCount":20,"unpackedSize":269062,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd3cK+CRA9TVsSAnZWagAA/igP/Aw5SjCynfob+kVYmFPr\nkDhrfd2O7CVBcS7CVyyRMLmj/jeLdLyt6APaUbZIQsE7oajw2N/nB4K20Rs+\nCWda5HrO65ZuPRkj7suwDLz2BcFDxweD5aV/sq49sjyrGZg8I1H7U0raRrlh\nVUArp+41hVsK+MpiaVksQUsGE6el5F60lAYSubGHdtZNPfDSsceQj4cONDK2\nryvNCn97KZwxW2k9ygcm20nThcoEkrWZczoA+QhJk4gXoRHHGlo1HUKc+g/9\nOJZZoZgUe+zKXpvz1HSyCDP5X1T1CgYR2xHR8bIVasPAJam40dJPJ3BPULrF\nLyRn6x7sBAxT4t+C7gggTaCtFPpd8vrNXYvJmRgTin39Y81hpGiD62JouB3m\n+7HGFMSzVcpMgTDAvimURbuvuNh2ufD9u64fci1eAb85hHkhttKOpkA14wrM\niP2MLaK9YJGeucqIKSTOsQ9Yf1Hxw6s4hfdGKUmYfh3Vri8CSSmDNUurG3rZ\nMsZrY4biKdavmrtsnxYQhzhlEWxPvB3xUJogCf059uGpKUzVG01I0sO6lqS6\nnLQvYQf7Nk7l9rWZIyBTdPrGNzRg5bzcVYbwJVUltE8TKFBPKrjjkMX+Bgt5\nyYEB0r6SSBwcHmJxtghPen8T8qAg8tcyQdw2yXOMCa5i2+OtTF2I+Y+lNa+y\nHqRe\r\n=hkmx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCxtetUCKLDdvzIiLBQ7Wy3q8VZeYvRdD8fAeTURvUvswIhANciFO8ActR+feez0f4/AP8LdJoZXjEpk9iH2YC4B0oj"}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"asyncliz","email":"asyncliz@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.11.1_1574814398439_0.3444754107187471"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.12.0":{"name":"@material/mwc-textfield","version":"0.12.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=5.0.0-canary.1c494e567.0","@material/line-ripple":"=5.0.0-canary.1c494e567.0","@material/mwc-base":"^0.12.0","@material/mwc-floating-label":"^0.12.0","@material/mwc-icon":"^0.12.0","@material/mwc-line-ripple":"^0.12.0","@material/mwc-notched-outline":"^0.12.0","@material/shape":"=5.0.0-canary.1c494e567.0","@material/textfield":"=5.0.0-canary.1c494e567.0","@material/theme":"=5.0.0-canary.1c494e567.0","lit-element":"^2.2.1","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"4c0dc16b89066f24fca4efcf78c36c87657f0a03","_id":"@material/mwc-textfield@0.12.0","_nodeVersion":"11.12.0","_npmVersion":"lerna/3.18.1/node@v11.12.0+x64 (darwin)","dist":{"integrity":"sha512-99wvaVT0EzsBXntG7UTouyMXs3MOWgCjCph+A6bAavv3EyGGNYMItt9EWBYBWazB1keDQKP8yFrXwXpXlOQH9g==","shasum":"56361a936ee9dd940d80ee2efa10f30284f23858","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.12.0.tgz","fileCount":53,"unpackedSize":488639,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd+WkqCRA9TVsSAnZWagAAFO0P/2d1tFiCEO/vgCSD4wpr\njxywip+RQlLXzrzwUnM6q5jmD60XZZaqIrNW++XstBL0yNCljAZSiAJr5mi4\nx8grKcWhHlUmVs9GUqp/CaN8HQtojmfb7y74uq1EpVwQC0XXpX+097Q+2+tl\ns7A1M6l0upKQED8dUeYIbx9ohE6XuPk3/oypPMvFIu8pvFKD/SUMUJ3CF2nA\nyvwLad09BQs0tP/tPYMRjIkoaVy+fHOcKQiPfbQS0sZujyWUrMoaNTm3dTiK\nr3L7J8Rgy0Ax0xFrunLG3hkRIDTYXJldsGReb9DtD5tyEimXh1JSKr6OZvhK\nahy1QSNHQDW8x5jAeYb2RNqQdcCV37FYgZEll8GmG4KOD7MFO+6TDuBzWxWl\nO/lUOuAvNrWt7NnBfiIuDNBFmUk+tVpiP48CaUBbQaL8ATxZ/63uBSzCgPFj\n+YJ9m65R82PEiFPD+yezHNJEHX3nXjAE44YvtWfRlercUuZt2HpVDvfVkemt\n7m2N3L2PgsTX2f2fPTV/0NwouYc3H9dTca3Ie5zLQ7UB+BgxFUaHAn31HP/H\nR5+jNZlDZZnFRlc5dggHSVW8QoUi/6HUEuwnQV+1W4AEurA6+qbwHwcCLwfe\nhD3il420EAyvdwPf6jHzEHOCBmCasTvJ+qUzJfo41ArRjkBFgog/EUhSIa72\nccrA\r\n=q4Qy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFKdtgwV+efDSDSJk1aLclL1gAOhEZdtyAWjfJCnhLwIAiEAqGwo+CubX/rCx5Ej0FH6W8cWOV0pYZJJCf635p/wkrk="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"emarquez","email":"emarquez@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.12.0_1576626474385_0.30475281493259043"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.13.0":{"name":"@material/mwc-textfield","version":"0.13.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=5.0.0-canary.a1a0deb3e.0","@material/line-ripple":"=5.0.0-canary.a1a0deb3e.0","@material/mwc-base":"^0.13.0","@material/mwc-floating-label":"^0.13.0","@material/mwc-icon":"^0.13.0","@material/mwc-line-ripple":"^0.13.0","@material/mwc-notched-outline":"^0.13.0","@material/shape":"=5.0.0-canary.a1a0deb3e.0","@material/textfield":"=5.0.0-canary.a1a0deb3e.0","@material/theme":"=5.0.0-canary.a1a0deb3e.0","lit-element":"^2.2.1","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"054d0d234704a274e8aaf7d8a8a0399f525914eb","_id":"@material/mwc-textfield@0.13.0","_nodeVersion":"11.12.0","_npmVersion":"lerna/3.20.2/node@v11.12.0+x64 (darwin)","dist":{"integrity":"sha512-0cOgJOP2hIe20NGRDNkl4JEyo8B0fiwdxKbU12LhDZrCI43qQnXzeAn1WkRUgwMBo3RS9AXKCBSMOdhrZ0tz7A==","shasum":"d0a26a93cea818587166347a9f1ad05e54174c10","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.13.0.tgz","fileCount":23,"unpackedSize":273329,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeOPcsCRA9TVsSAnZWagAA1gUP+QHG5NPwb3+62gx4jX1b\nJoZW1IuNhn/K8RV/8w9EVHjfFDH7y4htjq8VuOhEuAgHs9euKRjAaO8TS17i\ntSyUO5iQa7pr/eX5fDH2bdH+Vr/L4hDo9OL3T7vlTzgBx59oZwOMk1fD98LK\ndjpFocbFwZPkIu4HBdwyMtOjfmEL0mQMnSe14uhrJ+XoYJCHZ3ImqV0ZzhF+\niOpx19Dbx2HAs0HhXwJGHwF0Mothk68e+ydC7i76iTmVqVoH0r978BsQgTxs\nYIwXridAp0bj1jYBkwLsu1lVtGHQ6qL+PURJoHkhi3tbZxzrqGpWhmBWiKqP\nebIp8TDODNZ6aqAm+aLgHe0Js3x7z1j+lwGs7FGGeTUaVjgyri8rbFPohC+O\nQ/TDLRx5U4oPftLyIJIqkBUYkPHkn/W4MuousABoiLpX/4eRcSBVkrbbLbj/\nRM6js5kFuvREYLHak1yaewr/3EdqcS9MyV81x+8Ldrt9gzpW8ZTq1Mc62OFR\nO/cmukIFJ5S3TFIndHomqMs39GSTf8rxHN7OQWJsjQBg/3o7T9NjlIJoIwy1\nnCBrZuzq7D8bcCN/hc4qxJd+5AaPHGp7K0FGtvfaaK++17MOm+fBhNB6HRyU\nbY8v8P4mMwye2K+Yx4Wdwmu4oA+eTxTdiXHaSw1uSWSMSeeGeCS5cLRb4CqX\n307V\r\n=huoW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFidODaQN5BpipKtzjTjDEWOXGULyBT5ny7NWkuo7+FiAiEAxfOvDVxgP7FQ/rklbPbKv9BaKyvWq1wCT3ocieUWKzU="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"emarquez","email":"emarquez@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.13.0_1580791596295_0.18442698224628762"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.14.0-canary.f790f713.0":{"name":"@material/mwc-textfield","version":"0.14.0-canary.f790f713.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.781434a92.0","@material/line-ripple":"=6.0.0-canary.781434a92.0","@material/mwc-base":"0.14.0-canary.f790f713.0","@material/mwc-floating-label":"0.14.0-canary.f790f713.0","@material/mwc-icon":"0.14.0-canary.f790f713.0","@material/mwc-line-ripple":"0.14.0-canary.f790f713.0","@material/mwc-notched-outline":"0.14.0-canary.f790f713.0","@material/shape":"=6.0.0-canary.781434a92.0","@material/textfield":"=6.0.0-canary.781434a92.0","@material/theme":"=6.0.0-canary.781434a92.0","lit-element":"^2.2.1","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"4ccf0f734c9b727a925e62b9999d4380351c7936","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4ccf0f734c9b727a925e62b9999d4380351c7936/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for Edge and IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4ccf0f734c9b727a925e62b9999d4380351c7936/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4ccf0f734c9b727a925e62b9999d4380351c7936/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4ccf0f734c9b727a925e62b9999d4380351c7936/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4ccf0f734c9b727a925e62b9999d4380351c7936/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4ccf0f734c9b727a925e62b9999d4380351c7936/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4ccf0f734c9b727a925e62b9999d4380351c7936/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4ccf0f734c9b727a925e62b9999d4380351c7936/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4ccf0f734c9b727a925e62b9999d4380351c7936/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4ccf0f734c9b727a925e62b9999d4380351c7936/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4ccf0f734c9b727a925e62b9999d4380351c7936/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\n| Name                | Type             | Description\n| ------------------- | ---------------- |------------\n| `value`             | `string`         | The input control's value.\n| `type`              | `TextFieldType*` | A string specifying the type of control to render.\n| `label`             | `string`         | Sets floating label value.\n| `placeholder`       | `string`         | Sets disappearing input placeholder.\n| `icon`              | `string`         | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `iconTrailing`      | `string`         | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `disabled`          | `boolean`        | Whether or not the input should be disabled.\n| `charCounter`       | `boolean`        | **Note: requries `maxLength` to be set.** Display character counter with max length.\n| `outlined`          | `boolean`        | Whether or not to show the material outlined variant.\n| `fullwidth`         | `boolean`        | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n| `helper`            | `string`         | Helper text to display below the input. Display default only when focused.\n| `helperPersistent`  | `boolean`        | Always show the helper text despite focus.\n| `required`          | `boolean`        | Displays error state if value is empty and input is blurred.\n| `maxLength`         | `number`         | Maximum length to accept input.\n| `validationMessage` | `string`         | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n| `pattern`           | `string`         | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `min`               | `number`\\|`string`  | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `max`               | `number`\\|`string`  | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `step`              | `number`\\|`null`    | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n| `autoValidate`      | `boolean`           | Reports validity on input rather than only on blur.\n| `validity`          | `ValidityState` (readonly) | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n| `willValidate`      | `boolean` (readonly)       | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n| `validityTransform` | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n| `validateOnInitialRender` | `boolean`            | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's  bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's  bottom line when hovering.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.14.0-canary.f790f713.0","_nodeVersion":"10.19.0","_npmVersion":"lerna/3.20.2/node@v10.19.0+x64 (linux)","dist":{"integrity":"sha512-dBhVhNDbtsUOM9Djk/X9Zs3E7W4UAQ2Xrci2ZqSNjZcch/0Fh8MQhJMAEWFj81Pdo8uWCsRyCS+Asp9qDf0wuw==","shasum":"c28c120007b83da24215308967cfd57553a5e3de","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.14.0-canary.f790f713.0.tgz","fileCount":20,"unpackedSize":281084,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeWHrDCRA9TVsSAnZWagAAEwwQAJBknZH28qQulX7qS6CN\nPQX4kZECK35IoRYO5Nr0UxMTw0eVEVJAKAC0MysJNvXrOhKxFxBJmIzN2aY5\n+YKNDj5vQU+YyTs+YG2T8/3eLNbCiauZro78eQw+jo98cC5kYBkhvyrm7Gsz\nzuPeSQelUM4NMrAps9MerDdsFlV8jUiXbxlUIbWYDZtv1DVi7tjEsakUhgQT\nUMkhamuCaoAMm5Nn/DLHuY0YyaixIelpAEXbWTtD5wvApjTC8/BvOstl+xeK\nQ/s2DNd6o6iumifzOaTaGdzm6ib00Jg/6jcQ0hFqlNZE3KXZY+Vu/0D1ehL/\nBkVm7xjVaa1nqm8LYMXBvAz10LGI1dl1Yrt4dyoYEkV1oBHGHXWzIvPjdFmP\nneRUr+XhJ161rCSm8oXzooS8XbgjgSa1e/FT/kE7WtAK+BVvcFzQ17bVsSSS\nO4BEoIT2C6H4O56AAipRQbJNUTaZhA5aaRs1CTLFQUOyrunvEkV30bcfTLlJ\nn2s5lfsKn/vMaSXY8mOFCOoebpXmi1LHZn+cggsEyHfPRQrixzzDnCoNQS5O\nFnPsdnjh16qkI6f97Wdvs+6kBX+hz5uvQJuW2vJVaEsbYxTgNycDZR5gn3po\nZA8y3xnIvAB9w6o8+Evl8v96N2tjncr0yk7ZrRhAWXtrhaizIr1DQeaYIYM7\nSKK9\r\n=ry6U\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDhpeDH1/FuXU4WsvCBKNsCCUT4QulC4rhYMHOLQeHIxQIhAKidMSRW6X2fct66K4FLYm91qR7MJYb99EcXhsGr520P"}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"asyncliz","email":"asyncliz@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.14.0-canary.f790f713.0_1582856899235_0.8464761489678208"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.14.0-canary.c759cfbc.0":{"name":"@material/mwc-textfield","version":"0.14.0-canary.c759cfbc.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.69edc6e28.0","@material/line-ripple":"=6.0.0-canary.69edc6e28.0","@material/mwc-base":"0.14.0-canary.c759cfbc.0","@material/mwc-floating-label":"0.14.0-canary.c759cfbc.0","@material/mwc-icon":"0.14.0-canary.c759cfbc.0","@material/mwc-line-ripple":"0.14.0-canary.c759cfbc.0","@material/mwc-notched-outline":"0.14.0-canary.c759cfbc.0","@material/shape":"=6.0.0-canary.69edc6e28.0","@material/textfield":"=6.0.0-canary.69edc6e28.0","@material/theme":"=6.0.0-canary.69edc6e28.0","lit-element":"^2.2.1","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"e0a8ac49c085c004f390a2995879e67aea1010e7","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e0a8ac49c085c004f390a2995879e67aea1010e7/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for Edge and IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e0a8ac49c085c004f390a2995879e67aea1010e7/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e0a8ac49c085c004f390a2995879e67aea1010e7/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e0a8ac49c085c004f390a2995879e67aea1010e7/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e0a8ac49c085c004f390a2995879e67aea1010e7/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e0a8ac49c085c004f390a2995879e67aea1010e7/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e0a8ac49c085c004f390a2995879e67aea1010e7/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e0a8ac49c085c004f390a2995879e67aea1010e7/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e0a8ac49c085c004f390a2995879e67aea1010e7/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e0a8ac49c085c004f390a2995879e67aea1010e7/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e0a8ac49c085c004f390a2995879e67aea1010e7/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\n| Name                | Type             | Description\n| ------------------- | ---------------- |------------\n| `value`             | `string`         | The input control's value.\n| `type`              | `TextFieldType*` | A string specifying the type of control to render.\n| `label`             | `string`         | Sets floating label value.\n| `placeholder`       | `string`         | Sets disappearing input placeholder.\n| `icon`              | `string`         | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `iconTrailing`      | `string`         | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `disabled`          | `boolean`        | Whether or not the input should be disabled.\n| `charCounter`       | `boolean`        | **Note: requries `maxLength` to be set.** Display character counter with max length.\n| `outlined`          | `boolean`        | Whether or not to show the material outlined variant.\n| `fullwidth`         | `boolean`        | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n| `helper`            | `string`         | Helper text to display below the input. Display default only when focused.\n| `helperPersistent`  | `boolean`        | Always show the helper text despite focus.\n| `required`          | `boolean`        | Displays error state if value is empty and input is blurred.\n| `maxLength`         | `number`         | Maximum length to accept input.\n| `validationMessage` | `string`         | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n| `pattern`           | `string`         | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `min`               | `number`\\|`string`  | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `max`               | `number`\\|`string`  | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `step`              | `number`\\|`null`    | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n| `autoValidate`      | `boolean`           | Reports validity on input rather than only on blur.\n| `validity`          | `ValidityState` (readonly) | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n| `willValidate`      | `boolean` (readonly)       | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n| `validityTransform` | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n| `validateOnInitialRender` | `boolean`            | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's  bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's  bottom line when hovering.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.14.0-canary.c759cfbc.0","_nodeVersion":"10.19.0","_npmVersion":"lerna/3.20.2/node@v10.19.0+x64 (linux)","dist":{"integrity":"sha512-CiEYs7wZHO11C0L9ujTeNmVSdbXqhtNNyaqyYiDsgKA4N7UwZT6QKmGRdpO77He5mEnTIKyJMUOO3sTQ+xnawA==","shasum":"c906e05bbdeddad0c0389255663690bf0cd55d87","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.14.0-canary.c759cfbc.0.tgz","fileCount":20,"unpackedSize":281084,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeWaqoCRA9TVsSAnZWagAA+owP/jDHCgeME5naRuYSAjAT\nsmzNahYKAEs6Jk6inMiVZtCjghW+3YHEQaB+HyoBKX6FMORBk+WDXFiSFRk0\nNOkSoqeS0BCc8Wr7haFibFHlSF/J6zExICcW9TtJ1x+vMUqLkeIdUT00Lb9g\n2mSTK69mkJxCxxkGD6SU+9vHe99ofDvM0yZ341hp7coKsE/xqGEwa9dWEgfL\negrwjbicppQCERAzXYjB5yR15OCQ724CaMJF1C/Ky4KX67rgiaJh/AMqOVxu\nM1yhGODDwmEdpwtmwXSAN9/orCj88eptDNX4suW+Uc1DSG2IXAncXFqvOwYA\nnYwVvYmo4hQ8bmJocRL8lESz5uycLxso106fo9YhatCvmkfUypAMlhD9fqw6\ntgpBK7U3bf6CKsLfic41Jas1cnRspSnNia0KjYNOZNZ6ZiVrOTDdrHOdbYyG\npQrhdO8jyX5VXhenpFYOYJKpK5M8+Fb1ck87SYiT7RNu67Eh5vWXKlmuLkO2\nmkvAuyJnqz8pLpBHje9D/FSaLaQ3U/7z6Fd5eHKw5+Mp/ygjBcBKhBsAAo/t\ntgXMPtMrOuFi1uKUvf3+t4YPkIqCwo572K9xclNxcgtpZLWPImyyg3QkhEDy\niNJ2rb3fUE5qAA7RIAwIpXOUn/Z5HjfgLuLsYntvsn7yYgSMkU+chVbfdpj0\nfpX2\r\n=e183\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCAp4+xttEygylHoXe8F2935rpxp5M3KoQsHMpW0N4SoQIhAKKYEwNSojGj6d1KA/t8JPQXrTDdPJ0Wn62Zyuwr/UCW"}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"asyncliz","email":"asyncliz@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.14.0-canary.c759cfbc.0_1582934696498_0.39548741791978825"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.14.0-canary.97ef53d8.0":{"name":"@material/mwc-textfield","version":"0.14.0-canary.97ef53d8.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.69edc6e28.0","@material/line-ripple":"=6.0.0-canary.69edc6e28.0","@material/mwc-base":"0.14.0-canary.97ef53d8.0","@material/mwc-floating-label":"0.14.0-canary.97ef53d8.0","@material/mwc-icon":"0.14.0-canary.97ef53d8.0","@material/mwc-line-ripple":"0.14.0-canary.97ef53d8.0","@material/mwc-notched-outline":"0.14.0-canary.97ef53d8.0","@material/shape":"=6.0.0-canary.69edc6e28.0","@material/textfield":"=6.0.0-canary.69edc6e28.0","@material/theme":"=6.0.0-canary.69edc6e28.0","lit-element":"^2.2.1","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"c6865476c6b2c4ccebc9f20145aa8fdf93e1252f","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c6865476c6b2c4ccebc9f20145aa8fdf93e1252f/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for Edge and IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c6865476c6b2c4ccebc9f20145aa8fdf93e1252f/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c6865476c6b2c4ccebc9f20145aa8fdf93e1252f/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c6865476c6b2c4ccebc9f20145aa8fdf93e1252f/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c6865476c6b2c4ccebc9f20145aa8fdf93e1252f/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c6865476c6b2c4ccebc9f20145aa8fdf93e1252f/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c6865476c6b2c4ccebc9f20145aa8fdf93e1252f/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c6865476c6b2c4ccebc9f20145aa8fdf93e1252f/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c6865476c6b2c4ccebc9f20145aa8fdf93e1252f/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c6865476c6b2c4ccebc9f20145aa8fdf93e1252f/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c6865476c6b2c4ccebc9f20145aa8fdf93e1252f/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\n| Name                | Type             | Description\n| ------------------- | ---------------- |------------\n| `value`             | `string`         | The input control's value.\n| `type`              | `TextFieldType*` | A string specifying the type of control to render.\n| `label`             | `string`         | Sets floating label value.\n| `placeholder`       | `string`         | Sets disappearing input placeholder.\n| `icon`              | `string`         | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `iconTrailing`      | `string`         | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `disabled`          | `boolean`        | Whether or not the input should be disabled.\n| `charCounter`       | `boolean`        | **Note: requries `maxLength` to be set.** Display character counter with max length.\n| `outlined`          | `boolean`        | Whether or not to show the material outlined variant.\n| `fullwidth`         | `boolean`        | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n| `helper`            | `string`         | Helper text to display below the input. Display default only when focused.\n| `helperPersistent`  | `boolean`        | Always show the helper text despite focus.\n| `required`          | `boolean`        | Displays error state if value is empty and input is blurred.\n| `maxLength`         | `number`         | Maximum length to accept input.\n| `validationMessage` | `string`         | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n| `pattern`           | `string`         | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `min`               | `number`\\|`string`  | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `max`               | `number`\\|`string`  | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `step`              | `number`\\|`null`    | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n| `autoValidate`      | `boolean`           | Reports validity on input rather than only on blur.\n| `validity`          | `ValidityState` (readonly) | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n| `willValidate`      | `boolean` (readonly)       | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n| `validityTransform` | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n| `validateOnInitialRender` | `boolean`            | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's  bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's  bottom line when hovering.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.14.0-canary.97ef53d8.0","_nodeVersion":"10.19.0","_npmVersion":"lerna/3.20.2/node@v10.19.0+x64 (linux)","dist":{"integrity":"sha512-J0KBraKzTWAGgnSi+7KDIeUIiVZscvx5Done9kr6V8l/bV54C8Cc59LaHEkz0fO7JpO/+PT6Ap3av8WyOjgZSQ==","shasum":"b461ab5f18d78707cec9d80fb790daec43ef15fd","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.14.0-canary.97ef53d8.0.tgz","fileCount":20,"unpackedSize":281084,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeWa3OCRA9TVsSAnZWagAAnN4P/ilVp7V2I8e5EZo6e3ph\nmNPbq8++edxacvjntq/iMtNLT9w36aiDGndoeFos98bWnx7GdXzcELBJRs1B\nDLmgmH4ofxF1cx/GZ8J+M4SEmNJo6iifoMC4GrhjQJZZedOKyLBf8m6/oILI\neuI+pb2qt5ftG0ocQ4YA/+oXNFWU8+i/VXjfZP+RSBT0kM0GeTWCx9R8Z17F\n/8cjqABzbF0KDfeKqU5JaKSBqJvadz258luAIxvzm3W3udZsaJgvtMyPSgKq\nhIXPnABotQOxmDAMBp5FQrxYNVtxx/7GocvJNQqkgSb0qjqjpPTBx5wDgpqs\nu6zKFt7NBKWNA2565HxiYPouEEdxiubJhwJlreols4KDg9PrN+t7aOONqRZM\nkWQ13M3L9bzN6zH/iwV21k7Bjn8ULj9Ru/kq65J6Jc3skRGV59oQiYvqp0ru\nCDcFdup92Q17OMjc7IEKTcsxM2m2LmQKWwdcCDmFawUTnR9k1CZC/RgVRKLd\n7pdZRBmOMorY1YLnimBDffJS30+2N3wR61bugH2k1JAAAxbhjNfS198kD9Iy\nzLEWmMIXtViyAdJ3LTa2yr/99MZrKrmyLdPT6RzLl7UOnmKfWJYcfcNIZ2lK\nLdOVVnkMIhbCqAx7zDpI+7p6rcRvaVgQVJ2wzOhZvaAkCx8V41r0y58zuc5v\nU4Bs\r\n=RTwv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCtvEkPauQd898iyTeycY2DLgx6J5t/VxEy1X5SsFKc/AIhAN59hxj4nZ6TcuuS+ZtIoX1nh5UiH7TB6ny6tJfKlx3U"}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"asyncliz","email":"asyncliz@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.14.0-canary.97ef53d8.0_1582935502054_0.2797715416765236"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.14.0-canary.24f5fa6e.0":{"name":"@material/mwc-textfield","version":"0.14.0-canary.24f5fa6e.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.69edc6e28.0","@material/line-ripple":"=6.0.0-canary.69edc6e28.0","@material/mwc-base":"0.14.0-canary.24f5fa6e.0","@material/mwc-floating-label":"0.14.0-canary.24f5fa6e.0","@material/mwc-icon":"0.14.0-canary.24f5fa6e.0","@material/mwc-line-ripple":"0.14.0-canary.24f5fa6e.0","@material/mwc-notched-outline":"0.14.0-canary.24f5fa6e.0","@material/shape":"=6.0.0-canary.69edc6e28.0","@material/textfield":"=6.0.0-canary.69edc6e28.0","@material/theme":"=6.0.0-canary.69edc6e28.0","lit-element":"^2.2.1","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"e884595521a6f82f63b8dec96fc4450410e37a09","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e884595521a6f82f63b8dec96fc4450410e37a09/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for Edge and IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e884595521a6f82f63b8dec96fc4450410e37a09/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e884595521a6f82f63b8dec96fc4450410e37a09/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e884595521a6f82f63b8dec96fc4450410e37a09/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e884595521a6f82f63b8dec96fc4450410e37a09/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e884595521a6f82f63b8dec96fc4450410e37a09/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e884595521a6f82f63b8dec96fc4450410e37a09/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e884595521a6f82f63b8dec96fc4450410e37a09/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e884595521a6f82f63b8dec96fc4450410e37a09/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e884595521a6f82f63b8dec96fc4450410e37a09/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e884595521a6f82f63b8dec96fc4450410e37a09/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\n| Name                | Type             | Description\n| ------------------- | ---------------- |------------\n| `value`             | `string`         | The input control's value.\n| `type`              | `TextFieldType*` | A string specifying the type of control to render.\n| `label`             | `string`         | Sets floating label value.\n| `placeholder`       | `string`         | Sets disappearing input placeholder.\n| `icon`              | `string`         | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `iconTrailing`      | `string`         | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `disabled`          | `boolean`        | Whether or not the input should be disabled.\n| `charCounter`       | `boolean`        | **Note: requries `maxLength` to be set.** Display character counter with max length.\n| `outlined`          | `boolean`        | Whether or not to show the material outlined variant.\n| `fullwidth`         | `boolean`        | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n| `helper`            | `string`         | Helper text to display below the input. Display default only when focused.\n| `helperPersistent`  | `boolean`        | Always show the helper text despite focus.\n| `required`          | `boolean`        | Displays error state if value is empty and input is blurred.\n| `maxLength`         | `number`         | Maximum length to accept input.\n| `validationMessage` | `string`         | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n| `pattern`           | `string`         | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `min`               | `number`\\|`string`  | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `max`               | `number`\\|`string`  | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `step`              | `number`\\|`null`    | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n| `autoValidate`      | `boolean`           | Reports validity on input rather than only on blur.\n| `validity`          | `ValidityState` (readonly) | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n| `willValidate`      | `boolean` (readonly)       | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n| `validityTransform` | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n| `validateOnInitialRender` | `boolean`            | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's  bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's  bottom line when hovering.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.14.0-canary.24f5fa6e.0","_nodeVersion":"10.19.0","_npmVersion":"lerna/3.20.2/node@v10.19.0+x64 (linux)","dist":{"integrity":"sha512-HkDnvKwem78BU/dRRnwjsNCMb7MWjJH/wHjMsVhdsGRRtQUBvBHSzcuzICQZV0VLHu2l8aMbxxsR3uGtAKE7Bw==","shasum":"8dad32b0fb9466ffd99ecefdd5996008e476311a","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.14.0-canary.24f5fa6e.0.tgz","fileCount":20,"unpackedSize":281084,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeWbmdCRA9TVsSAnZWagAAP10P/0UEWIIejvGzffvWvrrl\nxTXwLAWeHy223hGPzlnyMjG3y5+eVmOTouwuxfHymelVc9pzGO2GN6h2iauA\nb2rN9hEWmWZY3PwBujwq7fHt8tfy2ugNefCIcfSRP2IjKnbjVxHX9QcX7q8m\nq2DfmSXvtFQ94X3pnWY2vvdgjTNpHUKeOSCEclFrkK/VUVPNI5h36dJhOYRL\nEOlKpdJC9SlsD/vjhlMk1My4KRa9i3ghfB9orT1chlO5qQO4CRyxr5UdAcQV\nufBhTGo9Doiu8nqUZQ46JYlC9wpAN5Lr7cEhpuHqMWSEMfZjCq0XdhXix+HD\nE383Aw+bJFzGtq0RYx7g+DcwJP88BXx3XthYGHLwULU5YCl3DW7Uz6b3ureZ\n1/HJ/ooDBiGTHB8yArXFVsRAvPIRX/CS6OFV1el5unLB9fFH0uE41h6sXEnL\n0LiW26ClBgYYsGKWHuXq20OWSEm5NEWcqb9GiV70Eksf9dKBsHkIjDpZqbNv\nwFyF+9w7vs0dvM1k5Tz5PIswOCKAc/A8rMnOpwjysH4XmH0vZjB2RRPPscU2\n9x4uwpe/JhyHZdYNBJirwnIK+Ka8EA7LJQDm02F/yzzEWamxs72E8oi8Dfxr\nwMLG1qxXE/uvFntsaL/t8m7ouwrX2Aj4RaYCtSzbJR6oRLxFO82Yx2NQMsqc\nUiQ8\r\n=S+9I\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBBlaOCrhacxLkJ84EPNFJvk1yKEFtyV5On9IMkYltJtAiEApUJoPaIoigdq0hg7ykfQmt7YhgXqmo9xqvQgSDptjL8="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.14.0-canary.24f5fa6e.0_1582938524774_0.09495413736340286"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.14.0-canary.960e214f.0":{"name":"@material/mwc-textfield","version":"0.14.0-canary.960e214f.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.69edc6e28.0","@material/line-ripple":"=6.0.0-canary.69edc6e28.0","@material/mwc-base":"0.14.0-canary.960e214f.0","@material/mwc-floating-label":"0.14.0-canary.960e214f.0","@material/mwc-icon":"0.14.0-canary.960e214f.0","@material/mwc-line-ripple":"0.14.0-canary.960e214f.0","@material/mwc-notched-outline":"0.14.0-canary.960e214f.0","@material/shape":"=6.0.0-canary.69edc6e28.0","@material/textfield":"=6.0.0-canary.69edc6e28.0","@material/theme":"=6.0.0-canary.69edc6e28.0","lit-element":"^2.2.1","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"9c56e2bea6eda03e423f3f7ba00cf95f684660f2","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9c56e2bea6eda03e423f3f7ba00cf95f684660f2/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for Edge and IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9c56e2bea6eda03e423f3f7ba00cf95f684660f2/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9c56e2bea6eda03e423f3f7ba00cf95f684660f2/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9c56e2bea6eda03e423f3f7ba00cf95f684660f2/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9c56e2bea6eda03e423f3f7ba00cf95f684660f2/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9c56e2bea6eda03e423f3f7ba00cf95f684660f2/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9c56e2bea6eda03e423f3f7ba00cf95f684660f2/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9c56e2bea6eda03e423f3f7ba00cf95f684660f2/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9c56e2bea6eda03e423f3f7ba00cf95f684660f2/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9c56e2bea6eda03e423f3f7ba00cf95f684660f2/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9c56e2bea6eda03e423f3f7ba00cf95f684660f2/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\n| Name                | Type             | Description\n| ------------------- | ---------------- |------------\n| `value`             | `string`         | The input control's value.\n| `type`              | `TextFieldType*` | A string specifying the type of control to render.\n| `label`             | `string`         | Sets floating label value.\n| `placeholder`       | `string`         | Sets disappearing input placeholder.\n| `icon`              | `string`         | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `iconTrailing`      | `string`         | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `disabled`          | `boolean`        | Whether or not the input should be disabled.\n| `charCounter`       | `boolean`        | **Note: requries `maxLength` to be set.** Display character counter with max length.\n| `outlined`          | `boolean`        | Whether or not to show the material outlined variant.\n| `fullwidth`         | `boolean`        | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n| `helper`            | `string`         | Helper text to display below the input. Display default only when focused.\n| `helperPersistent`  | `boolean`        | Always show the helper text despite focus.\n| `required`          | `boolean`        | Displays error state if value is empty and input is blurred.\n| `maxLength`         | `number`         | Maximum length to accept input.\n| `validationMessage` | `string`         | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n| `pattern`           | `string`         | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `min`               | `number`\\|`string`  | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `max`               | `number`\\|`string`  | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `step`              | `number`\\|`null`    | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n| `autoValidate`      | `boolean`           | Reports validity on input rather than only on blur.\n| `validity`          | `ValidityState` (readonly) | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n| `willValidate`      | `boolean` (readonly)       | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n| `validityTransform` | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n| `validateOnInitialRender` | `boolean`            | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's  bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's  bottom line when hovering.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.14.0-canary.960e214f.0","_nodeVersion":"10.19.0","_npmVersion":"lerna/3.20.2/node@v10.19.0+x64 (linux)","dist":{"integrity":"sha512-bgJb7nXMI6sG6qY9ZAV0SknPu6iVlQijn31LktwNf7b8689GfM7jqpU1usWb15s+Rx0ASOpFA7Drh6BMhzfKkA==","shasum":"15f8d096ce26d5ee6586d25eafafb344353ef614","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.14.0-canary.960e214f.0.tgz","fileCount":20,"unpackedSize":281093,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeWdXSCRA9TVsSAnZWagAAW5AP+gIZeScnvO622CSFvhxW\nI00D2DHKo4qOaeN8x57VFFYAM6c/k6U8Tvqw1OD6mfLDXPPfG2+pfNBank6D\neZO2bxyUFnLQdsQKZcjrPvCiUYMmeVmO9mamOUfv8Kq2VDrafKjVAz1YpihI\nS8OrZeGfEtSeWajUWk+pnqJQxctEdWGsGMc4XLwy9WM9EmUycAaGg2Oac0do\nAdx/Ma11oZsFiDNn0LMHfHyMhN9pE68ivC6fw2bAwM8Kc4nP2uo7qOxryWGF\nBwO5eGzG7JXA9p8nwJvLZKTW6lGji84J9gdSYV6do1Pkcr2QN6KEwpU6uF48\nnkVODh5ziQk/9vNRjiib9JhEDkPPdXg4rT3eZV+yBG/vn4nb41o5pMLp2b0+\nU4662HS48tg7lKRmtNc7xYYVSArqAKfkw/GvzSvPQt0udjUeX3ttx9bXf219\n1m81jZVuvkpWSq61h7bjUTsecacxSAcaC7rS+fYrmOqIx3ZWPTIaEXFIDWQk\n6rxjTemOUvPjtRVI1nsDZhjxKc+03ZfbeTQp+Eri2ZDG+92Hd0AKXd5YdHYa\n6ghjkU/D5++uvTdaEgUPHHx+zfkXwDbf/p9dq1yndnXwvqovj50trWljdMQ4\no0RUPWGjJnS3KAFX+q4LwbLtazNL8kCOAexe6yjpxI20tfEdi4yPjeDKrOVU\nnoJ+\r\n=Nim/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHIOYnnVabbsBxsENFuH8KtMiALz5QtFG0eoD7iLg0LjAiEAwC/Llsh2F4dyRDz+hQEoK4JojA2IWQ079BJk6Ck8uZ0="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.14.0-canary.960e214f.0_1582945746034_0.5455923418846103"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.14.0-canary.a2f046f5.0":{"name":"@material/mwc-textfield","version":"0.14.0-canary.a2f046f5.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.69edc6e28.0","@material/line-ripple":"=6.0.0-canary.69edc6e28.0","@material/mwc-base":"0.14.0-canary.a2f046f5.0","@material/mwc-floating-label":"0.14.0-canary.a2f046f5.0","@material/mwc-icon":"0.14.0-canary.a2f046f5.0","@material/mwc-line-ripple":"0.14.0-canary.a2f046f5.0","@material/mwc-notched-outline":"0.14.0-canary.a2f046f5.0","@material/shape":"=6.0.0-canary.69edc6e28.0","@material/textfield":"=6.0.0-canary.69edc6e28.0","@material/theme":"=6.0.0-canary.69edc6e28.0","lit-element":"^2.2.1","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"b2845ca1286088f29e79c96b6d5c5367873cce11","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b2845ca1286088f29e79c96b6d5c5367873cce11/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b2845ca1286088f29e79c96b6d5c5367873cce11/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b2845ca1286088f29e79c96b6d5c5367873cce11/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b2845ca1286088f29e79c96b6d5c5367873cce11/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b2845ca1286088f29e79c96b6d5c5367873cce11/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b2845ca1286088f29e79c96b6d5c5367873cce11/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b2845ca1286088f29e79c96b6d5c5367873cce11/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b2845ca1286088f29e79c96b6d5c5367873cce11/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b2845ca1286088f29e79c96b6d5c5367873cce11/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b2845ca1286088f29e79c96b6d5c5367873cce11/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b2845ca1286088f29e79c96b6d5c5367873cce11/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\n| Name                | Type             | Description\n| ------------------- | ---------------- |------------\n| `value`             | `string`         | The input control's value.\n| `type`              | `TextFieldType*` | A string specifying the type of control to render.\n| `label`             | `string`         | Sets floating label value.\n| `placeholder`       | `string`         | Sets disappearing input placeholder.\n| `icon`              | `string`         | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `iconTrailing`      | `string`         | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `disabled`          | `boolean`        | Whether or not the input should be disabled.\n| `charCounter`       | `boolean`        | **Note: requries `maxLength` to be set.** Display character counter with max length.\n| `outlined`          | `boolean`        | Whether or not to show the material outlined variant.\n| `fullwidth`         | `boolean`        | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n| `helper`            | `string`         | Helper text to display below the input. Display default only when focused.\n| `helperPersistent`  | `boolean`        | Always show the helper text despite focus.\n| `required`          | `boolean`        | Displays error state if value is empty and input is blurred.\n| `maxLength`         | `number`         | Maximum length to accept input.\n| `validationMessage` | `string`         | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n| `pattern`           | `string`         | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `min`               | `number`\\|`string`  | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `max`               | `number`\\|`string`  | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `step`              | `number`\\|`null`    | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n| `autoValidate`      | `boolean`           | Reports validity on input rather than only on blur.\n| `validity`          | `ValidityState` (readonly) | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n| `willValidate`      | `boolean` (readonly)       | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n| `validityTransform` | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n| `validateOnInitialRender` | `boolean`            | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's  bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's  bottom line when hovering.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.14.0-canary.a2f046f5.0","_nodeVersion":"10.19.0","_npmVersion":"lerna/3.20.2/node@v10.19.0+x64 (linux)","dist":{"integrity":"sha512-q6zExZ7MG1ma4QUCo1u3YQiWcWT61MQbW3jC8j1QpsxrY/B80Epm5UxqzO6MM/5SO3Vc1xafv9ugyP0EzQm3gw==","shasum":"249bd97504c53e2373cbb6030b43b21692c3fb25","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.14.0-canary.a2f046f5.0.tgz","fileCount":20,"unpackedSize":281084,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeXatJCRA9TVsSAnZWagAAXk8P/0A3nWEb4sgqLTQ73QTp\n7EBsBX4NgOEB9+e3DSVC7Hj+1B2jMCBvmec4henmCmn8z1Idi8+/xRYxmsqm\nlSJX2+A3DO0V85dKyUU0La+UQfB0B8pbF9fdzi2h+RateiSFpRPauhQo6Tfo\n2uuiLHK8Ejf5odQJ+38LbVQQig9V7SXSo9Vs5oPPXDBouUquuhmPR4P70hpQ\nzNq4O46K2UktDo4x19ikQY4XJoaw5kyo9LlsF9vCMap8tGWF4T86sgBedqSj\nGHgm+g0ADVXUI7atwBaxu0A08KmVbJlCuobaPbcbf49KiCNGFDUQKs2xc00e\n/YRNwjJZu3CdReX8IG/zucyjtOL2PpBR+gBANptABU8rgxT1X5/o535ieVaP\ni2kLM5RqEs6yZ5FH9XEPdM6KUi7ClcY0XMfIjuw9wHi4QTAMk2TBgwmfm27m\n3KsILH8NrZXNiP6LIe3ZcpsGGZiIBrKRWKvRzt8j0MZI89mlv5utIK+Lal2q\nUp8Y2s7HhkaeACXNSF+a4lyRG5xdjUtfV7W7s8W/IiYAcy9rwbus/h/oDwsn\nm+VC7bSkYgWbKCH6LwB8oxAGNNnrwOqj+Uka8VxBYAUbLwlLQkHXj37l2LEh\nRxETQeG8bKaNl82AK4VFDfhxRHodEf0O8zpztdXoiY5keMLSObJN09MXgCkh\nzAq9\r\n=Eh33\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEOYxtHrZ3tgGvepXDvYevjpBgDFZ3GGzwFbh5YAZW/6AiEA608MXxZ9CB8SAFgQRoArOY/ULrT4BAGXvf5aqPZ6nkU="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.14.0-canary.a2f046f5.0_1583197001327_0.6959543314241952"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.14.0-canary.024f371a.0":{"name":"@material/mwc-textfield","version":"0.14.0-canary.024f371a.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.69edc6e28.0","@material/line-ripple":"=6.0.0-canary.69edc6e28.0","@material/mwc-base":"0.14.0-canary.024f371a.0","@material/mwc-floating-label":"0.14.0-canary.024f371a.0","@material/mwc-icon":"0.14.0-canary.024f371a.0","@material/mwc-line-ripple":"0.14.0-canary.024f371a.0","@material/mwc-notched-outline":"0.14.0-canary.024f371a.0","@material/shape":"=6.0.0-canary.69edc6e28.0","@material/textfield":"=6.0.0-canary.69edc6e28.0","@material/theme":"=6.0.0-canary.69edc6e28.0","lit-element":"^2.2.1","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"efde2be2f22a9a7e20f2b0d57c4cddee405ada0b","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/efde2be2f22a9a7e20f2b0d57c4cddee405ada0b/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/efde2be2f22a9a7e20f2b0d57c4cddee405ada0b/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/efde2be2f22a9a7e20f2b0d57c4cddee405ada0b/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/efde2be2f22a9a7e20f2b0d57c4cddee405ada0b/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/efde2be2f22a9a7e20f2b0d57c4cddee405ada0b/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/efde2be2f22a9a7e20f2b0d57c4cddee405ada0b/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/efde2be2f22a9a7e20f2b0d57c4cddee405ada0b/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/efde2be2f22a9a7e20f2b0d57c4cddee405ada0b/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/efde2be2f22a9a7e20f2b0d57c4cddee405ada0b/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/efde2be2f22a9a7e20f2b0d57c4cddee405ada0b/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/efde2be2f22a9a7e20f2b0d57c4cddee405ada0b/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\n| Name                | Type             | Description\n| ------------------- | ---------------- |------------\n| `value`             | `string`         | The input control's value.\n| `type`              | `TextFieldType*` | A string specifying the type of control to render.\n| `label`             | `string`         | Sets floating label value.\n| `placeholder`       | `string`         | Sets disappearing input placeholder.\n| `icon`              | `string`         | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `iconTrailing`      | `string`         | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `disabled`          | `boolean`        | Whether or not the input should be disabled.\n| `charCounter`       | `boolean`        | **Note: requries `maxLength` to be set.** Display character counter with max length.\n| `outlined`          | `boolean`        | Whether or not to show the material outlined variant.\n| `fullwidth`         | `boolean`        | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n| `helper`            | `string`         | Helper text to display below the input. Display default only when focused.\n| `helperPersistent`  | `boolean`        | Always show the helper text despite focus.\n| `required`          | `boolean`        | Displays error state if value is empty and input is blurred.\n| `maxLength`         | `number`         | Maximum length to accept input.\n| `validationMessage` | `string`         | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n| `pattern`           | `string`         | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `min`               | `number`\\|`string`  | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `max`               | `number`\\|`string`  | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `step`              | `number`\\|`null`    | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n| `autoValidate`      | `boolean`           | Reports validity on input rather than only on blur.\n| `validity`          | `ValidityState` (readonly) | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n| `willValidate`      | `boolean` (readonly)       | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n| `validityTransform` | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n| `validateOnInitialRender` | `boolean`            | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's  bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's  bottom line when hovering.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.14.0-canary.024f371a.0","_nodeVersion":"10.19.0","_npmVersion":"lerna/3.20.2/node@v10.19.0+x64 (linux)","dist":{"integrity":"sha512-4wfDfhGIUX0ttLrR5nIACus+4qSD05adZ9a1JybKwh3CXxf47T7xw1RMZxzg9sqe3HaAighIUO5y40YRsrpzPw==","shasum":"46b1122d76810b07e48eea0884cbec04d8f71262","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.14.0-canary.024f371a.0.tgz","fileCount":20,"unpackedSize":281084,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeXbLaCRA9TVsSAnZWagAAWugP/2uSSw8dnPkdby/T948V\n07emjfrbcpqxzHQup2KIJ9lfyRdZ4+rVgFyaMZ/oCsfIpNaE2XfuthqB4Rjp\nvHwHdaKg5eapaGEyKWqO34yORThFzXO/NHzDnW8+xZZWjWk7plJKnckGrkAm\nukAd5uqD2vyaTLvFOFj3J+NO5I4U6raqElTuxpJ1ZlmlZ2gSfGz9GpWyCOLF\n0vxrUTJIEX8JUSjgJcxNgMEi4NMxXX58hDAbY5XTkvQ4P/L0EaGvfcMmTMHo\nM7MaDf7Jo+izDY4Bppkn+9LuUjjv8G9k86I7+GtUJdXpn0SLVn/IPI9E3tKk\nznGPYkrfp9w5KPbVevNLxqhKiuY6EvvBd5k9//T/tOe6dPPIzwbiVznUk3eB\npLOvmA3N7IDxSFGilNCw2znPhaxrGqMVnRWfExLzH99pyals+Ng479tgHctK\ncaiOV0XrIcCbgCQ0Beux42PfS/lEuJSQxGOezuEVT+XRIxzNSGliVD2Nu6O2\ntUepDARPYXwK385puI+rQojFiv1akRjMHo26iRojmYRLqm8YVoXMa/ZI1bVL\nh28qyxAMjzawcsBEPBwdVF+lBeYmjHrLcS0NqiAPiEJdKFTj6aXhvtXuR5JY\n1L6wNHDA448bKxISykyZ0+mdImiYd+NrLPHRN9wLVLOLhAGwz3Sh9IvExYiO\nb7pT\r\n=ak5Z\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDt8aFdhgJ+sE7DGukP/xV05qvVrabnnsM0/nqXC2YSWgIgVU8P1GQhjCLFwfrvSz79l1AV0/6jJ6PqMo6LPzczCYU="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.14.0-canary.024f371a.0_1583198937670_0.3225903279810407"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.14.0-canary.2f164110.0":{"name":"@material/mwc-textfield","version":"0.14.0-canary.2f164110.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.9372e4939.0","@material/line-ripple":"=6.0.0-canary.9372e4939.0","@material/mwc-base":"0.14.0-canary.2f164110.0","@material/mwc-floating-label":"0.14.0-canary.2f164110.0","@material/mwc-icon":"0.14.0-canary.2f164110.0","@material/mwc-line-ripple":"0.14.0-canary.2f164110.0","@material/mwc-notched-outline":"0.14.0-canary.2f164110.0","@material/shape":"=6.0.0-canary.9372e4939.0","@material/textfield":"=6.0.0-canary.9372e4939.0","@material/theme":"=6.0.0-canary.9372e4939.0","lit-element":"^2.2.1","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"288331a2ec51b59facb4791d01e4d2ba8f4b7cc0","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/288331a2ec51b59facb4791d01e4d2ba8f4b7cc0/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/288331a2ec51b59facb4791d01e4d2ba8f4b7cc0/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/288331a2ec51b59facb4791d01e4d2ba8f4b7cc0/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/288331a2ec51b59facb4791d01e4d2ba8f4b7cc0/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/288331a2ec51b59facb4791d01e4d2ba8f4b7cc0/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/288331a2ec51b59facb4791d01e4d2ba8f4b7cc0/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/288331a2ec51b59facb4791d01e4d2ba8f4b7cc0/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/288331a2ec51b59facb4791d01e4d2ba8f4b7cc0/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/288331a2ec51b59facb4791d01e4d2ba8f4b7cc0/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/288331a2ec51b59facb4791d01e4d2ba8f4b7cc0/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/288331a2ec51b59facb4791d01e4d2ba8f4b7cc0/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\n| Name                | Type             | Description\n| ------------------- | ---------------- |------------\n| `value`             | `string`         | The input control's value.\n| `type`              | `TextFieldType*` | A string specifying the type of control to render.\n| `label`             | `string`         | Sets floating label value.\n| `placeholder`       | `string`         | Sets disappearing input placeholder.\n| `icon`              | `string`         | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `iconTrailing`      | `string`         | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `disabled`          | `boolean`        | Whether or not the input should be disabled.\n| `charCounter`       | `boolean`        | **Note: requries `maxLength` to be set.** Display character counter with max length.\n| `outlined`          | `boolean`        | Whether or not to show the material outlined variant.\n| `fullwidth`         | `boolean`        | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n| `helper`            | `string`         | Helper text to display below the input. Display default only when focused.\n| `helperPersistent`  | `boolean`        | Always show the helper text despite focus.\n| `required`          | `boolean`        | Displays error state if value is empty and input is blurred.\n| `maxLength`         | `number`         | Maximum length to accept input.\n| `validationMessage` | `string`         | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n| `pattern`           | `string`         | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `min`               | `number`\\|`string`  | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `max`               | `number`\\|`string`  | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `step`              | `number`\\|`null`    | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n| `autoValidate`      | `boolean`           | Reports validity on input rather than only on blur.\n| `validity`          | `ValidityState` (readonly) | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n| `willValidate`      | `boolean` (readonly)       | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n| `validityTransform` | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n| `validateOnInitialRender` | `boolean`            | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's  bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's  bottom line when hovering.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.14.0-canary.2f164110.0","_nodeVersion":"10.19.0","_npmVersion":"lerna/3.20.2/node@v10.19.0+x64 (linux)","dist":{"integrity":"sha512-VYH2jJd5EOkTNdmFDngIt1vDPeo3ykTLCOdCRBaDgcM1tC3xC0RO/UmEIwjjw2L/0ZlKrH5Qesl2f/y/kmDO2Q==","shasum":"0d1e0835da26a59d471706c18dfe6b5c2b3b6fd2","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.14.0-canary.2f164110.0.tgz","fileCount":20,"unpackedSize":281084,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeXs0+CRA9TVsSAnZWagAApr0P/RH6ACfpOjmWnhpq3qOH\nyHMl4gXDvcksS928pVnK8D3RrsScolP69hb5mVVWamdsI63z3rKdOYQKzdv7\nTNIpPtP4Ju8BU0ZjgYdcQ2sOfIJXz7sxrs/UnnWXIIhGLwR0nODlwvmj7i60\nUnFsWcppcoSHM8VCYpwUIWY5MPh9mrfTrn1EIf5AaQHl7w1kR7IHdO7BT7Gb\nDeOC7GjNecECd4Xe7eVKjKW6cwyPW+OYKjAeHlwUoMgHsxVnQbT+QkBhlHF+\n7NtRvMC3XhlSYZDd5CLYThSTuVLsK2v/VhFVGS4UZm0FY3OEBFvPKKxEdQ5M\nHbcsm7DuJBkUSzE8vVk33d9kl9rQedn/kIlFdv2vvYF77PGq6xYsHUuhd2WG\nxzSsbpsjxWjIij8XOFql44bTIdTPxCCE085uOQD+VxnMzd3+mfcjkU1kmT7y\nHKYDYfcLEodNYriJ/xfmNzZGsxh6KGVM+zyalzAUzdteRkFcISMtMbTnPqrN\nEtFE25FWAKW4dfCjNbTxZ1yDLbRHXOpRDPPVXA5PFyPwbJF+4IcbjeCM4xfd\n3uFTKWe1OfOIPCqJy9oG75UpwescFv2F31uwdupg7GIv1BtoXEmuVjghSV1F\n943Gyy/78IOkRlyU5xGelZE/6mJueHlL4rB/I9YstadIGU+90X9ElyGuqfbc\nElmm\r\n=AcJp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDO1ehe0QtSW7IouHWvHRKONWzff27DTkPMqirZOf9xDgIhAIZepwqRFiw0X/PCF6bVDkRYwX+RP23048naZdWOon+J"}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.14.0-canary.2f164110.0_1583271229964_0.46060031537225243"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.14.0-canary.edd465cd.0":{"name":"@material/mwc-textfield","version":"0.14.0-canary.edd465cd.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.9cf5e9842.0","@material/line-ripple":"=6.0.0-canary.9cf5e9842.0","@material/mwc-base":"0.14.0-canary.edd465cd.0","@material/mwc-floating-label":"0.14.0-canary.edd465cd.0","@material/mwc-icon":"0.14.0-canary.edd465cd.0","@material/mwc-line-ripple":"0.14.0-canary.edd465cd.0","@material/mwc-notched-outline":"0.14.0-canary.edd465cd.0","@material/shape":"=6.0.0-canary.9cf5e9842.0","@material/textfield":"=6.0.0-canary.9cf5e9842.0","@material/theme":"=6.0.0-canary.9cf5e9842.0","lit-element":"^2.2.1","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"3954ee24dd2fd1d9171cd7a967586e7d2b34ae38","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3954ee24dd2fd1d9171cd7a967586e7d2b34ae38/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3954ee24dd2fd1d9171cd7a967586e7d2b34ae38/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3954ee24dd2fd1d9171cd7a967586e7d2b34ae38/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3954ee24dd2fd1d9171cd7a967586e7d2b34ae38/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3954ee24dd2fd1d9171cd7a967586e7d2b34ae38/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3954ee24dd2fd1d9171cd7a967586e7d2b34ae38/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3954ee24dd2fd1d9171cd7a967586e7d2b34ae38/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3954ee24dd2fd1d9171cd7a967586e7d2b34ae38/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3954ee24dd2fd1d9171cd7a967586e7d2b34ae38/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3954ee24dd2fd1d9171cd7a967586e7d2b34ae38/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3954ee24dd2fd1d9171cd7a967586e7d2b34ae38/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\n| Name                | Type             | Description\n| ------------------- | ---------------- |------------\n| `value`             | `string`         | The input control's value.\n| `type`              | `TextFieldType*` | A string specifying the type of control to render.\n| `label`             | `string`         | Sets floating label value.\n| `placeholder`       | `string`         | Sets disappearing input placeholder.\n| `icon`              | `string`         | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `iconTrailing`      | `string`         | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `disabled`          | `boolean`        | Whether or not the input should be disabled.\n| `charCounter`       | `boolean`        | **Note: requries `maxLength` to be set.** Display character counter with max length.\n| `outlined`          | `boolean`        | Whether or not to show the material outlined variant.\n| `fullwidth`         | `boolean`        | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n| `helper`            | `string`         | Helper text to display below the input. Display default only when focused.\n| `helperPersistent`  | `boolean`        | Always show the helper text despite focus.\n| `required`          | `boolean`        | Displays error state if value is empty and input is blurred.\n| `maxLength`         | `number`         | Maximum length to accept input.\n| `validationMessage` | `string`         | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n| `pattern`           | `string`         | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `min`               | `number`\\|`string`  | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `max`               | `number`\\|`string`  | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `step`              | `number`\\|`null`    | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n| `autoValidate`      | `boolean`           | Reports validity on input rather than only on blur.\n| `validity`          | `ValidityState` (readonly) | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n| `willValidate`      | `boolean` (readonly)       | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n| `validityTransform` | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n| `validateOnInitialRender` | `boolean`            | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's  bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's  bottom line when hovering.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.14.0-canary.edd465cd.0","_nodeVersion":"10.19.0","_npmVersion":"lerna/3.20.2/node@v10.19.0+x64 (linux)","dist":{"integrity":"sha512-efyCU65/cxUUL7yJudF7OY8J1tWMP6+eKtbu3xuSf/nAX4SSu/tRpt6kzu21D3UIscAkAj751xHmkE60y2/gBQ==","shasum":"357a13fd1c7a2afec7e71a647bbe707bdde0ac2f","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.14.0-canary.edd465cd.0.tgz","fileCount":20,"unpackedSize":281084,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeXvIGCRA9TVsSAnZWagAAvDUP/0NiVebxPaW57re7c37w\nn7K7soPtvANL3HxnUmoiyODqgx4raQMLx+8dzGtMNHbhKDcylEs7CgZ55Jom\nnaXLIvMpN9kzyBrZF6AHtUFs1SOBEgFYQc8RoSO3BGUfCyGCk1jnY/1wXjGV\nmXMjG4U3oVWj22R1qic3eValEHV9lvKhVsHTqezO4KqSWVNPCSOzcCsLA4n4\ncDEOFpp4PbtMJLus624sDHFhdK37Fnxz6wDhlqHnPBNoyZxRLYOJkRlGAex0\nRpdoTluc7oyzREQSdHZQJe+XuTYdW/k8LMubqyLQnSGn6hcFnGV2pvz8fKcG\n1GpO+LyBNwo9CaDzRLSnBkpsxL2ILpy+QKWzzwNe5+oduS/KyDlTcmxwYeQe\nofJbChnwVg8ThT+8Dk5XhdjDDkDpDeUV9Vy+z/5be4FFn2gPa6O7lGLfHir5\nJC5yEg1x+eLYVMiY03BblAsXhXWLO5wWh55PA0RdZLF4q2SxCApNp4dMmdgx\nJPS1Qv9FUKTZJSmFwLd5J4sWxgJORvKyVU2NF4QBHwBkLsCLe6N68QLQJoIV\nsI5dSEZAn7xq5fh5PnBfWcP997R9cJsbSitzcVUcZz7Ox9CKTCfUvHszppM0\nY0Xbv8AoTghS+reQJF2dSPJkI9KKO7hoph4cGo+Bhsx/CwnIXMssMsJSV+JJ\njvdw\r\n=Y8Ei\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCPlMhBR37/QEOauDixVAyrVcKsqFvO/RoNwTpimlC1FAIhALgqghlxdFN7YWdNvld+ClfIU7LuUKSdiJDDcdBUWpRX"}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.14.0-canary.edd465cd.0_1583280645644_0.558302299655542"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.14.0-canary.2b02d017.0":{"name":"@material/mwc-textfield","version":"0.14.0-canary.2b02d017.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.9cf5e9842.0","@material/line-ripple":"=6.0.0-canary.9cf5e9842.0","@material/mwc-base":"0.14.0-canary.2b02d017.0","@material/mwc-floating-label":"0.14.0-canary.2b02d017.0","@material/mwc-icon":"0.14.0-canary.2b02d017.0","@material/mwc-line-ripple":"0.14.0-canary.2b02d017.0","@material/mwc-notched-outline":"0.14.0-canary.2b02d017.0","@material/shape":"=6.0.0-canary.9cf5e9842.0","@material/textfield":"=6.0.0-canary.9cf5e9842.0","@material/theme":"=6.0.0-canary.9cf5e9842.0","lit-element":"^2.2.1","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"2f2999d0bc0326feb2bf856866fd9238c59ca246","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2f2999d0bc0326feb2bf856866fd9238c59ca246/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2f2999d0bc0326feb2bf856866fd9238c59ca246/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2f2999d0bc0326feb2bf856866fd9238c59ca246/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2f2999d0bc0326feb2bf856866fd9238c59ca246/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2f2999d0bc0326feb2bf856866fd9238c59ca246/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2f2999d0bc0326feb2bf856866fd9238c59ca246/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2f2999d0bc0326feb2bf856866fd9238c59ca246/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2f2999d0bc0326feb2bf856866fd9238c59ca246/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2f2999d0bc0326feb2bf856866fd9238c59ca246/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2f2999d0bc0326feb2bf856866fd9238c59ca246/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2f2999d0bc0326feb2bf856866fd9238c59ca246/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\n| Name                | Type             | Description\n| ------------------- | ---------------- |------------\n| `value`             | `string`         | The input control's value.\n| `type`              | `TextFieldType*` | A string specifying the type of control to render.\n| `label`             | `string`         | Sets floating label value.\n| `placeholder`       | `string`         | Sets disappearing input placeholder.\n| `icon`              | `string`         | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `iconTrailing`      | `string`         | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `disabled`          | `boolean`        | Whether or not the input should be disabled.\n| `charCounter`       | `boolean`        | **Note: requries `maxLength` to be set.** Display character counter with max length.\n| `outlined`          | `boolean`        | Whether or not to show the material outlined variant.\n| `fullwidth`         | `boolean`        | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n| `helper`            | `string`         | Helper text to display below the input. Display default only when focused.\n| `helperPersistent`  | `boolean`        | Always show the helper text despite focus.\n| `required`          | `boolean`        | Displays error state if value is empty and input is blurred.\n| `maxLength`         | `number`         | Maximum length to accept input.\n| `validationMessage` | `string`         | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n| `pattern`           | `string`         | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `min`               | `number`\\|`string`  | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `max`               | `number`\\|`string`  | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `step`              | `number`\\|`null`    | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n| `autoValidate`      | `boolean`           | Reports validity on input rather than only on blur.\n| `validity`          | `ValidityState` (readonly) | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n| `willValidate`      | `boolean` (readonly)       | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n| `validityTransform` | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n| `validateOnInitialRender` | `boolean`            | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's  bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's  bottom line when hovering.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.14.0-canary.2b02d017.0","_nodeVersion":"10.19.0","_npmVersion":"lerna/3.20.2/node@v10.19.0+x64 (linux)","dist":{"integrity":"sha512-6T6mw58PVAxaa02XjuwP+DVgAzBhfccH5mfRUl7c61LIYjNunirhKGXmq6s2Gh995l0hgJqt8bHQOw4vUf+l1g==","shasum":"75f4dcf78d51b854c2c19dd04196e700e4b19b23","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.14.0-canary.2b02d017.0.tgz","fileCount":20,"unpackedSize":281084,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeYA1ACRA9TVsSAnZWagAAmhEQAKOCK4RVZBc6gT3+u6Oi\nHL+PFfz+tti35pulESNodEnO3UljHOu+BrGXpK3EoOhmdQWcMdF6kmokzjub\nGtW0221T0JvmHlhRbhEtubtlHzyqECFpTFeqicBqzE3gQTWyc/2jF1CQS9Mx\nN34EBiHx/R/niPYULvlyWizv5wEPY22PijrB+tN0o1XkftFSyAGNPQsTMUCW\n8KGtXvK0v6Eibys+yT5ZORWDs0Vipm8TZ6XS5+LC9ycObYZeIQY20wfqfecA\n7DcvhXg57j36ZYi/Wp1OK6ELnzeIdhXQRqC1wAY9WOD3zGLfKlcDIKmQA81i\nbj/2sSQYZ9zUbr9QIcEDzGBJdydJit1U184gzGy27RgwebBCb3RLrjHR/yed\n2HqB7z5MEvn3VilM9HpsiM1PxmlbS8PNz4oywSWU7hECT2jQI7R48SYJ82pR\nB9Ij8LmDzLcGMDFoDtPhXxKBVHsQgVMsgYDKb2fug1btOSZhgelevCUxhZuv\nWxe/aVVHaliXdo9On9LLfw9jg6bDdr+t+O2HTaIiTtmhgDEngjeQg0jHDv9+\nluJejJKX24AVlC1keYBIW7PEE98MXY8AYoAVdeJ/68ycYYiw0gwbBMW604KV\nQCYnHsFvB5Ghji1xgHeYUhs1ZxIBJkTQMe7ewSS/y8brW6rCOk0O7k43tuYq\nt2+Q\r\n=ZRG2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDf7UvE7qOWjhvW70Kjch3Wh//PDYDFAVr/oLy8p6yOLQIgS1Y4Jh6KdBw4m/HZyVgz0SrsFJK1YUSaE0Gv8Z0IvfI="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.14.0-canary.2b02d017.0_1583353152312_0.8290420803880081"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.14.0-canary.cbdfe453.0":{"name":"@material/mwc-textfield","version":"0.14.0-canary.cbdfe453.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.3657f8863.0","@material/line-ripple":"=6.0.0-canary.3657f8863.0","@material/mwc-base":"0.14.0-canary.cbdfe453.0","@material/mwc-floating-label":"0.14.0-canary.cbdfe453.0","@material/mwc-icon":"0.14.0-canary.cbdfe453.0","@material/mwc-line-ripple":"0.14.0-canary.cbdfe453.0","@material/mwc-notched-outline":"0.14.0-canary.cbdfe453.0","@material/shape":"=6.0.0-canary.3657f8863.0","@material/textfield":"=6.0.0-canary.3657f8863.0","@material/theme":"=6.0.0-canary.3657f8863.0","lit-element":"^2.2.1","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"473c76376428d49a6811e677bf7e1450ef90b5cb","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/473c76376428d49a6811e677bf7e1450ef90b5cb/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/473c76376428d49a6811e677bf7e1450ef90b5cb/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/473c76376428d49a6811e677bf7e1450ef90b5cb/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/473c76376428d49a6811e677bf7e1450ef90b5cb/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/473c76376428d49a6811e677bf7e1450ef90b5cb/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/473c76376428d49a6811e677bf7e1450ef90b5cb/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/473c76376428d49a6811e677bf7e1450ef90b5cb/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/473c76376428d49a6811e677bf7e1450ef90b5cb/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/473c76376428d49a6811e677bf7e1450ef90b5cb/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/473c76376428d49a6811e677bf7e1450ef90b5cb/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/473c76376428d49a6811e677bf7e1450ef90b5cb/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\n| Name                | Type             | Description\n| ------------------- | ---------------- |------------\n| `value`             | `string`         | The input control's value.\n| `type`              | `TextFieldType*` | A string specifying the type of control to render.\n| `label`             | `string`         | Sets floating label value.\n| `placeholder`       | `string`         | Sets disappearing input placeholder.\n| `icon`              | `string`         | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `iconTrailing`      | `string`         | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `disabled`          | `boolean`        | Whether or not the input should be disabled.\n| `charCounter`       | `boolean`        | **Note: requries `maxLength` to be set.** Display character counter with max length.\n| `outlined`          | `boolean`        | Whether or not to show the material outlined variant.\n| `fullwidth`         | `boolean`        | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n| `helper`            | `string`         | Helper text to display below the input. Display default only when focused.\n| `helperPersistent`  | `boolean`        | Always show the helper text despite focus.\n| `required`          | `boolean`        | Displays error state if value is empty and input is blurred.\n| `maxLength`         | `number`         | Maximum length to accept input.\n| `validationMessage` | `string`         | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n| `pattern`           | `string`         | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `min`               | `number`\\|`string`  | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `max`               | `number`\\|`string`  | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `step`              | `number`\\|`null`    | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n| `autoValidate`      | `boolean`           | Reports validity on input rather than only on blur.\n| `validity`          | `ValidityState` (readonly) | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n| `willValidate`      | `boolean` (readonly)       | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n| `validityTransform` | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n| `validateOnInitialRender` | `boolean`            | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's  bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's  bottom line when hovering.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.14.0-canary.cbdfe453.0","_nodeVersion":"10.19.0","_npmVersion":"lerna/3.20.2/node@v10.19.0+x64 (linux)","dist":{"integrity":"sha512-rRSyrG09P7YUC00WTxmnct07ojti184UwD1VZSgLk+mZpOyOM6SmBwxCAQ4n5cU7TJz3nTHMpFLCbQ9EGM+rvQ==","shasum":"0e35e1e42d2fc704a15a341d257dfa0d9ba512d1","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.14.0-canary.cbdfe453.0.tgz","fileCount":20,"unpackedSize":281084,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeYCFQCRA9TVsSAnZWagAAvKgP/j0Vw9qaX9UrcGRmt+b0\ntQfgUFsLesPAzjA9odEcN1mGvWpPrxzXNcZ54Q5KIIbnnAhRv3zaLPqY0pcZ\nZv1CM+aIOqbXoC0SHiasfnELLyV+B/ur7jC3iOMNM+jnk9j9lGJjU4LnLYjD\n1UAeo7yzodthrPZcXZs70JPtCGx08IKU0J5OeUosKtSbGVVg3+N8RYTe2QCg\n+xVOm/k4UQw5XD5b4Kq4xpZZ0qs65JQwlSkQQwD6j0JyxbZUlZNx+8ZiT8vU\n1OTKK2ixsuwsAeV2P/0KYmgfL3R6owkfL5w4CoB0aUhQJTQlfGjBeopa5NDE\nE+fjN5mu7YOqQsyxwVxQvQpFELUlWr6rzwqynnQwjY83ceHMGNEIPQAVfWwT\n2olfeAz0tdiA1dL+e2KXsJA3rqyS4b/Z9H8hMAHp9GUZv8oriMEt43GlG6Dd\niOZhOy+7qsO/SJI1beJQArTxJ6kZmO03/3QKGD2/LvRLm3KuiXzdbmzq8urD\nOXOGn9o6s3hHCBAhmuQXr/beVyWkUJN0YGEKLHEpUqZqW9Qwr6SraL501h7x\nTe7QCc3/eC7SQZN6dydaxYktKXdMmyNRSMfFLjZVMMeIPQX/zeHR2otOpy2w\nSvHK+KBQP6sxwsnI7mgbFRZIQLzuxbKdv+lLbPqIvsb4LWnP7iHWn7+nhMhH\n42V9\r\n=6weH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDqRiiDC49RX6u9TFo2Xe1QGZXJKb9JHI5N7nL1UHv2GgIhAL8lw3K3L0GgWhWVAb6x/e3gWNc+LV+0cKj77x2fo5ie"}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.14.0-canary.cbdfe453.0_1583358288238_0.323720675096955"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.14.0-canary.02aa8a98.0":{"name":"@material/mwc-textfield","version":"0.14.0-canary.02aa8a98.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.17b9699c4.0","@material/line-ripple":"=6.0.0-canary.17b9699c4.0","@material/mwc-base":"0.14.0-canary.02aa8a98.0","@material/mwc-floating-label":"0.14.0-canary.02aa8a98.0","@material/mwc-icon":"0.14.0-canary.02aa8a98.0","@material/mwc-line-ripple":"0.14.0-canary.02aa8a98.0","@material/mwc-notched-outline":"0.14.0-canary.02aa8a98.0","@material/shape":"=6.0.0-canary.17b9699c4.0","@material/textfield":"=6.0.0-canary.17b9699c4.0","@material/theme":"=6.0.0-canary.17b9699c4.0","lit-element":"^2.2.1","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"97bedf50cad33662f192490eaffe0e04894aa3c1","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/97bedf50cad33662f192490eaffe0e04894aa3c1/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/97bedf50cad33662f192490eaffe0e04894aa3c1/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/97bedf50cad33662f192490eaffe0e04894aa3c1/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/97bedf50cad33662f192490eaffe0e04894aa3c1/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/97bedf50cad33662f192490eaffe0e04894aa3c1/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/97bedf50cad33662f192490eaffe0e04894aa3c1/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/97bedf50cad33662f192490eaffe0e04894aa3c1/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/97bedf50cad33662f192490eaffe0e04894aa3c1/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/97bedf50cad33662f192490eaffe0e04894aa3c1/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/97bedf50cad33662f192490eaffe0e04894aa3c1/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/97bedf50cad33662f192490eaffe0e04894aa3c1/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\n| Name                | Type             | Description\n| ------------------- | ---------------- |------------\n| `value`             | `string`         | The input control's value.\n| `type`              | `TextFieldType*` | A string specifying the type of control to render.\n| `label`             | `string`         | Sets floating label value.\n| `placeholder`       | `string`         | Sets disappearing input placeholder.\n| `icon`              | `string`         | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `iconTrailing`      | `string`         | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `disabled`          | `boolean`        | Whether or not the input should be disabled.\n| `charCounter`       | `boolean`        | **Note: requries `maxLength` to be set.** Display character counter with max length.\n| `outlined`          | `boolean`        | Whether or not to show the material outlined variant.\n| `fullwidth`         | `boolean`        | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n| `helper`            | `string`         | Helper text to display below the input. Display default only when focused.\n| `helperPersistent`  | `boolean`        | Always show the helper text despite focus.\n| `required`          | `boolean`        | Displays error state if value is empty and input is blurred.\n| `maxLength`         | `number`         | Maximum length to accept input.\n| `validationMessage` | `string`         | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n| `pattern`           | `string`         | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `min`               | `number`\\|`string`  | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `max`               | `number`\\|`string`  | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `step`              | `number`\\|`null`    | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n| `autoValidate`      | `boolean`           | Reports validity on input rather than only on blur.\n| `validity`          | `ValidityState` (readonly) | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n| `willValidate`      | `boolean` (readonly)       | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n| `validityTransform` | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n| `validateOnInitialRender` | `boolean`            | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's  bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's  bottom line when hovering.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.14.0-canary.02aa8a98.0","_nodeVersion":"10.19.0","_npmVersion":"lerna/3.20.2/node@v10.19.0+x64 (linux)","dist":{"integrity":"sha512-X1xv4i81Bk0kAKwBLeER8u3yVRWsi+9sbPpyz8TPbnJk29YggdYtLAww18g978cWYbzth6JKr+xdqXlueiXTZg==","shasum":"ca93286f22ae228ecf4961f6e1bf10660211b6ce","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.14.0-canary.02aa8a98.0.tgz","fileCount":20,"unpackedSize":281084,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeYtRmCRA9TVsSAnZWagAA+dsQAJlrt0awWA61HpZ91v/A\nZcKqX174oKNLnlqg6yGXe05aSGFHOXw5SeaDfAgMZ7YLER1DRgxBIfzAdUNS\n4cdTzSyFlVWyyKxvFTbzV0wYlCvkaBAcDAidUTcL94JVEaB0LEjxfKaVWv9E\nX7MyDreGbSGUlzRyteuH5XrJD1W4v2QCQvlh4lLZ8FPy3rzvk6iuOT1+HxxF\nXwn4QQx8JkJ/1XdaHsL34NEhbiojCVQJUrHTrCXIzGuWfXjtHI9ebUJcNTAE\nYAlJ3NO1BzmMrsqjEJbIN+h13noNMDIMCAa46htciAMbTdSswgO8NhJ3kzpw\nHJ1WsIOkxpy8uS/VDSti2+m8yQFp3Y7BoiBCnvk6h0Os8r0ugTV+lShRzhXB\n06BxFZpG9kftIQ/03zGPNoUXSSAw83RUSx6kDVJj7GKUMyAfEuGhmrqTcwGQ\nxTiiNz8aUW6G0h4I0IL6SDOKUdOZCPZY28e31Sy9c7J3qhLXpbSIqRIVkggt\nRaYrYzKaFcSupMcN2YHZ0M6JNn3uvXEw8u+G4wtDqJ6nBDg4nvufh3Y3RIue\nWfEr+kS38cu3BtJbA2zvt3SW7wF4NEruxXB0yMccJLkueaMGX+Z3kgKXqwud\nc8LWCiE4dGcmlRPmOHVwdeW9kROKMFtYA1wBs/s7Vx6OODgG7cZ3YJ0A9Mtv\n3BLw\r\n=oH02\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICrvjDbxQOSx9VY4BoCDo1OnUwYf4k7ub1f2YmDYYxQSAiAB/NO+YIzZTJTRS80CxlU7b1r+YW2FT7Lb6knplldIpA=="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.14.0-canary.02aa8a98.0_1583535206215_0.3693810708711791"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.14.0-canary.7cd5aad6.0":{"name":"@material/mwc-textfield","version":"0.14.0-canary.7cd5aad6.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.17b9699c4.0","@material/line-ripple":"=6.0.0-canary.17b9699c4.0","@material/mwc-base":"0.14.0-canary.7cd5aad6.0","@material/mwc-floating-label":"0.14.0-canary.7cd5aad6.0","@material/mwc-icon":"0.14.0-canary.7cd5aad6.0","@material/mwc-line-ripple":"0.14.0-canary.7cd5aad6.0","@material/mwc-notched-outline":"0.14.0-canary.7cd5aad6.0","@material/shape":"=6.0.0-canary.17b9699c4.0","@material/textfield":"=6.0.0-canary.17b9699c4.0","@material/theme":"=6.0.0-canary.17b9699c4.0","lit-element":"^2.2.1","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"02d47be94c90a6674486253c11ed001b63502d73","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/02d47be94c90a6674486253c11ed001b63502d73/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/02d47be94c90a6674486253c11ed001b63502d73/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/02d47be94c90a6674486253c11ed001b63502d73/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/02d47be94c90a6674486253c11ed001b63502d73/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/02d47be94c90a6674486253c11ed001b63502d73/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/02d47be94c90a6674486253c11ed001b63502d73/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/02d47be94c90a6674486253c11ed001b63502d73/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/02d47be94c90a6674486253c11ed001b63502d73/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/02d47be94c90a6674486253c11ed001b63502d73/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/02d47be94c90a6674486253c11ed001b63502d73/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/02d47be94c90a6674486253c11ed001b63502d73/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\n| Name                | Type             | Description\n| ------------------- | ---------------- |------------\n| `value`             | `string`         | The input control's value.\n| `type`              | `TextFieldType*` | A string specifying the type of control to render.\n| `label`             | `string`         | Sets floating label value.\n| `placeholder`       | `string`         | Sets disappearing input placeholder.\n| `icon`              | `string`         | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `iconTrailing`      | `string`         | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `disabled`          | `boolean`        | Whether or not the input should be disabled.\n| `charCounter`       | `boolean`        | **Note: requries `maxLength` to be set.** Display character counter with max length.\n| `outlined`          | `boolean`        | Whether or not to show the material outlined variant.\n| `fullwidth`         | `boolean`        | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n| `helper`            | `string`         | Helper text to display below the input. Display default only when focused.\n| `helperPersistent`  | `boolean`        | Always show the helper text despite focus.\n| `required`          | `boolean`        | Displays error state if value is empty and input is blurred.\n| `maxLength`         | `number`         | Maximum length to accept input.\n| `validationMessage` | `string`         | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n| `pattern`           | `string`         | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `min`               | `number`\\|`string`  | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `max`               | `number`\\|`string`  | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `step`              | `number`\\|`null`    | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n| `autoValidate`      | `boolean`           | Reports validity on input rather than only on blur.\n| `validity`          | `ValidityState` (readonly) | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n| `willValidate`      | `boolean` (readonly)       | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n| `validityTransform` | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n| `validateOnInitialRender` | `boolean`            | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's  bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's  bottom line when hovering.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.14.0-canary.7cd5aad6.0","_nodeVersion":"10.19.0","_npmVersion":"lerna/3.20.2/node@v10.19.0+x64 (linux)","dist":{"integrity":"sha512-8+tCNKVanKo6TjEaESlSQ6wZn8UjWTmPnm2/em+QV07s8PYL3evSipokuncBW8f1C8XNdx1MOVsyUS1RMGkc+Q==","shasum":"3a4b314adc17840f80dbfcd6a9b44fdee7323212","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.14.0-canary.7cd5aad6.0.tgz","fileCount":20,"unpackedSize":281556,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeZs8sCRA9TVsSAnZWagAAvxQP/2g4H3y/Nx1zPHbbvQoy\nBaB10A8N/SEvTYcFsROvCXaA/GP8iTyx2/WGXoiabuujfLIYlqyH5jODS2uq\nTUbJJecs/b7Z+bRDJalK84sqwD6znYSF/w0n6eOPkcD7iO5lWfdGlaMzvfvw\nnwVPpMRVgG5p3bG1tfSqUEvWW4iGJoCkrLmu0LU35GojK61ezydZG5sLdNCZ\nU+U+w3n4pVQAK76eWcDtTSVh0qmM/KSfTJ4I6A1vF6Pqf71mmfcCgbZTXVHQ\n7WLNTHNvMLj7c29xz7Dv68b3QvyAlA0dtlgKCgZRVDD8lluebfZ+CBPhPnPF\nY7vxDKJQ4Wldz7w2NBmogHhEHaaMxz6hFNyFx7Y2/Em0JHzdTQ42M/TFMm3L\naZv8RYlJDeG4oW+xzaz0MNX7h2YdIVx2CGEUOKVbmzPrkeILL7HxENYPrbFp\nqsj2y/pNPr3jGz80tEP2zZyDP2GKoMJKVXcrMcoO23A9H9jUp+6sN7yl2Fg6\ntTIZU636zECpaQR/gRDYC1+BSt+2qub/MWaxpsfF1Fp2IoGqmjq+bpgnRtrR\nzC+25dLASuDEPuWp6L5nECt+3IfR3+69KENXSdRwwhIaOpSRtLLN0h+J/7F0\nLyPOj+DiuLnJ3auVNljBiEGHd2DiV859T1NEpK5x7vARx+4qY7s8IFspBAzA\nf4Pi\r\n=DOJ6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBqiYikakT5ptPmAm8YqYLm/Ga7+Y5Q8yUIZl+AJTXm+AiEAute/HePd28w1Ln+dhD+saGXKbCRgilt1grny8opl8Js="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.14.0-canary.7cd5aad6.0_1583796011663_0.13761641846572914"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.14.0-canary.3a79dfa6.0":{"name":"@material/mwc-textfield","version":"0.14.0-canary.3a79dfa6.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.bd33cb56b.0","@material/line-ripple":"=6.0.0-canary.bd33cb56b.0","@material/mwc-base":"0.14.0-canary.3a79dfa6.0","@material/mwc-floating-label":"0.14.0-canary.3a79dfa6.0","@material/mwc-icon":"0.14.0-canary.3a79dfa6.0","@material/mwc-line-ripple":"0.14.0-canary.3a79dfa6.0","@material/mwc-notched-outline":"0.14.0-canary.3a79dfa6.0","@material/shape":"=6.0.0-canary.bd33cb56b.0","@material/textfield":"=6.0.0-canary.bd33cb56b.0","@material/theme":"=6.0.0-canary.bd33cb56b.0","lit-element":"^2.2.1","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"d8c4d68989d9c1489104002dc0f43cfb89ad0488","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d8c4d68989d9c1489104002dc0f43cfb89ad0488/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d8c4d68989d9c1489104002dc0f43cfb89ad0488/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d8c4d68989d9c1489104002dc0f43cfb89ad0488/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d8c4d68989d9c1489104002dc0f43cfb89ad0488/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d8c4d68989d9c1489104002dc0f43cfb89ad0488/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d8c4d68989d9c1489104002dc0f43cfb89ad0488/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d8c4d68989d9c1489104002dc0f43cfb89ad0488/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d8c4d68989d9c1489104002dc0f43cfb89ad0488/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d8c4d68989d9c1489104002dc0f43cfb89ad0488/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d8c4d68989d9c1489104002dc0f43cfb89ad0488/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d8c4d68989d9c1489104002dc0f43cfb89ad0488/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\n| Name                | Type             | Description\n| ------------------- | ---------------- |------------\n| `value`             | `string`         | The input control's value.\n| `type`              | `TextFieldType*` | A string specifying the type of control to render.\n| `label`             | `string`         | Sets floating label value.\n| `placeholder`       | `string`         | Sets disappearing input placeholder.\n| `icon`              | `string`         | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `iconTrailing`      | `string`         | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `disabled`          | `boolean`        | Whether or not the input should be disabled.\n| `charCounter`       | `boolean`        | **Note: requries `maxLength` to be set.** Display character counter with max length.\n| `outlined`          | `boolean`        | Whether or not to show the material outlined variant.\n| `fullwidth`         | `boolean`        | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n| `helper`            | `string`         | Helper text to display below the input. Display default only when focused.\n| `helperPersistent`  | `boolean`        | Always show the helper text despite focus.\n| `required`          | `boolean`        | Displays error state if value is empty and input is blurred.\n| `maxLength`         | `number`         | Maximum length to accept input.\n| `validationMessage` | `string`         | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n| `pattern`           | `string`         | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `min`               | `number`\\|`string`  | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `max`               | `number`\\|`string`  | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `step`              | `number`\\|`null`    | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n| `autoValidate`      | `boolean`           | Reports validity on input rather than only on blur.\n| `validity`          | `ValidityState` (readonly) | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n| `willValidate`      | `boolean` (readonly)       | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n| `validityTransform` | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n| `validateOnInitialRender` | `boolean`            | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's  bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's  bottom line when hovering.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.14.0-canary.3a79dfa6.0","_nodeVersion":"10.19.0","_npmVersion":"lerna/3.20.2/node@v10.19.0+x64 (linux)","dist":{"integrity":"sha512-aDIMZwKbVTLXt+GyWiQLuNMwhHZMyuszKLX5xz/1BG7AO0wRkA2pJQxZpYeyE3+Fq4/3xJKrJriKnSTO2kmdUg==","shasum":"a5eb10f12ffb5f517f1b0149e6e222e96518c488","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.14.0-canary.3a79dfa6.0.tgz","fileCount":20,"unpackedSize":281556,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeZwHSCRA9TVsSAnZWagAAQB0P/idIR849mAFFS7yPEq4+\n+hDUDojHwoU8tvb71/7YVKWk1Ij3Snhf1/uz0nuE7bf/2z7My1UQVHHT2rk7\nQZqDSXHmeI6DGnVMMZ3+o7Ttl1lHj0Rx4TIdvUTLADKiF2PAm1R5Vc+UMUxK\ngCdw4BrEK5X6D3JSpaRXG3jQgf9b3iuTAVOSeCMTJ5M5AUkjjnp4ykx8wLwb\nW287gyZWdTuVuOF86uAObfQ9MqJGUHmkOKeXLb0kHy0H9O1lw7cIDDwDFS2i\nnkwQZ9tqpC3/cDXdOnRJaUeirDHPS5LSOvdWEVZ+gx1gLjf2zcXT6fTQr+u7\n7dZBCTLwGaqoTWf573vsP1XvRrmmDQVLNkwjfK6Mwg1j6jzF6k0eS7Qowqx1\nouk7huMGiyb5DyRR3Wnmgdvnhq7dOLTY0ZZQ7GbE73RpTK7YpS3wIz4+rxbq\nFkSEap+BhFQQmtuV8jjIBI5eLcpxXtGGRRTjJKB+M2ZJCR2gsoLebt/PNnD4\nhww2wVBLAklMEn6z6cUQdDNJPa5EIx0o+5/jupEfayIvH08ZyGq7002OrStL\n9axROSClnDCFzOEtCMcZGSpNGTk/MeOm8jomX7CeXlbZ/4EQBk9hICqNwbDC\nqE0FaG/dC+/XUMgLniCcNWmHdIJnTj3C2S3qg2HsFBMk58RRaTihq0NyKroH\nkM07\r\n=QplA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBhSrV54KzHehKc6qye4hjLyhkDTHHwa2eeWNzqJuHq1AiEA34UFeTXF7Ymf8MVWMEL72mkZ/UtLMj4kYt/jgY84CEI="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.14.0-canary.3a79dfa6.0_1583808977823_0.9142368942406154"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.14.0-canary.22e0f5c9.0":{"name":"@material/mwc-textfield","version":"0.14.0-canary.22e0f5c9.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.bd33cb56b.0","@material/line-ripple":"=6.0.0-canary.bd33cb56b.0","@material/mwc-base":"0.14.0-canary.22e0f5c9.0","@material/mwc-floating-label":"0.14.0-canary.22e0f5c9.0","@material/mwc-icon":"0.14.0-canary.22e0f5c9.0","@material/mwc-line-ripple":"0.14.0-canary.22e0f5c9.0","@material/mwc-notched-outline":"0.14.0-canary.22e0f5c9.0","@material/shape":"=6.0.0-canary.bd33cb56b.0","@material/textfield":"=6.0.0-canary.bd33cb56b.0","@material/theme":"=6.0.0-canary.bd33cb56b.0","lit-element":"^2.2.1","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"ccb096ae11e367b4590851e53c023abbb22d2774","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ccb096ae11e367b4590851e53c023abbb22d2774/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ccb096ae11e367b4590851e53c023abbb22d2774/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ccb096ae11e367b4590851e53c023abbb22d2774/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ccb096ae11e367b4590851e53c023abbb22d2774/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ccb096ae11e367b4590851e53c023abbb22d2774/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ccb096ae11e367b4590851e53c023abbb22d2774/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ccb096ae11e367b4590851e53c023abbb22d2774/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ccb096ae11e367b4590851e53c023abbb22d2774/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ccb096ae11e367b4590851e53c023abbb22d2774/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ccb096ae11e367b4590851e53c023abbb22d2774/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ccb096ae11e367b4590851e53c023abbb22d2774/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\n| Name                | Type             | Description\n| ------------------- | ---------------- |------------\n| `value`             | `string`         | The input control's value.\n| `type`              | `TextFieldType*` | A string specifying the type of control to render.\n| `label`             | `string`         | Sets floating label value.\n| `placeholder`       | `string`         | Sets disappearing input placeholder.\n| `icon`              | `string`         | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `iconTrailing`      | `string`         | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `disabled`          | `boolean`        | Whether or not the input should be disabled.\n| `charCounter`       | `boolean`        | **Note: requries `maxLength` to be set.** Display character counter with max length.\n| `outlined`          | `boolean`        | Whether or not to show the material outlined variant.\n| `fullwidth`         | `boolean`        | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n| `helper`            | `string`         | Helper text to display below the input. Display default only when focused.\n| `helperPersistent`  | `boolean`        | Always show the helper text despite focus.\n| `required`          | `boolean`        | Displays error state if value is empty and input is blurred.\n| `maxLength`         | `number`         | Maximum length to accept input.\n| `validationMessage` | `string`         | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n| `pattern`           | `string`         | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `min`               | `number`\\|`string`  | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `max`               | `number`\\|`string`  | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `step`              | `number`\\|`null`    | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n| `autoValidate`      | `boolean`           | Reports validity on input rather than only on blur.\n| `validity`          | `ValidityState` (readonly) | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n| `willValidate`      | `boolean` (readonly)       | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n| `validityTransform` | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n| `validateOnInitialRender` | `boolean`            | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's  bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's  bottom line when hovering.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.14.0-canary.22e0f5c9.0","_nodeVersion":"10.19.0","_npmVersion":"lerna/3.20.2/node@v10.19.0+x64 (linux)","dist":{"integrity":"sha512-5xZjo0hbCwWHHb6LP4wFsA9Qkyiy45X5KWJyhSPPg2fnmH0M/jQgeT4cgS5m0j2Ox+STBQe0iUuhdxiWhjC81A==","shasum":"0e062d69751fa15c0c3b2340ad3bdb861889de77","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.14.0-canary.22e0f5c9.0.tgz","fileCount":20,"unpackedSize":281556,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeZwK/CRA9TVsSAnZWagAA1WoP/A7MY3ng3Y3WkoJ5dxV/\nNqhuDK9Ladtyc2R1qyDsVBjj3944qgZBRJwjkqRnzxfS269+0iG3WpZySz5L\ndxLyiHx32Q7VfMkphjevPKRmt2g932D/Ne6uYjvrwpWL7d5p3CFlPHNkC+n2\n2LO9TutsRnwfA6ii4qNE9Cg5tkS+RJWy+ClSonbda2KLdl5fAHztE+YyZALt\nX+9IAHRY6WyOqjcWdbC2XfHfCizzueaNqiYQBLXuBC6LCRjY46CsY5hzMsFT\nZc8t2ashP8796fkagrFJ1OmgfnvadrJcFRoWcPTYsm6LTYUQDdJ2H4QqYegV\n5DBx+/HA74BpxTDUQtQOpNUGnWcM0YOxnd2HT9SC3hUoyYppfYshtZl4cqAQ\nFRQfXg1+UOccH24xwtGNzW1a33XAeeXn/OaWYHjZV7piBVt8PZ2YSNLmm6cH\n8pQWatQlW/2E7r/fZPaWwWg3rISnRd9GPpWT2TtZiXuf09TKdWU8f3QgQvNI\neNycYm+PJbQpSzzlIxe3ve5TqEaVwFsZFZs5EpAwdsMcr6/ZZM809WQ2Y6Xs\nhPTijmQDp1ps3g9f/F0kDQbzDl5RtGsxCI20xlpjRnjwkHJ0SNrzscAQWpys\nhWUvyQnR5yruXJNfW1XSn9lG/3/zxqHnQJfkWsgdiOqN1lt0q1iO5KxhZ7n3\n0nnw\r\n=ODWd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDDOVTNV96r3klk1i9xgWLmrgdEp1qqjYW+m5ByXQlD8AiBtjTbP5Q4ovNHxcXdKMNHQPc9s8/FO4r4xN57gwOQwiA=="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.14.0-canary.22e0f5c9.0_1583809215154_0.9360569045366143"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.14.0-canary.f23a1d1b.0":{"name":"@material/mwc-textfield","version":"0.14.0-canary.f23a1d1b.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.26c049afa.0","@material/line-ripple":"=6.0.0-canary.26c049afa.0","@material/mwc-base":"0.14.0-canary.f23a1d1b.0","@material/mwc-floating-label":"0.14.0-canary.f23a1d1b.0","@material/mwc-icon":"0.14.0-canary.f23a1d1b.0","@material/mwc-line-ripple":"0.14.0-canary.f23a1d1b.0","@material/mwc-notched-outline":"0.14.0-canary.f23a1d1b.0","@material/shape":"=6.0.0-canary.26c049afa.0","@material/textfield":"=6.0.0-canary.26c049afa.0","@material/theme":"=6.0.0-canary.26c049afa.0","lit-element":"^2.2.1","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"625010e9abdb8adc901198fa1ebdc99269b946c4","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/625010e9abdb8adc901198fa1ebdc99269b946c4/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/625010e9abdb8adc901198fa1ebdc99269b946c4/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/625010e9abdb8adc901198fa1ebdc99269b946c4/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/625010e9abdb8adc901198fa1ebdc99269b946c4/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/625010e9abdb8adc901198fa1ebdc99269b946c4/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/625010e9abdb8adc901198fa1ebdc99269b946c4/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/625010e9abdb8adc901198fa1ebdc99269b946c4/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/625010e9abdb8adc901198fa1ebdc99269b946c4/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/625010e9abdb8adc901198fa1ebdc99269b946c4/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/625010e9abdb8adc901198fa1ebdc99269b946c4/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/625010e9abdb8adc901198fa1ebdc99269b946c4/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\n| Name                | Type             | Description\n| ------------------- | ---------------- |------------\n| `value`             | `string`         | The input control's value.\n| `type`              | `TextFieldType*` | A string specifying the type of control to render.\n| `label`             | `string`         | Sets floating label value.\n| `placeholder`       | `string`         | Sets disappearing input placeholder.\n| `icon`              | `string`         | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `iconTrailing`      | `string`         | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `disabled`          | `boolean`        | Whether or not the input should be disabled.\n| `charCounter`       | `boolean`        | **Note: requries `maxLength` to be set.** Display character counter with max length.\n| `outlined`          | `boolean`        | Whether or not to show the material outlined variant.\n| `fullwidth`         | `boolean`        | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n| `helper`            | `string`         | Helper text to display below the input. Display default only when focused.\n| `helperPersistent`  | `boolean`        | Always show the helper text despite focus.\n| `required`          | `boolean`        | Displays error state if value is empty and input is blurred.\n| `maxLength`         | `number`         | Maximum length to accept input.\n| `validationMessage` | `string`         | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n| `pattern`           | `string`         | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `min`               | `number`\\|`string`  | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `max`               | `number`\\|`string`  | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `step`              | `number`\\|`null`    | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n| `autoValidate`      | `boolean`           | Reports validity on input rather than only on blur.\n| `validity`          | `ValidityState` (readonly) | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n| `willValidate`      | `boolean` (readonly)       | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n| `validityTransform` | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n| `validateOnInitialRender` | `boolean`            | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's  bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's  bottom line when hovering.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.14.0-canary.f23a1d1b.0","_nodeVersion":"10.19.0","_npmVersion":"lerna/3.20.2/node@v10.19.0+x64 (linux)","dist":{"integrity":"sha512-lcJYVh/aZB8u2A4bcUaDs1IPVL98+VfVsDfUPW/OrVMSoW9tVLAt83u0jXHeTxD0RIZGfj2pM0CeT5J2+4LVTw==","shasum":"ecf447960165ab5b2a21b5b55da37434fbb1a9e8","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.14.0-canary.f23a1d1b.0.tgz","fileCount":20,"unpackedSize":281556,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeZ/8CCRA9TVsSAnZWagAAQs0P/1Ul7KgzG/xSg7qBejLC\niXTSHFnGjvv0BPz7hZtffNtaFY70wW1ruJXeQE2uMTwnIpprgzI9ZO+hzstv\nW0mnH+p+9rdRcnBgQA0mWWt3EqtiiYfI3wrw/fY66QKFO3q2RwgZZyYsXwiv\nNAKtD1HSlW36/cTXGxgM2hocSgT7HTKseXf7OmYJEE27V3esfQi1KY947rg2\nPyhJJGeiURtLXQGZXLoYcvRjHVAEJpa89Rd2o7dfA28zecT9doXoXCdG334o\n+cw1k/BhwISMG6qKUmT0s9t4CcaFWmFahcQasQGk1BWk1I3xHLBqe9BiWpf+\n24iqBu/TNjaexqI/pnI5WC0XdA2aLbcXt7UC7uQTujPhIHSMeeejzrT+fNIF\nWEc7iBa/I5ETvz9SdkSwkMtSg+rVTkOyHIoe3A21yNvl/thWL4IwZzUBaXEx\nR16I0YSQSHO/DBnT5DLwTocjW0K5ediNbjAAy/bdpxcZ0NLM5k830zIDtOCj\n3AJcJXw6kqCAECfm+WAg3ztQElWzZPJBnuDd794KtltKEct/m+KihRzSMG0w\nRJSf+kvCakFLC7Md9wFuPh/BkwQkVRvSctn/V4EN7FeKMBZs8Yejp7rE+CNJ\n0s9d9+tvQobpbA98hFtcI3/Ub+b2H5jnamfJ8IiX2O35H0bflTii4XtaZHiS\nmnpX\r\n=+bgE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCsXcbR0xKDKDVTLlX5JlOisQi7ItCTYFyfdF+BCQciSAIgOEae/kqSRAdFelghR0Ba0wUY1mNNSpr9S6apCq7h+bw="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.14.0-canary.f23a1d1b.0_1583873793678_0.9922084460784881"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.14.0-canary.34b2d69a.0":{"name":"@material/mwc-textfield","version":"0.14.0-canary.34b2d69a.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.26c049afa.0","@material/line-ripple":"=6.0.0-canary.26c049afa.0","@material/mwc-base":"0.14.0-canary.34b2d69a.0","@material/mwc-floating-label":"0.14.0-canary.34b2d69a.0","@material/mwc-icon":"0.14.0-canary.34b2d69a.0","@material/mwc-line-ripple":"0.14.0-canary.34b2d69a.0","@material/mwc-notched-outline":"0.14.0-canary.34b2d69a.0","@material/shape":"=6.0.0-canary.26c049afa.0","@material/textfield":"=6.0.0-canary.26c049afa.0","@material/theme":"=6.0.0-canary.26c049afa.0","lit-element":"^2.2.1","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"b40bf9e324ad010a2ec93cf8677b25b843ad9c46","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b40bf9e324ad010a2ec93cf8677b25b843ad9c46/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b40bf9e324ad010a2ec93cf8677b25b843ad9c46/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b40bf9e324ad010a2ec93cf8677b25b843ad9c46/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b40bf9e324ad010a2ec93cf8677b25b843ad9c46/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b40bf9e324ad010a2ec93cf8677b25b843ad9c46/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b40bf9e324ad010a2ec93cf8677b25b843ad9c46/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b40bf9e324ad010a2ec93cf8677b25b843ad9c46/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b40bf9e324ad010a2ec93cf8677b25b843ad9c46/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b40bf9e324ad010a2ec93cf8677b25b843ad9c46/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b40bf9e324ad010a2ec93cf8677b25b843ad9c46/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b40bf9e324ad010a2ec93cf8677b25b843ad9c46/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\n| Name                | Type             | Description\n| ------------------- | ---------------- |------------\n| `value`             | `string`         | The input control's value.\n| `type`              | `TextFieldType*` | A string specifying the type of control to render.\n| `label`             | `string`         | Sets floating label value.\n| `placeholder`       | `string`         | Sets disappearing input placeholder.\n| `icon`              | `string`         | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `iconTrailing`      | `string`         | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `disabled`          | `boolean`        | Whether or not the input should be disabled.\n| `charCounter`       | `boolean`        | **Note: requries `maxLength` to be set.** Display character counter with max length.\n| `outlined`          | `boolean`        | Whether or not to show the material outlined variant.\n| `fullwidth`         | `boolean`        | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n| `helper`            | `string`         | Helper text to display below the input. Display default only when focused.\n| `helperPersistent`  | `boolean`        | Always show the helper text despite focus.\n| `required`          | `boolean`        | Displays error state if value is empty and input is blurred.\n| `maxLength`         | `number`         | Maximum length to accept input.\n| `validationMessage` | `string`         | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n| `pattern`           | `string`         | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `min`               | `number`\\|`string`  | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `max`               | `number`\\|`string`  | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `step`              | `number`\\|`null`    | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n| `autoValidate`      | `boolean`           | Reports validity on input rather than only on blur.\n| `validity`          | `ValidityState` (readonly) | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n| `willValidate`      | `boolean` (readonly)       | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n| `validityTransform` | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n| `validateOnInitialRender` | `boolean`            | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's  bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's  bottom line when hovering.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.14.0-canary.34b2d69a.0","_nodeVersion":"10.19.0","_npmVersion":"lerna/3.20.2/node@v10.19.0+x64 (linux)","dist":{"integrity":"sha512-69WW5VkJI8fHu56VftomcRXMTyDA2JBpHnYqwhpCtpAk7VnLAovQwkJZWUNl13JiFMGdGddLu5N/K9ZTBeJ4HA==","shasum":"c2bcb542abfcf2b0cb28d3609ecc9a16fba3bcd2","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.14.0-canary.34b2d69a.0.tgz","fileCount":20,"unpackedSize":281556,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeaANKCRA9TVsSAnZWagAAYsQP+gJqc+dgGfFB5slRMnzl\nXsfDEClGwujufzV9PqtgcyeAgYMzqaVVDWgTlhD9E0XQT1OUG4p1rV+F67G/\nPJxQ/1bdaEKvVuHW1NFuSYOE1J3BcZIZwQM4ehl3CCd/rsoTa9L8GG81dBgU\nMP8ccPCxCxSuRhmIZpuD2EZGvwOM2wvXoa/C0mNI1Y1+i+OwmrsSZHjRalVC\n0QUUub8uatqEO2bkvfY/Y59PTuhCRkJKKb2BOBOA7fA9EHQNWRBAZPSzf4yM\nV8qZM3PlMbsOhuuShqrKUWUm/nmWJLLlp0NmpMAsUaA2fd7za0yIb9a005BL\nbFX8MHcU/S6LIRFyfs5FbCXnq92jXz7R+/JrHgT4Ekp5inqwZYwrzJMhojO7\n0X2mkNGCG5t9RsRLabmN+1Jb/hEwm7krLvrKMInUcljnWIXj8pfORB06aCxQ\njtBrxBULRYQrhDvEI8/XyWCKjlXL8n/tdk9S5EGo7s5BYUHS8FnYtXyCLxIl\nCDqzhFIKv3rY4xftFhqEKuhCB4igXeHuCfrxNiY1yK8QlL3neiKrWWDH+ms6\nb2DLZyI/hrGq3kpnLpLToBHc8ejhLW8eEOw2rNEnLHTFylxiuTeZZhYdtnsn\nyYQwZ8Em5eiuzaEpWG8izCZzu5AFRdvm2dBWkOk8JHzXc0azV0seWoA31SOe\nOv1Q\r\n=t/aW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCrzmJ6yWMGyznymQdODD3ccmTNZgo09jXFlZBVsS5fwwIhALahPZJdEE7DhpgjYgt6d8iKaUpfxIBiXborOXDCPoXQ"}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.14.0-canary.34b2d69a.0_1583874889574_0.74553308273828"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.14.0-canary.dc04abe1.0":{"name":"@material/mwc-textfield","version":"0.14.0-canary.dc04abe1.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.1db5c9fc8.0","@material/line-ripple":"=6.0.0-canary.1db5c9fc8.0","@material/mwc-base":"0.14.0-canary.dc04abe1.0","@material/mwc-floating-label":"0.14.0-canary.dc04abe1.0","@material/mwc-icon":"0.14.0-canary.dc04abe1.0","@material/mwc-line-ripple":"0.14.0-canary.dc04abe1.0","@material/mwc-notched-outline":"0.14.0-canary.dc04abe1.0","@material/shape":"=6.0.0-canary.1db5c9fc8.0","@material/textfield":"=6.0.0-canary.1db5c9fc8.0","@material/theme":"=6.0.0-canary.1db5c9fc8.0","lit-element":"^2.2.1","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"83603c5af2141bb893dc17dc4ff73baa5dbc7b64","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/83603c5af2141bb893dc17dc4ff73baa5dbc7b64/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/83603c5af2141bb893dc17dc4ff73baa5dbc7b64/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/83603c5af2141bb893dc17dc4ff73baa5dbc7b64/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/83603c5af2141bb893dc17dc4ff73baa5dbc7b64/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/83603c5af2141bb893dc17dc4ff73baa5dbc7b64/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/83603c5af2141bb893dc17dc4ff73baa5dbc7b64/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/83603c5af2141bb893dc17dc4ff73baa5dbc7b64/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/83603c5af2141bb893dc17dc4ff73baa5dbc7b64/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/83603c5af2141bb893dc17dc4ff73baa5dbc7b64/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/83603c5af2141bb893dc17dc4ff73baa5dbc7b64/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/83603c5af2141bb893dc17dc4ff73baa5dbc7b64/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\n| Name                | Type             | Description\n| ------------------- | ---------------- |------------\n| `value`             | `string`         | The input control's value.\n| `type`              | `TextFieldType*` | A string specifying the type of control to render.\n| `label`             | `string`         | Sets floating label value.\n| `placeholder`       | `string`         | Sets disappearing input placeholder.\n| `icon`              | `string`         | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `iconTrailing`      | `string`         | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `disabled`          | `boolean`        | Whether or not the input should be disabled.\n| `charCounter`       | `boolean`        | **Note: requries `maxLength` to be set.** Display character counter with max length.\n| `outlined`          | `boolean`        | Whether or not to show the material outlined variant.\n| `fullwidth`         | `boolean`        | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n| `helper`            | `string`         | Helper text to display below the input. Display default only when focused.\n| `helperPersistent`  | `boolean`        | Always show the helper text despite focus.\n| `required`          | `boolean`        | Displays error state if value is empty and input is blurred.\n| `maxLength`         | `number`         | Maximum length to accept input.\n| `validationMessage` | `string`         | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n| `pattern`           | `string`         | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `min`               | `number`\\|`string`  | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `max`               | `number`\\|`string`  | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `step`              | `number`\\|`null`    | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n| `autoValidate`      | `boolean`           | Reports validity on input rather than only on blur.\n| `validity`          | `ValidityState` (readonly) | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n| `willValidate`      | `boolean` (readonly)       | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n| `validityTransform` | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n| `validateOnInitialRender` | `boolean`            | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's  bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's  bottom line when hovering.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.14.0-canary.dc04abe1.0","_nodeVersion":"10.19.0","_npmVersion":"lerna/3.20.2/node@v10.19.0+x64 (linux)","dist":{"integrity":"sha512-btNcClQpsg5+loG5sB/fR8soT/2teppvnRUG/O1oQUwa0CF1RY1Ez57hu2f8IXPWFZcPSj/uKx8+kAt27oxvpQ==","shasum":"f864c96bda55c2770cf14a9219c36f8c85474fb6","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.14.0-canary.dc04abe1.0.tgz","fileCount":20,"unpackedSize":281556,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeaA5qCRA9TVsSAnZWagAAXREP/3tJLPmF5U36JL7MrAbC\nSOTMTW/GOe7/zoPqN2aMQzbblLl1pfF41uUaoMIBzFas/0n9kgPMBXVyMh1O\nAAyEnhUHBGHJpoRWKkT77cmtCg6GaRl/R/AGjDL+vSP88du4ZIUEMmuYc2oE\n5RMaj4WxnrDBwtBbAZiCQ38yP8cMAwk11Byp9W1STfV678Z9Wxryscav4XO8\na4rAOaxXIsBTDHwpmosl0AOnSW46QB83sNsfyBVHBLZY1OcCrK0+hv6f32F+\nNp94Wuy6PR7p328ZIZfIiLE9n1pXvmGbPNFvZ494UniNjnvfmvOiEQe4Il8h\nOnHi/tnrg3+CGiMLX9eSkcKnWc1uf0vhwKA8afEj9IkASua13qDeKYnh/lxY\nIy2lYthH7IytFYnKvsR0PKOzJLqpeYN2ErLKtRw3Pu3AfguyHDm13IiYVVcq\nJxVRGoWCIn2KXomz2Lg8u+AGTT2Ki1WAnLe3xh71EwEM8VhqGA7MmY6tFDRG\nd3kwyApOH0esl1yV7sQVYFsqAlNa8n35kVEc8rLNKzbNzEQIlkIpEk39p4Be\n19zhcJDKq/THtnpOgSVFsACdcDpoDQr0T25nQeZ+TI1mTEPs8XACboX66b5R\n4/5+Z2eJqSwqYQmXU+W78z9UEaslJUF5Wd2DYuKsbVC72DwZlQXcMkDA6mtl\nzAlw\r\n=5N9j\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFHvJzhelCT5PVXz+zUksGCPZYcnfDzUyja9cm1kowEdAiEAr8Ft5pIdRcH+u8YixwtDmU3d6ib+k75wLtv3f6puGak="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.14.0-canary.dc04abe1.0_1583877738197_0.8740571114945743"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.14.0-canary.04ccbc88.0":{"name":"@material/mwc-textfield","version":"0.14.0-canary.04ccbc88.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.1ae8130ce.0","@material/line-ripple":"=6.0.0-canary.1ae8130ce.0","@material/mwc-base":"0.14.0-canary.04ccbc88.0","@material/mwc-floating-label":"0.14.0-canary.04ccbc88.0","@material/mwc-icon":"0.14.0-canary.04ccbc88.0","@material/mwc-line-ripple":"0.14.0-canary.04ccbc88.0","@material/mwc-notched-outline":"0.14.0-canary.04ccbc88.0","@material/shape":"=6.0.0-canary.1ae8130ce.0","@material/textfield":"=6.0.0-canary.1ae8130ce.0","@material/theme":"=6.0.0-canary.1ae8130ce.0","lit-element":"^2.2.1","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"bfcaa800a510585165a925b6961a7e6316f30f57","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bfcaa800a510585165a925b6961a7e6316f30f57/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bfcaa800a510585165a925b6961a7e6316f30f57/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bfcaa800a510585165a925b6961a7e6316f30f57/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bfcaa800a510585165a925b6961a7e6316f30f57/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bfcaa800a510585165a925b6961a7e6316f30f57/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bfcaa800a510585165a925b6961a7e6316f30f57/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bfcaa800a510585165a925b6961a7e6316f30f57/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bfcaa800a510585165a925b6961a7e6316f30f57/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bfcaa800a510585165a925b6961a7e6316f30f57/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bfcaa800a510585165a925b6961a7e6316f30f57/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bfcaa800a510585165a925b6961a7e6316f30f57/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\n| Name                | Type             | Description\n| ------------------- | ---------------- |------------\n| `value`             | `string`         | The input control's value.\n| `type`              | `TextFieldType*` | A string specifying the type of control to render.\n| `label`             | `string`         | Sets floating label value.\n| `placeholder`       | `string`         | Sets disappearing input placeholder.\n| `icon`              | `string`         | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `iconTrailing`      | `string`         | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `disabled`          | `boolean`        | Whether or not the input should be disabled.\n| `charCounter`       | `boolean`        | **Note: requries `maxLength` to be set.** Display character counter with max length.\n| `outlined`          | `boolean`        | Whether or not to show the material outlined variant.\n| `fullwidth`         | `boolean`        | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n| `helper`            | `string`         | Helper text to display below the input. Display default only when focused.\n| `helperPersistent`  | `boolean`        | Always show the helper text despite focus.\n| `required`          | `boolean`        | Displays error state if value is empty and input is blurred.\n| `maxLength`         | `number`         | Maximum length to accept input.\n| `validationMessage` | `string`         | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n| `pattern`           | `string`         | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `min`               | `number`\\|`string`  | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `max`               | `number`\\|`string`  | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `step`              | `number`\\|`null`    | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n| `autoValidate`      | `boolean`           | Reports validity on input rather than only on blur.\n| `validity`          | `ValidityState` (readonly) | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n| `willValidate`      | `boolean` (readonly)       | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n| `validityTransform` | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n| `validateOnInitialRender` | `boolean`            | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's  bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's  bottom line when hovering.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.14.0-canary.04ccbc88.0","_nodeVersion":"10.19.0","_npmVersion":"lerna/3.20.2/node@v10.19.0+x64 (linux)","dist":{"integrity":"sha512-XZ1PmBxf89AXvmQ7WY4szQiYGkZLL5jZkrNEpgTwtSpa1VLGtH8bxrDZYeYhnqS3XQX53alhcB7OjempFL+Thw==","shasum":"5d42ef63e2295488566a271f428d92b160a68ba7","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.14.0-canary.04ccbc88.0.tgz","fileCount":20,"unpackedSize":281556,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeaDIyCRA9TVsSAnZWagAAEY4P/jDkr6MKp62RZLhCkYDW\n1a6tugTJE5HTQeo91nWg4jK/VQj3VoNFK4wG3uaOkqhr8OWf7DKzGw1Pmicm\nPVrrUMpanHmaG+CmDwCQs5cOG0odWzCfHrTW6vKbBOCb1i8PRpvXm7YL/0Fp\noBUHO99kbBH5468LTheoJZPzxWJFAe2TXSCOldOhJVcRxTgTbd6bjbaWjiBA\nrPob4uGbTKwQohypA7Q5hatKobkJwQycwj6bSOLSUyQjLZucfEmWS+2vkfT1\nd65xQluGiu0U7B93cOo2scFsVzZ7zmmLvyzaH9qol8sVbfumrjDb3pr3JfK7\nwRMs34adsl/DG9e+tsT6ZcDzNBs5B+IRT91f3rJU+YFZcHjjI19+wsVcyEuK\ncHOlnHbFbz317NTYTF+jh+f2YAcgGNjIIeVtlDRzvXickwGAWkqlUd2nMzBk\n7cBzlwQkmHEqwVrL2Ml0hTL/lfGGA4jTumF1EOdzG0jZc1aTdpZNtIfRNXWo\npt/jnfsby/RhCYZoJj15aQFyNw8+G3JAOTZMxkB2JhSvs911YGYOXQz6kKi9\nZ2xi62lFnc9MNQVeXcxrpUqs65eka7TUB0LJBLxDEVEeiuRsAqcu3fOPvNB5\n3zUipykilCwu/kvH9Cah3lV5fKUQlTWG9429quzDJA45dMsRauY/9aZYbJIq\nEbB7\r\n=75tN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDaBZsB4Z6ejO3Pb8GD7Lrx1eAO6b3Wm5NQeP5E6OgqKAiEAreMEJx6izjMzbvV3Ws5h03JlZhuSuKsdMZQpeM11QNM="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.14.0-canary.04ccbc88.0_1583886897758_0.9605766373513491"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.14.0-canary.55338c25.0":{"name":"@material/mwc-textfield","version":"0.14.0-canary.55338c25.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.1ae8130ce.0","@material/line-ripple":"=6.0.0-canary.1ae8130ce.0","@material/mwc-base":"0.14.0-canary.55338c25.0","@material/mwc-floating-label":"0.14.0-canary.55338c25.0","@material/mwc-icon":"0.14.0-canary.55338c25.0","@material/mwc-line-ripple":"0.14.0-canary.55338c25.0","@material/mwc-notched-outline":"0.14.0-canary.55338c25.0","@material/shape":"=6.0.0-canary.1ae8130ce.0","@material/textfield":"=6.0.0-canary.1ae8130ce.0","@material/theme":"=6.0.0-canary.1ae8130ce.0","lit-element":"^2.2.1","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"6251bd82d8c2b37985e6a165d6904180ec7a96e3","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6251bd82d8c2b37985e6a165d6904180ec7a96e3/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6251bd82d8c2b37985e6a165d6904180ec7a96e3/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6251bd82d8c2b37985e6a165d6904180ec7a96e3/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6251bd82d8c2b37985e6a165d6904180ec7a96e3/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6251bd82d8c2b37985e6a165d6904180ec7a96e3/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6251bd82d8c2b37985e6a165d6904180ec7a96e3/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6251bd82d8c2b37985e6a165d6904180ec7a96e3/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6251bd82d8c2b37985e6a165d6904180ec7a96e3/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6251bd82d8c2b37985e6a165d6904180ec7a96e3/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6251bd82d8c2b37985e6a165d6904180ec7a96e3/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6251bd82d8c2b37985e6a165d6904180ec7a96e3/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\n| Name                | Type             | Description\n| ------------------- | ---------------- |------------\n| `value`             | `string`         | The input control's value.\n| `type`              | `TextFieldType*` | A string specifying the type of control to render.\n| `label`             | `string`         | Sets floating label value.\n| `placeholder`       | `string`         | Sets disappearing input placeholder.\n| `icon`              | `string`         | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `iconTrailing`      | `string`         | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `disabled`          | `boolean`        | Whether or not the input should be disabled.\n| `charCounter`       | `boolean`        | **Note: requries `maxLength` to be set.** Display character counter with max length.\n| `outlined`          | `boolean`        | Whether or not to show the material outlined variant.\n| `fullwidth`         | `boolean`        | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n| `helper`            | `string`         | Helper text to display below the input. Display default only when focused.\n| `helperPersistent`  | `boolean`        | Always show the helper text despite focus.\n| `required`          | `boolean`        | Displays error state if value is empty and input is blurred.\n| `maxLength`         | `number`         | Maximum length to accept input.\n| `validationMessage` | `string`         | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n| `pattern`           | `string`         | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `min`               | `number`\\|`string`  | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `max`               | `number`\\|`string`  | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `step`              | `number`\\|`null`    | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n| `autoValidate`      | `boolean`           | Reports validity on input rather than only on blur.\n| `validity`          | `ValidityState` (readonly) | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n| `willValidate`      | `boolean` (readonly)       | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n| `validityTransform` | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n| `validateOnInitialRender` | `boolean`            | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's  bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's  bottom line when hovering.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.14.0-canary.55338c25.0","_nodeVersion":"10.19.0","_npmVersion":"lerna/3.20.2/node@v10.19.0+x64 (linux)","dist":{"integrity":"sha512-duZk9JTTMf12w7fcxF2AFmToA5OtT3QHX6QX+wTOfOFkG/8A86lWXulG1tNQKkgX/D+M6KBaVx0NRM98y+kGTA==","shasum":"dd38cc4883e16fae8bc87fd1f8bcfb60a87fa81b","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.14.0-canary.55338c25.0.tgz","fileCount":20,"unpackedSize":281583,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeaIXBCRA9TVsSAnZWagAAONgP/0t6f/HR7tFALOPe36Q6\n3CoHrs2enrFWoWVufYboKvZY0DQ8kc7/8triz8oCqi9tY44ulbZPib8gm0xo\nhPp+5ArR32Xmc9HgYYeMoTGw4muYNsbCEjRHpGyl1WbrYctFPKTqy3XTCq0m\nlbixltyOqazYrv1FVEy15Kk3q9JpPcFSLOWSFkETHo5w2WOxJN5ZzKhfh9Rd\n5EnAy+rfjv85VW+smtL5y0vTJ+j9Zy7wK3IQDLrTiC+/GhHCCiyrXcFBU1rG\nA5CUUsBqmbuOiFD5TLrF+UEq+ILMQOU+n7tdVCu2hXXrMypYMfVZFPw+RRRe\nvxnzuzwZU6kRLj86ApOpuKZiR8DmcoNSienX0yMO4YOD4VZMUWFBDc0SmjBA\nobqleIOgjDIPAPteIUein8hB14eFOVbjBAxpMx+OJqiQ+kOXUGxV3U1XWkp5\nBBHdB0BbBzse2Bqub0ZQhzGqLs/myBXAcJd8IlYDBiParbuo9EPs/KuZueU/\nmD1V72tSL1uloAlvBNEjxxCuafG25bi4elOb0gb6p9CpuoBz7cW+REeAlhz5\nkgOh0lyL6XwsIwRgfyIZBMJZnvmuu5c9+YaZZZwuLkp1aNyRZRevUTK5Qld3\n2NazRvkNChCqFSH6XIdiu3t8aQZY0rHCS9pYIakmEFCgId+fCLdZm2rtZPpB\n38OO\r\n=FtLe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID3W4USN5mPwuRmdjYGMezwSWFuss8hfrd+1AvQNA2M+AiAUfjSk4+rJiGmdJFFQFmD1tQYfKI6Wjhm12sFVPeXC7g=="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.14.0-canary.55338c25.0_1583908289516_0.3964472026599022"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.14.0-canary.b7e388f3.0":{"name":"@material/mwc-textfield","version":"0.14.0-canary.b7e388f3.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.1ae8130ce.0","@material/line-ripple":"=6.0.0-canary.1ae8130ce.0","@material/mwc-base":"0.14.0-canary.b7e388f3.0","@material/mwc-floating-label":"0.14.0-canary.b7e388f3.0","@material/mwc-icon":"0.14.0-canary.b7e388f3.0","@material/mwc-line-ripple":"0.14.0-canary.b7e388f3.0","@material/mwc-notched-outline":"0.14.0-canary.b7e388f3.0","@material/shape":"=6.0.0-canary.1ae8130ce.0","@material/textfield":"=6.0.0-canary.1ae8130ce.0","@material/theme":"=6.0.0-canary.1ae8130ce.0","lit-element":"^2.2.1","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"1ce172712209d5abf28a65e797f46fdddb7ea704","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1ce172712209d5abf28a65e797f46fdddb7ea704/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1ce172712209d5abf28a65e797f46fdddb7ea704/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1ce172712209d5abf28a65e797f46fdddb7ea704/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1ce172712209d5abf28a65e797f46fdddb7ea704/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1ce172712209d5abf28a65e797f46fdddb7ea704/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1ce172712209d5abf28a65e797f46fdddb7ea704/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1ce172712209d5abf28a65e797f46fdddb7ea704/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1ce172712209d5abf28a65e797f46fdddb7ea704/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1ce172712209d5abf28a65e797f46fdddb7ea704/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1ce172712209d5abf28a65e797f46fdddb7ea704/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1ce172712209d5abf28a65e797f46fdddb7ea704/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\n| Name                | Type             | Description\n| ------------------- | ---------------- |------------\n| `value`             | `string`         | The input control's value.\n| `type`              | `TextFieldType*` | A string specifying the type of control to render.\n| `label`             | `string`         | Sets floating label value.\n| `placeholder`       | `string`         | Sets disappearing input placeholder.\n| `icon`              | `string`         | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `iconTrailing`      | `string`         | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `disabled`          | `boolean`        | Whether or not the input should be disabled.\n| `charCounter`       | `boolean`        | **Note: requries `maxLength` to be set.** Display character counter with max length.\n| `outlined`          | `boolean`        | Whether or not to show the material outlined variant.\n| `fullwidth`         | `boolean`        | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n| `helper`            | `string`         | Helper text to display below the input. Display default only when focused.\n| `helperPersistent`  | `boolean`        | Always show the helper text despite focus.\n| `required`          | `boolean`        | Displays error state if value is empty and input is blurred.\n| `maxLength`         | `number`         | Maximum length to accept input.\n| `validationMessage` | `string`         | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n| `pattern`           | `string`         | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `min`               | `number`\\|`string`  | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `max`               | `number`\\|`string`  | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `step`              | `number`\\|`null`    | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n| `autoValidate`      | `boolean`           | Reports validity on input rather than only on blur.\n| `validity`          | `ValidityState` (readonly) | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n| `willValidate`      | `boolean` (readonly)       | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n| `validityTransform` | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n| `validateOnInitialRender` | `boolean`            | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's  bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's  bottom line when hovering.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.14.0-canary.b7e388f3.0","_nodeVersion":"10.19.0","_npmVersion":"lerna/3.20.2/node@v10.19.0+x64 (linux)","dist":{"integrity":"sha512-HBjlT9FMJ9FxoNZTB64rQ//TeEptzWCyl3JOne5BxwV8Ab6XXoB4EsMQNRjfckMI4hy6LkGbVkKUhT4y67GpvA==","shasum":"df566f24a1acfb67676aee4a14b4983e6e70568b","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.14.0-canary.b7e388f3.0.tgz","fileCount":20,"unpackedSize":281583,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeaUfjCRA9TVsSAnZWagAAt6oP/1659Lqw8qcePWuH6/KV\nnXizQHH4bMCe914uGjDd38SmB+ccD+hW/ubW3gpMwIQNfJiUc5BwYJz8Sz6K\n9ox88nlL9tPLol5P+1tLd00oK5KlIPev9eHekp/Yxv24zc0K3zsf4ZPhXNRk\nd+DfDiNsQ01Gdm7XbC6gXrO/8eXkK4ktfSyJvo6g0PbQGWyz8iyVP9KbONEF\nC5EWs7Skdgzrghf6PDjMTfEbrW2Zq4i+FFNTpxMzXmlr9Q+bo0/OHvl111rM\nWb1rvZ4xczq3wy8Ps8IFpIwzv05ytIqB3MiAoOFt+urlAt4iGF/dUxXn1wCp\n59Y4+rYdEslqgHPrG4a14miosXTfp9skYVhXiQZjHzdL1W2DPqUKNPpcOTNp\nJLRSnSvSw419gJTF9YX8rQXPYyA7lUdNxe67IcvvunurOehBJ0T/A6uZ3Ak+\n/2qZx4/wFwmvDc6Bqlk4k+UNRHzVaOFc0wE/gyVT+b/yyzraTvxmT+/e86ne\nKKjuqJtGTllRCqpR8f0Z7lOSr5KJM7vWHMZ2w/ndzCAch72q58Ys/t41VaXN\nBAkvxUHs5A5inC2aQVLiE7olJ4osStJP06Rubkz/JQQ0WsLjLQZupj8aumSD\n0j+F4iPVp4IxwmiwlLOhxorosC0cp2E8Gk6+T4m8LDRKHkcvmUZ0tu7Xh3rK\ndr8I\r\n=QAGO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDl7jSErw6FNoEA7xSQP4lWsqcjUlduswvZDmRQ5Ty22AIgOkAEk1V3KJakEr1TSjR38O4ixNTjcCMBh//5m2y2xKg="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.14.0-canary.b7e388f3.0_1583957987030_0.019452063749535453"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.14.0-canary.b3211481.0":{"name":"@material/mwc-textfield","version":"0.14.0-canary.b3211481.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.1ae8130ce.0","@material/line-ripple":"=6.0.0-canary.1ae8130ce.0","@material/mwc-base":"0.14.0-canary.b3211481.0","@material/mwc-floating-label":"0.14.0-canary.b3211481.0","@material/mwc-icon":"0.14.0-canary.b3211481.0","@material/mwc-line-ripple":"0.14.0-canary.b3211481.0","@material/mwc-notched-outline":"0.14.0-canary.b3211481.0","@material/shape":"=6.0.0-canary.1ae8130ce.0","@material/textfield":"=6.0.0-canary.1ae8130ce.0","@material/theme":"=6.0.0-canary.1ae8130ce.0","lit-element":"^2.2.1","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"7b6c73b4ab63cb7701379685a556ece3324d1c22","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7b6c73b4ab63cb7701379685a556ece3324d1c22/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7b6c73b4ab63cb7701379685a556ece3324d1c22/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7b6c73b4ab63cb7701379685a556ece3324d1c22/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7b6c73b4ab63cb7701379685a556ece3324d1c22/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7b6c73b4ab63cb7701379685a556ece3324d1c22/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7b6c73b4ab63cb7701379685a556ece3324d1c22/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7b6c73b4ab63cb7701379685a556ece3324d1c22/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7b6c73b4ab63cb7701379685a556ece3324d1c22/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7b6c73b4ab63cb7701379685a556ece3324d1c22/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7b6c73b4ab63cb7701379685a556ece3324d1c22/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7b6c73b4ab63cb7701379685a556ece3324d1c22/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\n| Name                | Type             | Description\n| ------------------- | ---------------- |------------\n| `value`             | `string`         | The input control's value.\n| `type`              | `TextFieldType*` | A string specifying the type of control to render.\n| `label`             | `string`         | Sets floating label value.\n| `placeholder`       | `string`         | Sets disappearing input placeholder.\n| `icon`              | `string`         | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `iconTrailing`      | `string`         | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `disabled`          | `boolean`        | Whether or not the input should be disabled.\n| `charCounter`       | `boolean`        | **Note: requries `maxLength` to be set.** Display character counter with max length.\n| `outlined`          | `boolean`        | Whether or not to show the material outlined variant.\n| `fullwidth`         | `boolean`        | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n| `helper`            | `string`         | Helper text to display below the input. Display default only when focused.\n| `helperPersistent`  | `boolean`        | Always show the helper text despite focus.\n| `required`          | `boolean`        | Displays error state if value is empty and input is blurred.\n| `maxLength`         | `number`         | Maximum length to accept input.\n| `validationMessage` | `string`         | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n| `pattern`           | `string`         | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `min`               | `number`\\|`string`  | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `max`               | `number`\\|`string`  | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `step`              | `number`\\|`null`    | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n| `autoValidate`      | `boolean`           | Reports validity on input rather than only on blur.\n| `validity`          | `ValidityState` (readonly) | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n| `willValidate`      | `boolean` (readonly)       | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n| `validityTransform` | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n| `validateOnInitialRender` | `boolean`            | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's  bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's  bottom line when hovering.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.14.0-canary.b3211481.0","_nodeVersion":"10.19.0","_npmVersion":"lerna/3.20.2/node@v10.19.0+x64 (linux)","dist":{"integrity":"sha512-REtO2bFXz01Ur/AySchjZuCQ7MhHCb3y2mipnNbwBPDRtv5F7EEbBkYRqCli7IH4i38VpVlnorsBaYiuDtKE3w==","shasum":"cb0e34fbb767217503e59223158c82a9dac03297","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.14.0-canary.b3211481.0.tgz","fileCount":20,"unpackedSize":281583,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeaUjeCRA9TVsSAnZWagAAtEwQAIVbVhVsDt1bzmFOloYV\ndAHRu2vpKvMF9bCUHAzuAOsf50fnY8vZwmG8TJ3J6arolk1VT5uULPN96oPB\njN43A1JOqwr+wxOa0OJEjymbvsBCAGYCBpB1Z8Q2wlGyl+ljBTux9+DoVdzf\nYME8HNyC0GDYcrOrruNSSSwAKv9cjUBMz2JZ5BHQSL51aaHXw8AXGF9hA/VX\nU5cfHLq6M3z+o9Aj5xuBewXwvFt32vw6gGx7z4XK/tOx5ZYHLsQ6taJqjmfV\n8GYHvZuCMUHsu+InUvb1+qcUq/HjzUC3p0HqyKNqZBv4fPL71GdjcBgshvOp\nZblZfFvFs9emHM395oyiVdJGupgEFP4yfkUyrgpPMolhD99yxaOd9XcuKMNZ\n46N3UITyvISRqdyDOQ+ASp1g44yU748JQKMf1Bcbmf6yQpG6x8ysFPocHkFw\nyIKYCc/KOIXAcQ1t05XoGlXoU+D9qTVK0BsZrGNOF8bT18DCNgNkrWmhIfaW\n27BUnNEu/Vy84c273ssrDF2Lbo+ejRgg/PHdS0LOF6oWf5i1eWpugQ6ssRVc\nxsCCH8Xv0a//K9ritzH0wpknjkhimd930KyZQxQhbGOM3uO4WpHDMcyG+a8G\nfDAHwG5AUu25QUJwKvCLxl6GcOA0CI2oKDlllu/eLVqiA5thIw1XLszlOFkF\nRtvT\r\n=/eew\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCYHbNPGRGecLTAYv5946908IhgZozufptsPuo1JcZdRgIgKcn8M8ViB4s6ZDbb2syWJVdrMVtc/fDb4k1Fsoes2xg="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.14.0-canary.b3211481.0_1583958237753_0.15396870890945613"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.14.0-canary.0b5c7f23.0":{"name":"@material/mwc-textfield","version":"0.14.0-canary.0b5c7f23.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.d5808057f.0","@material/line-ripple":"=6.0.0-canary.d5808057f.0","@material/mwc-base":"0.14.0-canary.0b5c7f23.0","@material/mwc-floating-label":"0.14.0-canary.0b5c7f23.0","@material/mwc-icon":"0.14.0-canary.0b5c7f23.0","@material/mwc-line-ripple":"0.14.0-canary.0b5c7f23.0","@material/mwc-notched-outline":"0.14.0-canary.0b5c7f23.0","@material/shape":"=6.0.0-canary.d5808057f.0","@material/textfield":"=6.0.0-canary.d5808057f.0","@material/theme":"=6.0.0-canary.d5808057f.0","lit-element":"^2.2.1","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"c142ca8fe1db14da6fd164a99ca71277489f9b16","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c142ca8fe1db14da6fd164a99ca71277489f9b16/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c142ca8fe1db14da6fd164a99ca71277489f9b16/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c142ca8fe1db14da6fd164a99ca71277489f9b16/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c142ca8fe1db14da6fd164a99ca71277489f9b16/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c142ca8fe1db14da6fd164a99ca71277489f9b16/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c142ca8fe1db14da6fd164a99ca71277489f9b16/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c142ca8fe1db14da6fd164a99ca71277489f9b16/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c142ca8fe1db14da6fd164a99ca71277489f9b16/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c142ca8fe1db14da6fd164a99ca71277489f9b16/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c142ca8fe1db14da6fd164a99ca71277489f9b16/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c142ca8fe1db14da6fd164a99ca71277489f9b16/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\n| Name                | Type             | Description\n| ------------------- | ---------------- |------------\n| `value`             | `string`         | The input control's value.\n| `type`              | `TextFieldType*` | A string specifying the type of control to render.\n| `label`             | `string`         | Sets floating label value.\n| `placeholder`       | `string`         | Sets disappearing input placeholder.\n| `icon`              | `string`         | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `iconTrailing`      | `string`         | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `disabled`          | `boolean`        | Whether or not the input should be disabled.\n| `charCounter`       | `boolean`        | **Note: requries `maxLength` to be set.** Display character counter with max length.\n| `outlined`          | `boolean`        | Whether or not to show the material outlined variant.\n| `fullwidth`         | `boolean`        | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n| `helper`            | `string`         | Helper text to display below the input. Display default only when focused.\n| `helperPersistent`  | `boolean`        | Always show the helper text despite focus.\n| `required`          | `boolean`        | Displays error state if value is empty and input is blurred.\n| `maxLength`         | `number`         | Maximum length to accept input.\n| `validationMessage` | `string`         | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n| `pattern`           | `string`         | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `min`               | `number`\\|`string`  | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `max`               | `number`\\|`string`  | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `step`              | `number`\\|`null`    | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n| `autoValidate`      | `boolean`           | Reports validity on input rather than only on blur.\n| `validity`          | `ValidityState` (readonly) | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n| `willValidate`      | `boolean` (readonly)       | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n| `validityTransform` | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n| `validateOnInitialRender` | `boolean`            | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's  bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's  bottom line when hovering.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.14.0-canary.0b5c7f23.0","_nodeVersion":"10.19.0","_npmVersion":"lerna/3.20.2/node@v10.19.0+x64 (linux)","dist":{"integrity":"sha512-xbImIzoAI7pEHKvSG6A7CXl98/cpOs0ewGz1hRJBc3MfoQYzdaqSlOvqfgVqBsbKDU6xW0ZdKk2F6ECF2KXDcg==","shasum":"a1e53b4423f328168e02dd9c3a558254f06bc320","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.14.0-canary.0b5c7f23.0.tgz","fileCount":20,"unpackedSize":281909,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeaV3yCRA9TVsSAnZWagAAVIUP/15VKHc7I4gcXvOWQWT9\nAK2k2T18Ng2NoN4MbLmUhTzauLrOiGCKi5mj1fAv1EoqIz1FBNMCPk2NjKA3\nk/8CLWiEZyq9pCsZeoXrXGqX+el7ByJeGlDoG+SqgpZkm9yldnnDfgZIkeEo\nIDGrF42ChCRZQc+Ro6OdTNCVhL9xXOn5vTWgzrNh3ZTcz62r+OW3TK+9z2S3\nzqlzRJDUw24G/0BdvbbE1G3bhNqL6+UNRZ4K5kBzyPAFPSfKrgP5SmEUxbqT\nZfLdzcwM9buh48SKIO30/DbgW3WSEdm/1Ym9hZC45LTNnJPzxA8pln4ltoPX\nPN5VfQuK5Bp1c9JDMZZMXLsPES3+m1kQO3IBig7zQwQzhPf313oHVnL2aK12\n4gHWRdEYr3pL4G6BMzcZe+rNVqV8fS5JH8hYh+TBhKCDxRyjx9d/6V3UFkGC\nmni589QwsEZck47YFRF7aG/g+P/RncNZzMlAra0KUzthpV/r7ULbI/WoNTwe\nxIouJY9Ng9zsD5bzxewmh+LBGjuPb5dHci+FSWkL33cQ3cCmOuNX7tO/PDN8\n+EYDB+SyBLX7LPNxO3iU2Ll6U6d8QF7MNWf7b/aKOzf5VgK6y0y/hdJVvq+5\nOAut+lke9PL94AFrb00SkWHknzWEZPY9QGg1nlA/MLOWMU5cRmCVN1VFF7Bv\n67G1\r\n=qbMT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHeSwDJy6vEiBhPiks99L6EuskELItEA4+wjfKO8j70oAiEA7Bh4Av1CC2lqA28M7jBrwjK7WdNjmO3BtA6l5hTGaXY="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.14.0-canary.0b5c7f23.0_1583963633625_0.28389480857428473"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.14.0-canary.6c0f0b27.0":{"name":"@material/mwc-textfield","version":"0.14.0-canary.6c0f0b27.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.bec065920.0","@material/line-ripple":"=6.0.0-canary.bec065920.0","@material/mwc-base":"0.14.0-canary.6c0f0b27.0","@material/mwc-floating-label":"0.14.0-canary.6c0f0b27.0","@material/mwc-icon":"0.14.0-canary.6c0f0b27.0","@material/mwc-line-ripple":"0.14.0-canary.6c0f0b27.0","@material/mwc-notched-outline":"0.14.0-canary.6c0f0b27.0","@material/shape":"=6.0.0-canary.bec065920.0","@material/textfield":"=6.0.0-canary.bec065920.0","@material/theme":"=6.0.0-canary.bec065920.0","lit-element":"^2.2.1","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"642e3027b591cf821c0ef159a9bd31f56677de91","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/642e3027b591cf821c0ef159a9bd31f56677de91/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/642e3027b591cf821c0ef159a9bd31f56677de91/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/642e3027b591cf821c0ef159a9bd31f56677de91/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/642e3027b591cf821c0ef159a9bd31f56677de91/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/642e3027b591cf821c0ef159a9bd31f56677de91/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/642e3027b591cf821c0ef159a9bd31f56677de91/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/642e3027b591cf821c0ef159a9bd31f56677de91/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/642e3027b591cf821c0ef159a9bd31f56677de91/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/642e3027b591cf821c0ef159a9bd31f56677de91/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/642e3027b591cf821c0ef159a9bd31f56677de91/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/642e3027b591cf821c0ef159a9bd31f56677de91/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\n| Name                | Type             | Description\n| ------------------- | ---------------- |------------\n| `value`             | `string`         | The input control's value.\n| `type`              | `TextFieldType*` | A string specifying the type of control to render.\n| `label`             | `string`         | Sets floating label value.\n| `placeholder`       | `string`         | Sets disappearing input placeholder.\n| `icon`              | `string`         | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `iconTrailing`      | `string`         | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `disabled`          | `boolean`        | Whether or not the input should be disabled.\n| `charCounter`       | `boolean`        | **Note: requries `maxLength` to be set.** Display character counter with max length.\n| `outlined`          | `boolean`        | Whether or not to show the material outlined variant.\n| `fullwidth`         | `boolean`        | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n| `helper`            | `string`         | Helper text to display below the input. Display default only when focused.\n| `helperPersistent`  | `boolean`        | Always show the helper text despite focus.\n| `required`          | `boolean`        | Displays error state if value is empty and input is blurred.\n| `maxLength`         | `number`         | Maximum length to accept input.\n| `validationMessage` | `string`         | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n| `pattern`           | `string`         | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `min`               | `number`\\|`string`  | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `max`               | `number`\\|`string`  | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `step`              | `number`\\|`null`    | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n| `autoValidate`      | `boolean`           | Reports validity on input rather than only on blur.\n| `validity`          | `ValidityState` (readonly) | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n| `willValidate`      | `boolean` (readonly)       | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n| `validityTransform` | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n| `validateOnInitialRender` | `boolean`            | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's  bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's  bottom line when hovering.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.14.0-canary.6c0f0b27.0","_nodeVersion":"10.19.0","_npmVersion":"lerna/3.20.2/node@v10.19.0+x64 (linux)","dist":{"integrity":"sha512-WTCeo1Y0JyoZaBxngGSE7RMHLwUGumhmxKAiMiItyhxZjopW7b3oFYt/0bAkI6qchjY1U/VzJoYgspvkmQcmag==","shasum":"81e0957873db9c82a10a28182b8a0f84388beb7d","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.14.0-canary.6c0f0b27.0.tgz","fileCount":20,"unpackedSize":281909,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeaqbYCRA9TVsSAnZWagAAo10P/2W7zFwUtCL0DdfpPwVD\nGrsoo8BKIchXHS2kh1SoNtmBmKUATV8J7WQKGevTTn13DJnCbQ342TUI6xyt\nz2GN3281sij7bJpzF41tvMBiZISvyLubFmmqYNeTA4q7pC6LG421FmqEt2Y5\nibkcuJzFfaucIWLiF2kfWAcs3NsONZZHfkWt0vBYgl7UX8ozEnGdWzcsmthZ\n8QdmK1Y2W/9Uj3CBy0eGyLnQphld06kYqaR9L6Z3oaVX3dA5B1RKedggsesf\nkmfexnEgrY3XDOmNSvt7lbIMNTjuB1KA7mpTa/KaPvrALzB9Dt6seObmDgeA\nPA5bGouKX8G0isZNr51/SX4pbA/RqpsTWH5uA4qVTu1+cvA9Z3qxhIjxLJwu\n7jHlWnI6jQZHsM7WPnee44hHc8zMvPgXs80XP7hoK8s740FIIH65utlTutId\ng9CWymGIyhdiJkIf2D3y6bVaqXiiYYVCMO8eomPpWI9VWsLcI5d8GPjT4nKB\nsQdESdCGjQ/+Kpmc9MY43bwI8PGcZiFQyN6G4FoUys2C7Al6Fw1Dgww9Rnka\nY8gMeuDs5bYAD/whp3k6YrBgjJ/WCbgMqm8IIHe44X7ooeU0ieDI0QJ12KAK\nlR3p9JJRI/SCm/AvYGUAcs2gIeF6ysPT/OtkdJPQryHyPxzx3JMfsDeQ/N43\nS982\r\n=ZAyA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAykkEnJZJmwklV0900hPZZB8XNZNjEYsp9yWxlZfy9VAiA4YMgE1jEd06Lu7gsEGi8gr9SHaiQqwuFyaOX31U0MvA=="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.14.0-canary.6c0f0b27.0_1584047832261_0.9440667236476628"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.14.0-canary.b6c53425.0":{"name":"@material/mwc-textfield","version":"0.14.0-canary.b6c53425.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.bec065920.0","@material/line-ripple":"=6.0.0-canary.bec065920.0","@material/mwc-base":"0.14.0-canary.b6c53425.0","@material/mwc-floating-label":"0.14.0-canary.b6c53425.0","@material/mwc-icon":"0.14.0-canary.b6c53425.0","@material/mwc-line-ripple":"0.14.0-canary.b6c53425.0","@material/mwc-notched-outline":"0.14.0-canary.b6c53425.0","@material/shape":"=6.0.0-canary.bec065920.0","@material/textfield":"=6.0.0-canary.bec065920.0","@material/theme":"=6.0.0-canary.bec065920.0","lit-element":"^2.2.1","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"21e9310c19b1139fef9125fef8610235d0ef0e4b","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/21e9310c19b1139fef9125fef8610235d0ef0e4b/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/21e9310c19b1139fef9125fef8610235d0ef0e4b/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/21e9310c19b1139fef9125fef8610235d0ef0e4b/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/21e9310c19b1139fef9125fef8610235d0ef0e4b/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/21e9310c19b1139fef9125fef8610235d0ef0e4b/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/21e9310c19b1139fef9125fef8610235d0ef0e4b/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/21e9310c19b1139fef9125fef8610235d0ef0e4b/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/21e9310c19b1139fef9125fef8610235d0ef0e4b/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/21e9310c19b1139fef9125fef8610235d0ef0e4b/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/21e9310c19b1139fef9125fef8610235d0ef0e4b/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/21e9310c19b1139fef9125fef8610235d0ef0e4b/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\n| Name                | Type             | Description\n| ------------------- | ---------------- |------------\n| `value`             | `string`         | The input control's value.\n| `type`              | `TextFieldType*` | A string specifying the type of control to render.\n| `label`             | `string`         | Sets floating label value.\n| `placeholder`       | `string`         | Sets disappearing input placeholder.\n| `icon`              | `string`         | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `iconTrailing`      | `string`         | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `disabled`          | `boolean`        | Whether or not the input should be disabled.\n| `charCounter`       | `boolean`        | **Note: requries `maxLength` to be set.** Display character counter with max length.\n| `outlined`          | `boolean`        | Whether or not to show the material outlined variant.\n| `fullwidth`         | `boolean`        | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n| `helper`            | `string`         | Helper text to display below the input. Display default only when focused.\n| `helperPersistent`  | `boolean`        | Always show the helper text despite focus.\n| `required`          | `boolean`        | Displays error state if value is empty and input is blurred.\n| `maxLength`         | `number`         | Maximum length to accept input.\n| `validationMessage` | `string`         | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n| `pattern`           | `string`         | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `min`               | `number`\\|`string`  | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `max`               | `number`\\|`string`  | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `step`              | `number`\\|`null`    | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n| `autoValidate`      | `boolean`           | Reports validity on input rather than only on blur.\n| `validity`          | `ValidityState` (readonly) | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n| `willValidate`      | `boolean` (readonly)       | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n| `validityTransform` | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n| `validateOnInitialRender` | `boolean`            | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's  bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's  bottom line when hovering.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.14.0-canary.b6c53425.0","_nodeVersion":"10.19.0","_npmVersion":"lerna/3.20.2/node@v10.19.0+x64 (linux)","dist":{"integrity":"sha512-UftHzBrPuXgXkQ5GKFlrWZDrXhJFYAuTUlHMQlI+npQoiFxhbtV3Qva2Do9HvaUEOC2SX8bkJazqFuCjfkfytw==","shasum":"b93a8d5b751a56797bbc3f17bb1d89a7368a8357","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.14.0-canary.b6c53425.0.tgz","fileCount":20,"unpackedSize":281909,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJea7r7CRA9TVsSAnZWagAAbhcP+wWnWwyPBOmKEqlffqXZ\ncHR1px5qDmeb9SKogqBNzHMzY3r8wLTuT9jpxr/VsNDljDY0RmyW06zHyG/j\nASIMn6RNdhvqpagNNVAYXKpEDNuLegZFBv0BTev7EkeLtvkOpiCrogS8arHj\nFiJF299Djr+SWrBXEfdu1aAmgZB3VLjP0sgYEuTCcdzcbio9y2z2ENTKcAre\nxcRpWYlXFNUERYWqOJeJ9OGFzyezvqDJMHv/FqofrOh9Ar+GJ2YV94vTLCNO\nnzq6xE8hRP/paUoaEQbRz0lgIJgCxgI9qgP2nvzaM6cnL882PKuKbbECSsDI\nKBI44LH/4XyMLw+RfdJX8zrDJ/41z9EnGAQGZ7ZWz6GmdhImBGC/CJF8vMHI\nyoMQWARItxhduFxLFxh+K67WWYiEA1MGTpvXStR+cGUFxS36akPbgQ/lpqHt\nrInAdSUScNvqzmMl7NsfUDFZSlukIGD9iWQhL+AxEY4HaLshFgc5mvoIlIWm\nbPzmMqfVE3c+vCbNfPxWpdbAGHKNJgFXVQBPbikC5BIfNfNsVu6Hitibnimw\nHoQK04Fobc/vFeAppsorAn6+CY9UBIcs0SsHx251mEGViTyeeFtI+ibBIs4L\n7XTrhDlfO2O/0p0PrFHb6/SxcZ8jUiGLRTMrlmUduPOOMNU95ygKyOh4sg47\nuwQJ\r\n=SWRB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDzbVNWGZWXwsRjok5jFUuxvpD/X1UkI1lmPKrOUuq5RAIhAIqWLSmuYs7TE6uAsI9qaep5q6obk4Yj4Gn8QAVsa3Lg"}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.14.0-canary.b6c53425.0_1584118522569_0.919247991941494"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.14.0-canary.306cabed.0":{"name":"@material/mwc-textfield","version":"0.14.0-canary.306cabed.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.bec065920.0","@material/line-ripple":"=6.0.0-canary.bec065920.0","@material/mwc-base":"0.14.0-canary.306cabed.0","@material/mwc-floating-label":"0.14.0-canary.306cabed.0","@material/mwc-icon":"0.14.0-canary.306cabed.0","@material/mwc-line-ripple":"0.14.0-canary.306cabed.0","@material/mwc-notched-outline":"0.14.0-canary.306cabed.0","@material/shape":"=6.0.0-canary.bec065920.0","@material/textfield":"=6.0.0-canary.bec065920.0","@material/theme":"=6.0.0-canary.bec065920.0","lit-element":"^2.2.1","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"7b07db227ed0e98a8a55068a9460e3969aa14b37","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7b07db227ed0e98a8a55068a9460e3969aa14b37/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7b07db227ed0e98a8a55068a9460e3969aa14b37/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7b07db227ed0e98a8a55068a9460e3969aa14b37/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7b07db227ed0e98a8a55068a9460e3969aa14b37/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7b07db227ed0e98a8a55068a9460e3969aa14b37/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7b07db227ed0e98a8a55068a9460e3969aa14b37/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7b07db227ed0e98a8a55068a9460e3969aa14b37/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7b07db227ed0e98a8a55068a9460e3969aa14b37/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7b07db227ed0e98a8a55068a9460e3969aa14b37/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7b07db227ed0e98a8a55068a9460e3969aa14b37/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7b07db227ed0e98a8a55068a9460e3969aa14b37/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\n| Name                | Type             | Description\n| ------------------- | ---------------- |------------\n| `value`             | `string`         | The input control's value.\n| `type`              | `TextFieldType*` | A string specifying the type of control to render.\n| `label`             | `string`         | Sets floating label value.\n| `placeholder`       | `string`         | Sets disappearing input placeholder.\n| `icon`              | `string`         | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `iconTrailing`      | `string`         | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `disabled`          | `boolean`        | Whether or not the input should be disabled.\n| `charCounter`       | `boolean`        | **Note: requries `maxLength` to be set.** Display character counter with max length.\n| `outlined`          | `boolean`        | Whether or not to show the material outlined variant.\n| `fullwidth`         | `boolean`        | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n| `helper`            | `string`         | Helper text to display below the input. Display default only when focused.\n| `helperPersistent`  | `boolean`        | Always show the helper text despite focus.\n| `required`          | `boolean`        | Displays error state if value is empty and input is blurred.\n| `maxLength`         | `number`         | Maximum length to accept input.\n| `validationMessage` | `string`         | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n| `pattern`           | `string`         | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `min`               | `number`\\|`string`  | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `max`               | `number`\\|`string`  | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `step`              | `number`\\|`null`    | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n| `autoValidate`      | `boolean`           | Reports validity on input rather than only on blur.\n| `validity`          | `ValidityState` (readonly) | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n| `willValidate`      | `boolean` (readonly)       | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n| `validityTransform` | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n| `validateOnInitialRender` | `boolean`            | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's  bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's  bottom line when hovering.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.14.0-canary.306cabed.0","_nodeVersion":"10.19.0","_npmVersion":"lerna/3.20.2/node@v10.19.0+x64 (linux)","dist":{"integrity":"sha512-tedibDIddBj+uAV3gnCrx6cu74q5+hBZ/NKPAv7HpI5tYkA/ggIF/gMdEvKQjfBvICRLsNTHplPNdgBOQ8HFFg==","shasum":"5d6b5fbf844dbd67a2c6bb3c8640008d8edd00d1","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.14.0-canary.306cabed.0.tgz","fileCount":20,"unpackedSize":281909,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJecT54CRA9TVsSAnZWagAAggMQAJx3hkF8Nd6iycJQCqhl\nVnSOcncWTW1+fD9wMnpsWDefuK3MGq6oKWeQ0KiMSI95X4DXGG4sESfINaiv\n9oco6bEwi1cTras1Dtns/9Yi4Vb+amrYNwhbP0dEehpXMJwKXDjTa7VhGmg7\nu1W7bS7fAmqT8TkJyMaHRSUiiazXrJmClJFMTCTqz/TAgp2cvXVY/1KtVWaa\nJu07OxgzU6bXx7I66LE9TTYPJJDSCwnkj5aiP4RIfGNTx/fLlXrpdrtgvqpW\nzq/Mj66fT/DSA0dwsdMHfhvnZTKqX5k8owth8+7TJcC97Serp4CCr0U5BhJz\nyln6AcT7v0Gs0dS8tEiFWNURESZyKWlFHpla9siMya1fJvXAuCU259BaP10x\ns5+IUOgNng8n4GD6RCmyu7UWO2QKPejt90rvOvLsU1HG1wEc42EQYjWe7vcd\nNARiSu6DSXrefpM3A/zO8woDbqO+RpaMcjX56JM48007H9AnW2P6TBzLeQX6\nXIpTPpxdqyl0Q9EQaaCSi3Wp3a0kCMvM3hEdDP0h6cN2EsTESXfYYFTujIgb\n4WDuVpUSxkM6tZ7qyBnsS/DoX1zPXBZ7lTMwuCt/sb/0g9+PxZiGnV4HPOqz\nzPFq9+zaYMubBAHUdJQaaGbNEY8QMBgy/DmfctRGTfPi3kjNi2ovpcjU7QI/\nQgyw\r\n=jYqn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDucTlgVb/gGaKAcFNIPLK8macrGQyub5bldSbipwJUfgIgLmQWLAVE9oTgVEuhNEN90Dc8fRaAyDJC23wpq7l6T5Q="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.14.0-canary.306cabed.0_1584479863716_0.20252263599576747"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.14.0-canary.4e250cbc.0":{"name":"@material/mwc-textfield","version":"0.14.0-canary.4e250cbc.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.776291ef0.0","@material/line-ripple":"=6.0.0-canary.776291ef0.0","@material/mwc-base":"0.14.0-canary.4e250cbc.0","@material/mwc-floating-label":"0.14.0-canary.4e250cbc.0","@material/mwc-icon":"0.14.0-canary.4e250cbc.0","@material/mwc-line-ripple":"0.14.0-canary.4e250cbc.0","@material/mwc-notched-outline":"0.14.0-canary.4e250cbc.0","@material/shape":"=6.0.0-canary.776291ef0.0","@material/textfield":"=6.0.0-canary.776291ef0.0","@material/theme":"=6.0.0-canary.776291ef0.0","lit-element":"^2.2.1","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"8e0b10a13a5b20d13409bc4bec6f11a4ff757663","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8e0b10a13a5b20d13409bc4bec6f11a4ff757663/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8e0b10a13a5b20d13409bc4bec6f11a4ff757663/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8e0b10a13a5b20d13409bc4bec6f11a4ff757663/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8e0b10a13a5b20d13409bc4bec6f11a4ff757663/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8e0b10a13a5b20d13409bc4bec6f11a4ff757663/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8e0b10a13a5b20d13409bc4bec6f11a4ff757663/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8e0b10a13a5b20d13409bc4bec6f11a4ff757663/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8e0b10a13a5b20d13409bc4bec6f11a4ff757663/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8e0b10a13a5b20d13409bc4bec6f11a4ff757663/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8e0b10a13a5b20d13409bc4bec6f11a4ff757663/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8e0b10a13a5b20d13409bc4bec6f11a4ff757663/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\n| Name                | Type             | Description\n| ------------------- | ---------------- |------------\n| `value`             | `string`         | The input control's value.\n| `type`              | `TextFieldType*` | A string specifying the type of control to render.\n| `label`             | `string`         | Sets floating label value.\n| `placeholder`       | `string`         | Sets disappearing input placeholder.\n| `icon`              | `string`         | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `iconTrailing`      | `string`         | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `disabled`          | `boolean`        | Whether or not the input should be disabled.\n| `charCounter`       | `boolean`        | **Note: requries `maxLength` to be set.** Display character counter with max length.\n| `outlined`          | `boolean`        | Whether or not to show the material outlined variant.\n| `fullwidth`         | `boolean`        | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n| `helper`            | `string`         | Helper text to display below the input. Display default only when focused.\n| `helperPersistent`  | `boolean`        | Always show the helper text despite focus.\n| `required`          | `boolean`        | Displays error state if value is empty and input is blurred.\n| `maxLength`         | `number`         | Maximum length to accept input.\n| `validationMessage` | `string`         | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n| `pattern`           | `string`         | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `min`               | `number`\\|`string`  | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `max`               | `number`\\|`string`  | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `step`              | `number`\\|`null`    | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n| `autoValidate`      | `boolean`           | Reports validity on input rather than only on blur.\n| `validity`          | `ValidityState` (readonly) | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n| `willValidate`      | `boolean` (readonly)       | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n| `validityTransform` | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n| `validateOnInitialRender` | `boolean`            | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's  bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's  bottom line when hovering.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.14.0-canary.4e250cbc.0","_nodeVersion":"10.19.0","_npmVersion":"lerna/3.20.2/node@v10.19.0+x64 (linux)","dist":{"integrity":"sha512-s7W6hdYUzRwcbfBsAZ0kX7qICiPExsWoHz8nurXJJJCb8EWKMUkgzIo0vCm1YgC68v2iImaD8j29Ms90sptZUw==","shasum":"54eebb421a221feab2538ee33177d4d25d472f96","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.14.0-canary.4e250cbc.0.tgz","fileCount":20,"unpackedSize":254624,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJecT/1CRA9TVsSAnZWagAAnD4P/3lFuofhjouw5ZJ9/pw8\nv91JDje2ClmjRKM62kMYFKf6RPFBZIh2T0mIAmMTggI2/lNUdHOLUfebrXLJ\nz0vN3jU7eVoRh68eO5EvSFB5GXau6U07WyCnmRd8+UaHegkWv15vexa4CnBz\n3hZrX00p899ILoi8dGC7vQBC1sD4G5J8hj4hNQaUHSnBWA3UVi7PAtDZeyGr\nfDqBMyh8gSHsa6/WLRvHpP1V5PaR9X/n/A4gwBt/B9ks/r53vThwWM4/OqTx\n8mCns5R++zLk1WXEfNC+XqnTlN6f1Onn7Rv7xgtfUrnNtHD3SJ21ubdTiVrG\n1q5UDrS1O44dqcarfat7UoDlGNxRXKsQZkaTCvJxsloQ/X+zrreceLPvPDWG\nNffuaErAZ1a8zDVMbLp6CJ++UWk5y9+lpPV3BYFsZQQebsUybIgLlmxGRPl2\n49GAalEVg4ZRXat/JimnIoc5I5Gy0SCwY3mFxf9qKI9FWwpcWidizRPWzmq5\nmpaG8KurcZu5UhxRQNnYafb9LNmLB7Yx9QcBSnSORXbLzU66YTJBjRAyKo62\nkXUfCqOTBB+An/HANEHUelwTyrYF8bfcZvPsPD8WnnqVyT0VCIPzoBS9Rk1Z\nijjrEQ7jMNpFE2Em0UgxuV3tq4AG64I9Zkv/oeqS0rg836spN04rhVPwqwyU\nkLUd\r\n=hDoL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFHA7X6yswFDpeUdTHewpsAHKm9GgtU9syviYJlVgXmKAiBnoqMRJLfXsedeYvzb1+27iaJhxHWkGDTMkWoCNYHFJw=="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.14.0-canary.4e250cbc.0_1584480244936_0.023456799463616784"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.14.0-canary.ff82d9ec.0":{"name":"@material/mwc-textfield","version":"0.14.0-canary.ff82d9ec.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.6b48781bf.0","@material/line-ripple":"=6.0.0-canary.6b48781bf.0","@material/mwc-base":"0.14.0-canary.ff82d9ec.0","@material/mwc-floating-label":"0.14.0-canary.ff82d9ec.0","@material/mwc-icon":"0.14.0-canary.ff82d9ec.0","@material/mwc-line-ripple":"0.14.0-canary.ff82d9ec.0","@material/mwc-notched-outline":"0.14.0-canary.ff82d9ec.0","@material/shape":"=6.0.0-canary.6b48781bf.0","@material/textfield":"=6.0.0-canary.6b48781bf.0","@material/theme":"=6.0.0-canary.6b48781bf.0","lit-element":"^2.2.1","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"0af402cd2ff3748cfa5f7956ad2211ec9271c83e","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0af402cd2ff3748cfa5f7956ad2211ec9271c83e/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0af402cd2ff3748cfa5f7956ad2211ec9271c83e/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0af402cd2ff3748cfa5f7956ad2211ec9271c83e/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0af402cd2ff3748cfa5f7956ad2211ec9271c83e/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0af402cd2ff3748cfa5f7956ad2211ec9271c83e/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0af402cd2ff3748cfa5f7956ad2211ec9271c83e/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0af402cd2ff3748cfa5f7956ad2211ec9271c83e/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0af402cd2ff3748cfa5f7956ad2211ec9271c83e/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0af402cd2ff3748cfa5f7956ad2211ec9271c83e/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0af402cd2ff3748cfa5f7956ad2211ec9271c83e/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0af402cd2ff3748cfa5f7956ad2211ec9271c83e/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\n| Name                | Type             | Description\n| ------------------- | ---------------- |------------\n| `value`             | `string`         | The input control's value.\n| `type`              | `TextFieldType*` | A string specifying the type of control to render.\n| `label`             | `string`         | Sets floating label value.\n| `placeholder`       | `string`         | Sets disappearing input placeholder.\n| `icon`              | `string`         | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `iconTrailing`      | `string`         | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `disabled`          | `boolean`        | Whether or not the input should be disabled.\n| `charCounter`       | `boolean`        | **Note: requries `maxLength` to be set.** Display character counter with max length.\n| `outlined`          | `boolean`        | Whether or not to show the material outlined variant.\n| `fullwidth`         | `boolean`        | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n| `helper`            | `string`         | Helper text to display below the input. Display default only when focused.\n| `helperPersistent`  | `boolean`        | Always show the helper text despite focus.\n| `required`          | `boolean`        | Displays error state if value is empty and input is blurred.\n| `maxLength`         | `number`         | Maximum length to accept input.\n| `validationMessage` | `string`         | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n| `pattern`           | `string`         | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `min`               | `number`\\|`string`  | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `max`               | `number`\\|`string`  | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `step`              | `number`\\|`null`    | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n| `autoValidate`      | `boolean`           | Reports validity on input rather than only on blur.\n| `validity`          | `ValidityState` (readonly) | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n| `willValidate`      | `boolean` (readonly)       | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n| `validityTransform` | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n| `validateOnInitialRender` | `boolean`            | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's  bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's  bottom line when hovering.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.14.0-canary.ff82d9ec.0","_nodeVersion":"10.19.0","_npmVersion":"lerna/3.20.2/node@v10.19.0+x64 (linux)","dist":{"integrity":"sha512-c0tNbQbdZoQ3lAzoJKxK2sFePVCVrt8ZyJOxrBXOY94PJp6DT3O07xyR3zqKdlC2UwvunNRFK6DMvVJmX8XO7w==","shasum":"d2f82f8d54b2fd2bc99d9436b44c5ecf7fd811fe","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.14.0-canary.ff82d9ec.0.tgz","fileCount":20,"unpackedSize":254624,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJecmY8CRA9TVsSAnZWagAAH4wP/2fHdmHUaFBGmoNJbWkz\nKUVFD1Fdh+M2ymk6LgiRwdr1DmBlSzCIiW77r3hS6oTjNrbqzbq864Xjl7Xo\nI1xPeD1pekjs/qdw/Y5Cw2ECugJr1qbTG44ElYGPRhHCZ7SNLNugOKZ6pcyP\n8cqqMJggsBQyT++6SftolUyMBxpNhGBA+1xINQ3vajgPHXC2g2JsYaeG47ht\nlYC6EjKbGP9eP21JCFTioUJoxsexvE3DTab2xhVRuS3WinX9JnnsiSLJTN1V\ndBq99N2B3u1oUngIOaNCL83LSLC+rvK4yVlfZWcFfmSZXLSDt8llUuoVWSXS\nwx9gyHNNbxzooTwaygSsShYlkHVxt5ihIXh7soFm7jJgDA+S19XFXyxnm0Em\nNpKbbtLDRiaI2H3owxb9O6GyE0zESuRyrqpT1jrGTR+/t2N5y53Snv5wVQzN\n3I12Yvi2HZRvkanzmObSUqEtVv6Rm9ElW9o+Z6O85YiZmlZkTW4Uc6VlAovI\n3VsAO0DVbvC+a+GZmOnpdTVIwROuGGjnIJxhSo7qefUUeQh3oQJpkhuFtNs9\nAuMX1bTw8mKvObdig9o17m46dIL6WvsYt+ad+RkxSs0QzksCmy8PYw/PBTLu\nxBDHFOTMcTqNdvdzmIau2bclt+vhA0Xj4UxwsmU5AP88aD0KsAZcJBL5UlgF\nt7G6\r\n=eWvV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICNyOscVg9/ODMM5uYsfcog1dCl/dz1L5wujsHMg3apbAiAL0Z2On2IAw5tQGKLPRTA6c980ur6T1su+7w0PIRS4og=="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.14.0-canary.ff82d9ec.0_1584555580351_0.5571295545622867"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.14.0-canary.f50f48ef.0":{"name":"@material/mwc-textfield","version":"0.14.0-canary.f50f48ef.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.6b48781bf.0","@material/line-ripple":"=6.0.0-canary.6b48781bf.0","@material/mwc-base":"0.14.0-canary.f50f48ef.0","@material/mwc-floating-label":"0.14.0-canary.f50f48ef.0","@material/mwc-icon":"0.14.0-canary.f50f48ef.0","@material/mwc-line-ripple":"0.14.0-canary.f50f48ef.0","@material/mwc-notched-outline":"0.14.0-canary.f50f48ef.0","@material/shape":"=6.0.0-canary.6b48781bf.0","@material/textfield":"=6.0.0-canary.6b48781bf.0","@material/theme":"=6.0.0-canary.6b48781bf.0","lit-element":"^2.2.1","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"0c4d2eecbe04ec4e08549650e593ff154b7d7e84","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0c4d2eecbe04ec4e08549650e593ff154b7d7e84/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0c4d2eecbe04ec4e08549650e593ff154b7d7e84/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0c4d2eecbe04ec4e08549650e593ff154b7d7e84/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0c4d2eecbe04ec4e08549650e593ff154b7d7e84/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0c4d2eecbe04ec4e08549650e593ff154b7d7e84/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0c4d2eecbe04ec4e08549650e593ff154b7d7e84/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0c4d2eecbe04ec4e08549650e593ff154b7d7e84/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0c4d2eecbe04ec4e08549650e593ff154b7d7e84/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0c4d2eecbe04ec4e08549650e593ff154b7d7e84/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0c4d2eecbe04ec4e08549650e593ff154b7d7e84/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0c4d2eecbe04ec4e08549650e593ff154b7d7e84/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\n| Name                | Type             | Description\n| ------------------- | ---------------- |------------\n| `value`             | `string`         | The input control's value.\n| `type`              | `TextFieldType*` | A string specifying the type of control to render.\n| `label`             | `string`         | Sets floating label value.\n| `placeholder`       | `string`         | Sets disappearing input placeholder.\n| `icon`              | `string`         | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `iconTrailing`      | `string`         | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `disabled`          | `boolean`        | Whether or not the input should be disabled.\n| `charCounter`       | `boolean`        | **Note: requries `maxLength` to be set.** Display character counter with max length.\n| `outlined`          | `boolean`        | Whether or not to show the material outlined variant.\n| `fullwidth`         | `boolean`        | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n| `helper`            | `string`         | Helper text to display below the input. Display default only when focused.\n| `helperPersistent`  | `boolean`        | Always show the helper text despite focus.\n| `required`          | `boolean`        | Displays error state if value is empty and input is blurred.\n| `maxLength`         | `number`         | Maximum length to accept input.\n| `validationMessage` | `string`         | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n| `pattern`           | `string`         | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `min`               | `number`\\|`string`  | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `max`               | `number`\\|`string`  | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `step`              | `number`\\|`null`    | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n| `autoValidate`      | `boolean`           | Reports validity on input rather than only on blur.\n| `validity`          | `ValidityState` (readonly) | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n| `willValidate`      | `boolean` (readonly)       | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n| `validityTransform` | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n| `validateOnInitialRender` | `boolean`            | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's  bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's  bottom line when hovering.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.14.0-canary.f50f48ef.0","_nodeVersion":"10.19.0","_npmVersion":"lerna/3.20.2/node@v10.19.0+x64 (linux)","dist":{"integrity":"sha512-kS2nayqCWuGLGEjtLOy2ZdKvGJaXAx3xUlcn0uFRTdxA2LEHTBRoL/ZBvLuUmDcwtYiHSAu8KsAxJnHMHurbUg==","shasum":"ab5d156d19060a6710f43f6eb2744dd281780d62","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.14.0-canary.f50f48ef.0.tgz","fileCount":20,"unpackedSize":254624,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJec8AZCRA9TVsSAnZWagAAbxIP/3uU9ogXWWKM4hvkPkPJ\nNJOcWUewaMf102Ztgsh2vcfJTSC1jbsQtt1euS7Li9dHHF/hYIHPRPK+uStw\nD3enjgjzOGLBaD7CETO7vs9/W3eRMS3lTDezjZ8BXVcgjM3vk2L3jch4t5aX\nxZOXZwh1aTBird6qKtg7FYUeakzHnQvO9AzODlsw+2I1ElPQvTr1/+GO11Jm\nbibAGvqOoOWt/kE3c9hBeq0BH2qrtd8W3tvJCJ6u5G5ktH65Ia3AHL+bMphb\n3pdyZEjsXtHF4Q0TqlHCyqznacdpmFrIguBwjN3JemDcOU9AhEHVoIbINbQM\npZ96xbElLbKhtFHz9gsPJm3g7r55TQ6ziOxLbnJLksJaa18Wyp5L6Ga3ThkY\n6GmMtvV2V9j/xxdc1RJusalM4RHmohFP8RqZ7/bQ/9gvWXNFqMPU7jaWYbkI\nlAA69zRIY9ibcs30n3sIeO/z6phjqYBq8N+/E4dmhkeYC0SihkrTtoBilZ4z\noPqENPj1FnotLXOhQE/9hv1ZxcnqqrBFV9PgaGWahKW+avgdHV8RDez5G5VV\nxVwrrfWIjuqqSoyAVPZauFXbdr5sUTZi0g2a4Ng0d49HQGCpodUVIqjuCZvw\nDuE1lrtiZOPrhMpBySx9NGDB+Yv9KSEqrbWcKENnvFjeKWW/TrLDajlf92tR\n/fGZ\r\n=E/aF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGJ5Vx/Nib9IrV8aSTf7lmsttf/fUFJCZARjMiFabFYyAiEAjaVFPbVqU7b3vDLI1ZxtlZN/ZERJlPtU5xRfTMaqHUs="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.14.0-canary.f50f48ef.0_1584644121351_0.509242423527877"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.14.0-canary.134cf877.0":{"name":"@material/mwc-textfield","version":"0.14.0-canary.134cf877.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.a88c8e4dc.0","@material/line-ripple":"=6.0.0-canary.a88c8e4dc.0","@material/mwc-base":"0.14.0-canary.134cf877.0","@material/mwc-floating-label":"0.14.0-canary.134cf877.0","@material/mwc-icon":"0.14.0-canary.134cf877.0","@material/mwc-line-ripple":"0.14.0-canary.134cf877.0","@material/mwc-notched-outline":"0.14.0-canary.134cf877.0","@material/shape":"=6.0.0-canary.a88c8e4dc.0","@material/textfield":"=6.0.0-canary.a88c8e4dc.0","@material/theme":"=6.0.0-canary.a88c8e4dc.0","lit-element":"^2.2.1","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"c237581285beb5a84c39a5ea15dc95e9a865e057","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c237581285beb5a84c39a5ea15dc95e9a865e057/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c237581285beb5a84c39a5ea15dc95e9a865e057/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c237581285beb5a84c39a5ea15dc95e9a865e057/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c237581285beb5a84c39a5ea15dc95e9a865e057/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c237581285beb5a84c39a5ea15dc95e9a865e057/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c237581285beb5a84c39a5ea15dc95e9a865e057/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c237581285beb5a84c39a5ea15dc95e9a865e057/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c237581285beb5a84c39a5ea15dc95e9a865e057/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c237581285beb5a84c39a5ea15dc95e9a865e057/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c237581285beb5a84c39a5ea15dc95e9a865e057/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c237581285beb5a84c39a5ea15dc95e9a865e057/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\n| Name                | Type             | Description\n| ------------------- | ---------------- |------------\n| `value`             | `string`         | The input control's value.\n| `type`              | `TextFieldType*` | A string specifying the type of control to render.\n| `label`             | `string`         | Sets floating label value.\n| `placeholder`       | `string`         | Sets disappearing input placeholder.\n| `icon`              | `string`         | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `iconTrailing`      | `string`         | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `disabled`          | `boolean`        | Whether or not the input should be disabled.\n| `charCounter`       | `boolean`        | **Note: requries `maxLength` to be set.** Display character counter with max length.\n| `outlined`          | `boolean`        | Whether or not to show the material outlined variant.\n| `fullwidth`         | `boolean`        | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n| `helper`            | `string`         | Helper text to display below the input. Display default only when focused.\n| `helperPersistent`  | `boolean`        | Always show the helper text despite focus.\n| `required`          | `boolean`        | Displays error state if value is empty and input is blurred.\n| `maxLength`         | `number`         | Maximum length to accept input.\n| `validationMessage` | `string`         | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n| `pattern`           | `string`         | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `min`               | `number`\\|`string`  | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `max`               | `number`\\|`string`  | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `step`              | `number`\\|`null`    | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n| `autoValidate`      | `boolean`           | Reports validity on input rather than only on blur.\n| `validity`          | `ValidityState` (readonly) | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n| `willValidate`      | `boolean` (readonly)       | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n| `validityTransform` | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n| `validateOnInitialRender` | `boolean`            | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's  bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's  bottom line when hovering.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.14.0-canary.134cf877.0","_nodeVersion":"10.19.0","_npmVersion":"lerna/3.20.2/node@v10.19.0+x64 (linux)","dist":{"integrity":"sha512-mqGxmBlUBpKIcoSPuGor2r3IX+AmceZm9BpAJIIl9J/WXnWJrwy9ERYOc4ECbeuikfdDh7N6nd1DmaoEwdpPRg==","shasum":"8fd575d313d9d168de8c27b3d3abf22f113b99cd","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.14.0-canary.134cf877.0.tgz","fileCount":20,"unpackedSize":254624,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJec9h1CRA9TVsSAnZWagAAVCAQAI494/u0Lkj4YaeNAd85\nC3XuvuvsBESt72mJuX35PVCQvOMn+B1dvDYOrGnQBAZCs53T6TZSdTIjj1WB\nU+S0BPdeL3EgbUVXXphkm14nLGvTM8M1ZqDuiDQ9tuP9jFkSdurLmZUpliRz\n2ISfLlVRIUsN4C6p7TGAFGJtgOLngXwzjTPPf7OKpMZ1pQo6r1WJ/h2C5dTZ\nxqTQJJwXL29NkOgYSgHhG9yBbgwCy47mzs+ZA18+RkJ7fl1LsdGNRzjqp9gO\nG+JdJwmSLGpg3sBO/83wBdZGfQEDNCZ/v9rnGAejWt0Wgoe6dwRlkmdKOTI7\n8ia9jtvXoKmAoobeW4N94TQnOYvvGQ1cuRH9c0hQoYuN7E+SMI+8na4EuZP/\nudXZ2IBEUTUMht1+LweoGgRLZlZRurtqQ7nQT2/+s13Qrzs5H9sxssMnOOMu\n9QZ0khUyU9LJU67/HzNEHJweJ7UbBDJzmrCjoE2LSBVvPcRulg3viRfIr8Sm\n0aLVNxyAP2XF9zZrA/hEY6GSdRbww27/NxL6ymWsdx9DioIFl+j0Z+j1VdgC\ncJMx5Gd1XPE1gt5sbaMyfdeToqMz8dDQzEtw9nRYvk7oJjZTXaUC7JNarg/G\nqim+Xl/v8GLltRXiJV5snC3CDavB7Hl3ZLuQZ/cmEGb7P9wKtO8JocunYerY\ns9BJ\r\n=MkBF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC8uzt0CsvRG3ZGMt51pDbtVciB9xJwU3R1XYW/OvWqswIhAM0jPbWIPt5ZIGQ81NWnzdmero4x0GudXUl6k3cNCo26"}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.14.0-canary.134cf877.0_1584650356914_0.6501369438831497"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.14.0":{"name":"@material/mwc-textfield","version":"0.14.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.a88c8e4dc.0","@material/line-ripple":"=6.0.0-canary.a88c8e4dc.0","@material/mwc-base":"^0.14.0","@material/mwc-floating-label":"^0.14.0","@material/mwc-icon":"^0.14.0","@material/mwc-line-ripple":"^0.14.0","@material/mwc-notched-outline":"^0.14.0","@material/shape":"=6.0.0-canary.a88c8e4dc.0","@material/textfield":"=6.0.0-canary.a88c8e4dc.0","@material/theme":"=6.0.0-canary.a88c8e4dc.0","lit-element":"^2.2.1","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"ac28113f4d46ab2f986ce0aade128eb66d3017c0","_id":"@material/mwc-textfield@0.14.0","_nodeVersion":"12.16.1","_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (darwin)","dist":{"integrity":"sha512-Pjk6P91QqohVyVwOIyvsswxfpFDI6PK9E+6IXPUIN0tNilzIuuHqnXS1GiF8wphknu2Hfwu+dUjRkecBWUpblw==","shasum":"98b599863d60218b9b0a7a32636af9ec0d9bc3cb","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.14.0.tgz","fileCount":20,"unpackedSize":254521,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJec+QFCRA9TVsSAnZWagAAAPsP/233VvjidGQxuAim/nXn\n0qs29kfY3/AXavEdW1YUTeQJ2EmcG7cGOrWnXtd8Cjfh4u0Kx7j9GZe8TRSS\n/Tjb9XLkvYY7BVcZjATahyypdwCKosEHB/gqkeLn62F5pZqUNvfBlxxv9KWb\nTm7fw+GgZQW03f0CRh0Rhmca2PlERyRYfNg7+5q90+2uPNLCRY00FjVkKwYZ\nsreDlqs6edzw3WEaLR8EYzOG0JrkpvQFFh8m8YsZNbcSgjsibZIYc5p/381z\nnoD10UDhGT5KtLq2a4S2CYxQf4GdAW6RpDG/KHtbstjnV7pImiuA0pDNK7aT\npW/9Ki5SYi94MW9APrh1gHwyF49J7nbEcg0FjbLoavbgvIo1aVImbwJhnOig\nlO3jdtWhTl+Gqr1EI4NQbW+lNEWcc9db9cupP20o6Od7svmtZ2bQSycxIUU7\neGnJTEVwOaszOwH/XeJII6PB1TrepYk6G2SJZ2g6VSvoqe2DXrwhqWnQEDip\nUW8ETH55a4aewvhkDcsj3r4EyVBeOQtSzsuWLOd9RB1NcX5M5yrSYCQCNb60\ntGwF5m2nyXQ71T9tvGJDw36mXUKaFD0x29z6itew4MzeZht7pyL4jEd2qen9\n/yWGDcqtok4MZFETysU/DBpJoa55xftm3hgvaEaSKrg8/5NbJ9++JSIDSY0g\n8Vh3\r\n=Txnx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCdt3APv5Tn94+VjIE2ZQswRgtTcZM7k1HWEdITGkS5HAIgepDRZXwEQL5HljYmI1UWJrECPGbcQYDJXxZ9R/a54OI="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"azakus","email":"dfreedm2@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.14.0_1584653316912_0.7755058809809381"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.15.0-canary.2c1a4913.0":{"name":"@material/mwc-textfield","version":"0.15.0-canary.2c1a4913.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.a88c8e4dc.0","@material/line-ripple":"=6.0.0-canary.a88c8e4dc.0","@material/mwc-base":"0.15.0-canary.2c1a4913.0","@material/mwc-floating-label":"0.15.0-canary.2c1a4913.0","@material/mwc-icon":"0.15.0-canary.2c1a4913.0","@material/mwc-line-ripple":"0.15.0-canary.2c1a4913.0","@material/mwc-notched-outline":"0.15.0-canary.2c1a4913.0","@material/shape":"=6.0.0-canary.a88c8e4dc.0","@material/textfield":"=6.0.0-canary.a88c8e4dc.0","@material/theme":"=6.0.0-canary.a88c8e4dc.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"8d9a4fb2b0ac4979d966b16e203b2dd0f388554f","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8d9a4fb2b0ac4979d966b16e203b2dd0f388554f/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8d9a4fb2b0ac4979d966b16e203b2dd0f388554f/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8d9a4fb2b0ac4979d966b16e203b2dd0f388554f/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8d9a4fb2b0ac4979d966b16e203b2dd0f388554f/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8d9a4fb2b0ac4979d966b16e203b2dd0f388554f/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8d9a4fb2b0ac4979d966b16e203b2dd0f388554f/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8d9a4fb2b0ac4979d966b16e203b2dd0f388554f/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8d9a4fb2b0ac4979d966b16e203b2dd0f388554f/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8d9a4fb2b0ac4979d966b16e203b2dd0f388554f/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8d9a4fb2b0ac4979d966b16e203b2dd0f388554f/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8d9a4fb2b0ac4979d966b16e203b2dd0f388554f/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\n| Name                | Type             | Description\n| ------------------- | ---------------- |------------\n| `value`             | `string`         | The input control's value.\n| `type`              | `TextFieldType*` | A string specifying the type of control to render.\n| `label`             | `string`         | Sets floating label value.\n| `placeholder`       | `string`         | Sets disappearing input placeholder.\n| `icon`              | `string`         | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `iconTrailing`      | `string`         | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `disabled`          | `boolean`        | Whether or not the input should be disabled.\n| `charCounter`       | `boolean`        | **Note: requries `maxLength` to be set.** Display character counter with max length.\n| `outlined`          | `boolean`        | Whether or not to show the material outlined variant.\n| `fullwidth`         | `boolean`        | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n| `helper`            | `string`         | Helper text to display below the input. Display default only when focused.\n| `helperPersistent`  | `boolean`        | Always show the helper text despite focus.\n| `required`          | `boolean`        | Displays error state if value is empty and input is blurred.\n| `maxLength`         | `number`         | Maximum length to accept input.\n| `validationMessage` | `string`         | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n| `pattern`           | `string`         | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `min`               | `number`\\|`string`  | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `max`               | `number`\\|`string`  | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `step`              | `number`\\|`null`    | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n| `autoValidate`      | `boolean`           | Reports validity on input rather than only on blur.\n| `validity`          | `ValidityState` (readonly) | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n| `willValidate`      | `boolean` (readonly)       | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n| `validityTransform` | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n| `validateOnInitialRender` | `boolean`            | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's  bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's  bottom line when hovering.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.15.0-canary.2c1a4913.0","_nodeVersion":"10.19.0","_npmVersion":"lerna/3.20.2/node@v10.19.0+x64 (linux)","dist":{"integrity":"sha512-V/zYAX+UWrMMPsu1A4GZKg3YzkpRzspH5+BmomLmYTuPh4hjOPVoansaRfrVUyipYwd7vZrFUpofnmZJpe9z3w==","shasum":"9fd8ceacaee30aa3be343a26a299e8b9ceaa3997","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.15.0-canary.2c1a4913.0.tgz","fileCount":20,"unpackedSize":254624,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJec/mmCRA9TVsSAnZWagAACbcP+wZKloTnvlAEsrOgkS+B\nXcSevRsqpeLQfpNRSpvAD4fJvPVjjqT8dJeQ5v09KY5OXpivmMUEs0AenNEd\nRlWdKQ3LcXsvkDVq06KeHZiU+sT6GO2p8ILgwpE1ILuXqgKN/pzAIvq8NAO6\n6ZRnE2Mi6UGKX84Eb/bACMUIIKd+A/khPTDEHqZTtryKaxglTrNafw6aN7Lf\nSYFwE38LMVdKTW7VEPGdrQj41ehgP8K625XQlnRMPHsOuMCc1haRhdNKTJoZ\nrYcjrKiQ1ecijLWV4KKZdq1kIL/DylOd8g1UD8fdbrKw/g/+8gHSm7/VXl82\ns9XKdmlHXjeiFoMactGqTjPzWOGtIU0cp+CbVGLS2NSJ8UHPf6aTRJrrdG5a\nhKJBvWANnfl2Ju0RJ8Pyb2lImGjTy/J1m86ubGXa0FdmOOjPQJc8enND6vrQ\ny4D+lT+apX7Ibo1O6Gqc1GBce9csDZ0H4PbIpnD7HyGvi/Vmnq9k1oiqywcQ\neAVq2afvMZFYajI9GGm+6+7qqmKCudcgyKkHtB4RJcyJ4xWvXPIsS0ZMI5we\nrVGdGBGWijmFB3bqH7CJP+V+pH/v51cXS8+sqDTe7I9yhfWim1ZTXqTKQD8w\nypE0YiyzJM+ChKuQbUelyn/Nhq9ZNMcbkoujLcg4wzs/5DLyw9wqpAI2Jy/o\nCOGf\r\n=u7Al\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFMMIvjU0GG9jRWOZkB53/eej6O+YIoHt3WlAs46MnMSAiAvZk+EjwdWWGer1Y6LhUPgy3c6002ZB35FiB9jSS2Fvw=="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.15.0-canary.2c1a4913.0_1584658854397_0.8227856502040656"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.15.0-canary.3a6e481a.0":{"name":"@material/mwc-textfield","version":"0.15.0-canary.3a6e481a.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.cafe18860.0","@material/line-ripple":"=6.0.0-canary.cafe18860.0","@material/mwc-base":"0.15.0-canary.3a6e481a.0","@material/mwc-floating-label":"0.15.0-canary.3a6e481a.0","@material/mwc-icon":"0.15.0-canary.3a6e481a.0","@material/mwc-line-ripple":"0.15.0-canary.3a6e481a.0","@material/mwc-notched-outline":"0.15.0-canary.3a6e481a.0","@material/shape":"=6.0.0-canary.cafe18860.0","@material/textfield":"=6.0.0-canary.cafe18860.0","@material/theme":"=6.0.0-canary.cafe18860.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"0d89a3406dea7d2d2540aaeb339072cc01d18e2a","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0d89a3406dea7d2d2540aaeb339072cc01d18e2a/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0d89a3406dea7d2d2540aaeb339072cc01d18e2a/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0d89a3406dea7d2d2540aaeb339072cc01d18e2a/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0d89a3406dea7d2d2540aaeb339072cc01d18e2a/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0d89a3406dea7d2d2540aaeb339072cc01d18e2a/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0d89a3406dea7d2d2540aaeb339072cc01d18e2a/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0d89a3406dea7d2d2540aaeb339072cc01d18e2a/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0d89a3406dea7d2d2540aaeb339072cc01d18e2a/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0d89a3406dea7d2d2540aaeb339072cc01d18e2a/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0d89a3406dea7d2d2540aaeb339072cc01d18e2a/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0d89a3406dea7d2d2540aaeb339072cc01d18e2a/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\n| Name                | Type             | Description\n| ------------------- | ---------------- |------------\n| `value`             | `string`         | The input control's value.\n| `type`              | `TextFieldType*` | A string specifying the type of control to render.\n| `label`             | `string`         | Sets floating label value.\n| `placeholder`       | `string`         | Sets disappearing input placeholder.\n| `icon`              | `string`         | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `iconTrailing`      | `string`         | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `disabled`          | `boolean`        | Whether or not the input should be disabled.\n| `charCounter`       | `boolean`        | **Note: requries `maxLength` to be set.** Display character counter with max length.\n| `outlined`          | `boolean`        | Whether or not to show the material outlined variant.\n| `fullwidth`         | `boolean`        | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n| `helper`            | `string`         | Helper text to display below the input. Display default only when focused.\n| `helperPersistent`  | `boolean`        | Always show the helper text despite focus.\n| `required`          | `boolean`        | Displays error state if value is empty and input is blurred.\n| `maxLength`         | `number`         | Maximum length to accept input.\n| `validationMessage` | `string`         | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n| `pattern`           | `string`         | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `min`               | `number`\\|`string`  | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `max`               | `number`\\|`string`  | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `step`              | `number`\\|`null`    | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n| `autoValidate`      | `boolean`           | Reports validity on input rather than only on blur.\n| `validity`          | `ValidityState` (readonly) | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n| `willValidate`      | `boolean` (readonly)       | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n| `validityTransform` | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n| `validateOnInitialRender` | `boolean`            | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's  bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's  bottom line when hovering.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.15.0-canary.3a6e481a.0","_nodeVersion":"10.19.0","_npmVersion":"lerna/3.20.2/node@v10.19.0+x64 (linux)","dist":{"integrity":"sha512-FD7LauH9I6ku5ZczUY2qDjUkmEBfNR/615ba0k/nk8Vi8Goh8znYClbCZG+/H4WL/bFndhs15DeNajt1IQ7p2g==","shasum":"12f7edb09b5d3afc8a2c63abc2166373b9d57fcb","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.15.0-canary.3a6e481a.0.tgz","fileCount":20,"unpackedSize":254624,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJedQe3CRA9TVsSAnZWagAAjGgP/RO4b0dbOQHuBawKwvHD\nES2xOuNtqAQ4Am/e4FcMP4UnSQeN3JZTT+XYY202eCGrvUAapZXTQ3oR/7KJ\npqUFji2ng0h+iEaoCiSfIpn1liNfHivVIizQrdGSJf/gNTfU/wRZBIaQomv5\nPG+XXv0Uhkg4IpNjs4ZO8ulcDVBlNlVrgKJSWhzIKCe8aWGDxHi7IThqB1pw\naCQ9NGzKkxL1wzURu58muUnZf9TWVnEUp3YPx0o4z+KM2bQT35vNdiSap8UX\nNHgZc3euongj8qhYkCm308H41gGKQF2GEOv+JydMi7M9a5QzZDwPXTqfVzTn\nVXkQ3bTMwKGFMyQNrcY0LWhTAB7FpUJfxIabnxq4KceGdKOX0cZLa2b1IePM\nT8AEP0wBmFwDjVP+SOsLxjjYgAmEe00WiVKLvWgB9xXLtfYbCacvgFYGt4uh\nhU6Wucs5IkXpe01iDnlZWKZ5k0lHo4OpZAmJGnMVpcDxjM22zHL7etq2wJpr\nmMsu7NdcEztUacHW3KR+nk34lXUhJOQ7YfQ1SYR2Q2Ou1xgcANDNw+dH7Mzj\n11F71+8MS5CAZSvxbQuYcIvlA/0fgeOzIG4VsHensVqjo58xGlkJNKUQKvnp\nMNe6VX0Oss4ECis4YiWZE9cQ1E0vKwwGzcQRMIXfzY2qLY5NdfiZTaL9DTe5\nPFX/\r\n=MZe3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBFZJ28tmZnhmEN5L1jG8T+HP8coZqc2CavskzVuC9uXAiBWHRkc1FVwjRNkedQlhWvwNx67uE0L0cpItcbMvmWIQQ=="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.15.0-canary.3a6e481a.0_1584727990942_0.10777192145808923"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.15.0-canary.603d6eb3.0":{"name":"@material/mwc-textfield","version":"0.15.0-canary.603d6eb3.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.35a32aaea.0","@material/line-ripple":"=6.0.0-canary.35a32aaea.0","@material/mwc-base":"0.15.0-canary.603d6eb3.0","@material/mwc-floating-label":"0.15.0-canary.603d6eb3.0","@material/mwc-icon":"0.15.0-canary.603d6eb3.0","@material/mwc-line-ripple":"0.15.0-canary.603d6eb3.0","@material/mwc-notched-outline":"0.15.0-canary.603d6eb3.0","@material/shape":"=6.0.0-canary.35a32aaea.0","@material/textfield":"=6.0.0-canary.35a32aaea.0","@material/theme":"=6.0.0-canary.35a32aaea.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"c12dabbae50536d5adf2b5a785d4a5009e53208f","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c12dabbae50536d5adf2b5a785d4a5009e53208f/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c12dabbae50536d5adf2b5a785d4a5009e53208f/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c12dabbae50536d5adf2b5a785d4a5009e53208f/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c12dabbae50536d5adf2b5a785d4a5009e53208f/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c12dabbae50536d5adf2b5a785d4a5009e53208f/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c12dabbae50536d5adf2b5a785d4a5009e53208f/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c12dabbae50536d5adf2b5a785d4a5009e53208f/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c12dabbae50536d5adf2b5a785d4a5009e53208f/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c12dabbae50536d5adf2b5a785d4a5009e53208f/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c12dabbae50536d5adf2b5a785d4a5009e53208f/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c12dabbae50536d5adf2b5a785d4a5009e53208f/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\n| Name                | Type             | Description\n| ------------------- | ---------------- |------------\n| `value`             | `string`         | The input control's value.\n| `type`              | `TextFieldType*` | A string specifying the type of control to render.\n| `label`             | `string`         | Sets floating label value.\n| `placeholder`       | `string`         | Sets disappearing input placeholder.\n| `icon`              | `string`         | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `iconTrailing`      | `string`         | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `disabled`          | `boolean`        | Whether or not the input should be disabled.\n| `charCounter`       | `boolean`        | **Note: requries `maxLength` to be set.** Display character counter with max length.\n| `outlined`          | `boolean`        | Whether or not to show the material outlined variant.\n| `fullwidth`         | `boolean`        | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n| `helper`            | `string`         | Helper text to display below the input. Display default only when focused.\n| `helperPersistent`  | `boolean`        | Always show the helper text despite focus.\n| `required`          | `boolean`        | Displays error state if value is empty and input is blurred.\n| `maxLength`         | `number`         | Maximum length to accept input.\n| `validationMessage` | `string`         | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n| `pattern`           | `string`         | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `min`               | `number`\\|`string`  | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `max`               | `number`\\|`string`  | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `step`              | `number`\\|`null`    | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n| `autoValidate`      | `boolean`           | Reports validity on input rather than only on blur.\n| `validity`          | `ValidityState` (readonly) | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n| `willValidate`      | `boolean` (readonly)       | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n| `validityTransform` | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n| `validateOnInitialRender` | `boolean`            | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's  bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's  bottom line when hovering.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.15.0-canary.603d6eb3.0","_nodeVersion":"10.19.0","_npmVersion":"lerna/3.20.2/node@v10.19.0+x64 (linux)","dist":{"integrity":"sha512-XM9vyr41as0tFJQXX+G6UoO1V4R+gOVGESVgGqoXZ37MxegfBr8iIFcnpB+ZUHYakWnQ/5keollP4iH+vMXCcw==","shasum":"e6119963efaf51b8b4a9f4f1b1166b23d80494a4","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.15.0-canary.603d6eb3.0.tgz","fileCount":20,"unpackedSize":254624,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJedTc4CRA9TVsSAnZWagAA9zIP/1XVWVFdNn5gNLGQRrdJ\ni+l1wvXZmkueio5DfrfSGuD2qlV+KEkllqWCdIQlKVkpYrt+RUA13tr6lEmt\nk+tQ1SBdxXfrBX2TzuS4VPt0CQxa3/LvTOen0rPa/PzIg0vNtGV73W1cVQ9v\nYm2SDjOIkWT5mk5WBKGcAImH0LFjcDWnpJ/pfnGWVxiOSBRfwwmuMqJ4qsrd\nKpTezkHHlt46y04Slb7BrUGZjVVhng5vnHh1YIic6Xq3J4Kza/toxuv7m2hT\nXVEIUntYOiAXhFZPY40z26RZsiKLN8xuNUNE/P+lS0bkO1ZOu+xwNTq9HGVF\nvhkCGS+xvtrV84EceBrjT/+YsYW+8wIK8GsTpxXKEwbEli9kjsUC7oY7Vd/R\nZ5blacTzjkUoIb9HwhC31xurBhCjTZtqNLjEGIo1097wJK/vUfrRphSHacuy\nuFAsAOr4SdmPBXx2ggOhmJ0dj/30kcdHtpVWz2NFBfjBDe4ddUE3x13XxvVp\nuh/ox46iN96Mv53pXBGo63fcYoTGlBKSQNfyfR0A6WhYgCwOgMQ0thw7a+RT\nrOQsUp0ruavIzoUK58dy6FOGCTOiWjJdjGK4geSon+jLM1MwGyv/aBMSRXj/\nZGu4TuGmiXjqTzp47jCOZZUlF2nILAzbMcPxhgJvSHhVSWqLamMYjl+ISZos\nKQ+e\r\n=DESo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEkCDgUrlBKlHy9CO96rKZyPEn31loFCBZCvga56+YzSAiBuX/kOqgJJv0QMQ1crxPkJnxcCXQ7PA8ljegdYVbNr0A=="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.15.0-canary.603d6eb3.0_1584740151661_0.3056460229453315"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.15.0-canary.05c6a93c.0":{"name":"@material/mwc-textfield","version":"0.15.0-canary.05c6a93c.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.35a32aaea.0","@material/line-ripple":"=6.0.0-canary.35a32aaea.0","@material/mwc-base":"0.15.0-canary.05c6a93c.0","@material/mwc-floating-label":"0.15.0-canary.05c6a93c.0","@material/mwc-icon":"0.15.0-canary.05c6a93c.0","@material/mwc-line-ripple":"0.15.0-canary.05c6a93c.0","@material/mwc-notched-outline":"0.15.0-canary.05c6a93c.0","@material/shape":"=6.0.0-canary.35a32aaea.0","@material/textfield":"=6.0.0-canary.35a32aaea.0","@material/theme":"=6.0.0-canary.35a32aaea.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"62ce85b6b0e7c20ae9938ba7b42af970a40f1f00","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/62ce85b6b0e7c20ae9938ba7b42af970a40f1f00/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/62ce85b6b0e7c20ae9938ba7b42af970a40f1f00/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/62ce85b6b0e7c20ae9938ba7b42af970a40f1f00/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/62ce85b6b0e7c20ae9938ba7b42af970a40f1f00/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/62ce85b6b0e7c20ae9938ba7b42af970a40f1f00/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/62ce85b6b0e7c20ae9938ba7b42af970a40f1f00/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/62ce85b6b0e7c20ae9938ba7b42af970a40f1f00/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/62ce85b6b0e7c20ae9938ba7b42af970a40f1f00/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/62ce85b6b0e7c20ae9938ba7b42af970a40f1f00/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/62ce85b6b0e7c20ae9938ba7b42af970a40f1f00/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/62ce85b6b0e7c20ae9938ba7b42af970a40f1f00/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\n| Name                | Type             | Description\n| ------------------- | ---------------- |------------\n| `value`             | `string`         | The input control's value.\n| `type`              | `TextFieldType*` | A string specifying the type of control to render.\n| `label`             | `string`         | Sets floating label value.\n| `placeholder`       | `string`         | Sets disappearing input placeholder.\n| `icon`              | `string`         | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `iconTrailing`      | `string`         | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `disabled`          | `boolean`        | Whether or not the input should be disabled.\n| `charCounter`       | `boolean`        | **Note: requries `maxLength` to be set.** Display character counter with max length.\n| `outlined`          | `boolean`        | Whether or not to show the material outlined variant.\n| `fullwidth`         | `boolean`        | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n| `helper`            | `string`         | Helper text to display below the input. Display default only when focused.\n| `helperPersistent`  | `boolean`        | Always show the helper text despite focus.\n| `required`          | `boolean`        | Displays error state if value is empty and input is blurred.\n| `maxLength`         | `number`         | Maximum length to accept input.\n| `validationMessage` | `string`         | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n| `pattern`           | `string`         | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `min`               | `number`\\|`string`  | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `max`               | `number`\\|`string`  | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `step`              | `number`\\|`null`    | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n| `autoValidate`      | `boolean`           | Reports validity on input rather than only on blur.\n| `validity`          | `ValidityState` (readonly) | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n| `willValidate`      | `boolean` (readonly)       | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n| `validityTransform` | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n| `validateOnInitialRender` | `boolean`            | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's  bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's  bottom line when hovering.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.15.0-canary.05c6a93c.0","_nodeVersion":"10.19.0","_npmVersion":"lerna/3.20.2/node@v10.19.0+x64 (linux)","dist":{"integrity":"sha512-xZTi+gcLwT1IZYLc+2J4oCoaIRXGw7HDXOD97TR2o73c1PhNGdDGJt2bSGUxuHbNcmkWuW61L2tmX9UjVDgbsw==","shasum":"f9adeb3b798648b58cdbea057ae55b508f1fdd44","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.15.0-canary.05c6a93c.0.tgz","fileCount":20,"unpackedSize":254624,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeeOWNCRA9TVsSAnZWagAAbfUQAJS9sjaffU9w3BKlvmtW\nnfVcX8pIeIQr2JBMgPIxvsZOuN19Uu7VRXY4bm7bbJaAXKd7T+dtTyqI/8KF\nNxnLL8LgIlV2u9isF5svXgD/01CtYAuFisCNy3BGNlyN14545isz95tiIdrR\n1CzLvKVace+rrnxi0q2aJmSHMWAc4FeNDNh7NWaxNvIz7XflAcRDFroNrJ1I\n0s+iu5e50Ch/53nCo/SF0dbPaOgtV6KP5YuRZqK7piOciYrWcfnSPWHDfSMj\nDA6S03b5pb0JfxSE9jg5MeCAdJKKly/9prYa8P0UOA9f05h3Bg7Kq0/BqFox\nI5hW4Dz4I/AdxTdgN6opsHUaegqTmMuIAevVz2iXVv4meNER/oamM+tjfW0I\nC+31se73+LynrqCSYM7HP6VFUMRkW4UkqEmmPPQB/VZpOacXvI9/BDqWESRi\nQrXr6bKiUrCG6jqRKoo48rxWce6dMKJai0ns48h7PYsQ9tXnglf+9fwSrWNN\nDsHBKqD2KS7/vZ+WhZ4BktKwCIUr0GXLgRd8hq2s5wxQbd1J4lyMwrkVSZhG\nY9DrDlbkhRJFKgc6s3H1RvsCfc1kRtqN9hbjfMJINMYe2/m+kfY0mru3XBfq\ntEVJyvbfFJbNyQJ9VZrZ4bAga0W4ctz81Biuh8jgsp2meeacsJrkyBntKp2v\nomiL\r\n=lwTr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEHSetscjKTjk9CUf2V6NRp/y5iuMs7PHp1ztQjCZOjvAiEAs0i+5Ax/TbqPl4MF85ypk2zOzk8K4WC8uiQePUp+4oM="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.15.0-canary.05c6a93c.0_1584981389132_0.9529874667775251"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.14.1":{"name":"@material/mwc-textfield","version":"0.14.1","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.35a32aaea.0","@material/line-ripple":"=6.0.0-canary.35a32aaea.0","@material/mwc-base":"^0.14.1","@material/mwc-floating-label":"^0.14.1","@material/mwc-icon":"^0.14.1","@material/mwc-line-ripple":"^0.14.1","@material/mwc-notched-outline":"^0.14.1","@material/shape":"=6.0.0-canary.35a32aaea.0","@material/textfield":"=6.0.0-canary.35a32aaea.0","@material/theme":"=6.0.0-canary.35a32aaea.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"b0de4ae05c3088b277f5c20ed01e4d684cc6b8b1","_id":"@material/mwc-textfield@0.14.1","_nodeVersion":"13.8.0","_npmVersion":"lerna/3.20.2/node@v13.8.0+x64 (darwin)","dist":{"integrity":"sha512-1rZY+L0NSF5gdurqX7UXSpEVrbmfwjfSmi6ckhJZ4A6wpQ1dTfhuin2dUL6iAweX2nLNHXQIChCdjcIeOJMlqA==","shasum":"05214158f780785c88e7d7649ebf99b524eca733","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.14.1.tgz","fileCount":23,"unpackedSize":258569,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeePiUCRA9TVsSAnZWagAAfSEP/2Tf++gtB5ItYAqqS+H8\n6eVDOpy4WBGThwmaqd25yMIrEsdxjIilP+xj/wALC/11E8Q4QEBOM+DY+f/h\nmPvg+w6e9rg0F6SIGYhDdu6eFf/4RJGOR1xxXyxWrUnd0stnMS8hENCxOJyD\n4QvxvZBMD0m+NEBQ5SrWMNlxYm2+Y6QBV9Wc4d5H8XjLnHrx6dVE3XS2mbQa\nY1pZCuq534fp1gP+jITGGXXQ6crBF9j/ZrKhHTlJr2cpVy6MaW6ogm3kRytg\nT7NEiTDTUdwoJF3NSwt9Fo3UPbKxX63baPqmhlNGESXROxpmgHmP3MD6Pxif\nCvN4ZaIW3WOsrEoDfMbpswy1cH145k1rl+RGzkzIJz208iCGrnVC6g9GkoLc\nCLRf8c6ocEVaWetG2wySzbDdC3760tLmS1KAfEy02bjIAHmB0v11VxZ+zF+W\n3gtCFavCjSpIGEXLcWWs/NNejFUnWaKFWzVj8V1M2A/8AMpuREwSKhVBIVN4\n1LPKgVWInIItcivgBXknKWFwDv+wNxFwV0hw+6JTZxErlFi/bYltLNp5h686\nb9jIeXV1LujblClbQVw8/7LpFhMdLavauqW/9KU3BB5tUv/ZeI/RKMM0dasS\nsYY4krkSpmu60I79aCcpKcRDMk99ZlQ9SSUzQ4tuJDIpLB1OaJhD6HTf1V4S\nAE9V\r\n=fkod\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDrs7YdQH6S2AGBTWxVNDb3sem9dwWKy5PhPWR+y6SO/AiA9iwEF4CAr8FgTQLSbYy2Z9QT52rUc4N/0y649jxhWsQ=="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"emarquez","email":"emarquez@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.14.1_1584986260181_0.8871830204377218"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.15.0-canary.4e6be3f4.0":{"name":"@material/mwc-textfield","version":"0.15.0-canary.4e6be3f4.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.35a32aaea.0","@material/line-ripple":"=6.0.0-canary.35a32aaea.0","@material/mwc-base":"0.15.0-canary.4e6be3f4.0","@material/mwc-floating-label":"^0.14.1","@material/mwc-icon":"0.15.0-canary.4e6be3f4.0","@material/mwc-line-ripple":"^0.14.1","@material/mwc-notched-outline":"0.15.0-canary.4e6be3f4.0","@material/shape":"=6.0.0-canary.35a32aaea.0","@material/textfield":"=6.0.0-canary.35a32aaea.0","@material/theme":"=6.0.0-canary.35a32aaea.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"1512aaf308db7992eea7201d4af81bf1e616d5d8","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1512aaf308db7992eea7201d4af81bf1e616d5d8/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1512aaf308db7992eea7201d4af81bf1e616d5d8/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1512aaf308db7992eea7201d4af81bf1e616d5d8/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1512aaf308db7992eea7201d4af81bf1e616d5d8/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1512aaf308db7992eea7201d4af81bf1e616d5d8/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1512aaf308db7992eea7201d4af81bf1e616d5d8/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1512aaf308db7992eea7201d4af81bf1e616d5d8/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1512aaf308db7992eea7201d4af81bf1e616d5d8/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1512aaf308db7992eea7201d4af81bf1e616d5d8/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1512aaf308db7992eea7201d4af81bf1e616d5d8/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1512aaf308db7992eea7201d4af81bf1e616d5d8/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\n| Name                | Type             | Description\n| ------------------- | ---------------- |------------\n| `value`             | `string`         | The input control's value.\n| `type`              | `TextFieldType*` | A string specifying the type of control to render.\n| `label`             | `string`         | Sets floating label value.\n| `placeholder`       | `string`         | Sets disappearing input placeholder.\n| `icon`              | `string`         | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `iconTrailing`      | `string`         | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `disabled`          | `boolean`        | Whether or not the input should be disabled.\n| `charCounter`       | `boolean`        | **Note: requries `maxLength` to be set.** Display character counter with max length.\n| `outlined`          | `boolean`        | Whether or not to show the material outlined variant.\n| `fullwidth`         | `boolean`        | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n| `helper`            | `string`         | Helper text to display below the input. Display default only when focused.\n| `helperPersistent`  | `boolean`        | Always show the helper text despite focus.\n| `required`          | `boolean`        | Displays error state if value is empty and input is blurred.\n| `maxLength`         | `number`         | Maximum length to accept input.\n| `validationMessage` | `string`         | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n| `pattern`           | `string`         | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `min`               | `number`\\|`string`  | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `max`               | `number`\\|`string`  | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `step`              | `number`\\|`null`    | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n| `autoValidate`      | `boolean`           | Reports validity on input rather than only on blur.\n| `validity`          | `ValidityState` (readonly) | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n| `willValidate`      | `boolean` (readonly)       | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n| `validityTransform` | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n| `validateOnInitialRender` | `boolean`            | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's  bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's  bottom line when hovering.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.15.0-canary.4e6be3f4.0","_nodeVersion":"10.19.0","_npmVersion":"lerna/3.20.2/node@v10.19.0+x64 (linux)","dist":{"integrity":"sha512-6a9/MU4C+8YYwtRCbddEWoRyAI4GuJd92ACEtK+zAwdMS1kNDVq7grlTME048BttzJcnx03+P5RaVw2i4W2ILw==","shasum":"dc8ebec1088c47fe4334f8a738ebe76752a4d142","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.15.0-canary.4e6be3f4.0.tgz","fileCount":20,"unpackedSize":254590,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeenSJCRA9TVsSAnZWagAACDEP/1UjYOXy7O90MFTdfgss\nzHGiW8DudxOlYafeFYeCJ1yuVH/mvgPxORzwfTCp93JBguyavsiW/zm5cQA+\nIjvBZQRd2m/gu8ZyCAqG3mZbdIGbygpASGMTJv7KNjz1xu0eOktFpZSgrNDk\nJtlWqSrhJwn2vMZpKVue4IKk1pf3Ijc91z9WulLm/Q6k9vEn5SAgfGPkQgoE\nzwUS6r1NATESr9COLLvyKr9fv7rvWc4/vfyQAk7Q4u012sShQ+xrzn6VLRUA\nErKXVIK0Fxoi7IBGJPAZLinUfTbia61zfgUAz51fijFiYZUMn84YS4wXKQv8\nLdCEFQ+miyzWs/MTkCeZSSgSyNF74LBgcsNsk4G1o4JAnY4NTBOliBnTUWXP\n32LRI8omGGKZB/N3vBV06KNpmXVENT2b+d0xII5BxdGnzMgKZrvd/ztEDZNd\nKAMs/tYDQK5uuoCe53QWy7FjAdVaVEo20jCu5fi2WRUhw+i+QUFum8ZHZBJp\n4iHLH9i+gn9mHRGVSzo2E6io70jVpqxgIX/7/ERoZrzbGQjChgEx55afr5gN\ndGSVaO+fB4UEEbzKTg55R6Ii5y1M6ylqriqsP3l1OPgl2Z5p3AZOkkrygBjB\n7KcGfx8Hhwe8AhOKWK0XSrVnYhiKjXcvSyR3GMJ8HBW6EdJ/H1t8pwGOinlF\n0ZM6\r\n=UI6X\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH4IW7LdHXuDtMUMPlc9yDjNAPhn3PvVkYpkTq1hqccxAiBZXvqkL85x2xKeWKJMHMdplZZjN39iGZnLF1JQSGTzMA=="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.15.0-canary.4e6be3f4.0_1585083528886_0.8578777210647592"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.15.0-canary.c29a683d.0":{"name":"@material/mwc-textfield","version":"0.15.0-canary.c29a683d.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.8707953b6.0","@material/line-ripple":"=6.0.0-canary.8707953b6.0","@material/mwc-base":"0.15.0-canary.c29a683d.0","@material/mwc-floating-label":"0.15.0-canary.c29a683d.0","@material/mwc-icon":"0.15.0-canary.c29a683d.0","@material/mwc-line-ripple":"0.15.0-canary.c29a683d.0","@material/mwc-notched-outline":"0.15.0-canary.c29a683d.0","@material/shape":"=6.0.0-canary.8707953b6.0","@material/textfield":"=6.0.0-canary.8707953b6.0","@material/theme":"=6.0.0-canary.8707953b6.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"8425a605fcff9f0247ba649d1c8b16a70fe79720","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8425a605fcff9f0247ba649d1c8b16a70fe79720/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8425a605fcff9f0247ba649d1c8b16a70fe79720/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8425a605fcff9f0247ba649d1c8b16a70fe79720/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8425a605fcff9f0247ba649d1c8b16a70fe79720/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8425a605fcff9f0247ba649d1c8b16a70fe79720/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8425a605fcff9f0247ba649d1c8b16a70fe79720/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8425a605fcff9f0247ba649d1c8b16a70fe79720/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8425a605fcff9f0247ba649d1c8b16a70fe79720/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8425a605fcff9f0247ba649d1c8b16a70fe79720/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8425a605fcff9f0247ba649d1c8b16a70fe79720/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8425a605fcff9f0247ba649d1c8b16a70fe79720/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\n| Name                | Type             | Description\n| ------------------- | ---------------- |------------\n| `value`             | `string`         | The input control's value.\n| `type`              | `TextFieldType*` | A string specifying the type of control to render.\n| `label`             | `string`         | Sets floating label value.\n| `placeholder`       | `string`         | Sets disappearing input placeholder.\n| `icon`              | `string`         | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `iconTrailing`      | `string`         | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `disabled`          | `boolean`        | Whether or not the input should be disabled.\n| `charCounter`       | `boolean`        | **Note: requries `maxLength` to be set.** Display character counter with max length.\n| `outlined`          | `boolean`        | Whether or not to show the material outlined variant.\n| `fullwidth`         | `boolean`        | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n| `helper`            | `string`         | Helper text to display below the input. Display default only when focused.\n| `helperPersistent`  | `boolean`        | Always show the helper text despite focus.\n| `required`          | `boolean`        | Displays error state if value is empty and input is blurred.\n| `maxLength`         | `number`         | Maximum length to accept input.\n| `validationMessage` | `string`         | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n| `pattern`           | `string`         | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `min`               | `number`\\|`string`  | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `max`               | `number`\\|`string`  | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `step`              | `number`\\|`null`    | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n| `autoValidate`      | `boolean`           | Reports validity on input rather than only on blur.\n| `validity`          | `ValidityState` (readonly) | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n| `willValidate`      | `boolean` (readonly)       | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n| `validityTransform` | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n| `validateOnInitialRender` | `boolean`            | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's  bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's  bottom line when hovering.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.15.0-canary.c29a683d.0","_nodeVersion":"10.19.0","_npmVersion":"lerna/3.20.2/node@v10.19.0+x64 (linux)","dist":{"integrity":"sha512-WlfZ7TrFlyAwqlVsLt+I7lD00gxkFQrNYFQUDUnSWuClYZnHR5METCtV9RxS3HWlsftj/SP6B0VecxE4CwUc/w==","shasum":"97fc0e19b625f092c935ff8072e0e55c9e283861","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.15.0-canary.c29a683d.0.tgz","fileCount":20,"unpackedSize":254624,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeenizCRA9TVsSAnZWagAAZIwQAJZox7fmVO2Jq2Dm3pn9\nO03ygVXE5RJzrFpfsqblErUgTJpifDuQ8S9wvafZPv2Hgv2nStKvW56fXy1b\nwFFmVOSw0NYWb8C9nzpD620Hv5wbpbXENv2PCTA7jIZO5en4v83IpwbB3B/f\nNeHmbBPEAcY9TAu5sdjCovBE26kjZTwumhDr2xmVUXJy/yFRnpvKloKuyu4g\ncqpW+biBSg+wkfRNBxAd2BF+pXltUxat9pi6rO48+JhldiAjhpq8hKY4Jd0w\n8XYs2xKUQSMWjEuYKZ/uejtD+R2NpZpcp/2xARsDB3igLl3j4QTMbw4cdgeK\nbs3c+6QCitq0ygyFTxmH5HkJJtDvhkW0IDSR4lRIsUl//hSZpNd1KJ9S9tyI\nzTJkPHvfxtFax8JzCM7e0PKSkQStLlety6yoGwxBvE15CDnA/fzezbpghPf1\nyPPveB/5W7UnEuSEcuz+6sLo/odfPyCoglAYRVA8w9tIqC7X9IA3mBnlO+/A\nAFXcXFCrOhhS3YBZsnbwfNiyUikpqihqa4RRVM4se/fH59M+R38W5Iumgww1\n/INksvfCN9S1aVs3CTOlvXnhoAb7A3Q/zA0mJUN2OV0n+VsJ50FIm4K2NWb9\nbGDOFlUwyAflGTmvtD7TYEXyVHB9ZchOZbM+0HshmWV6D6huHTRGmD8WG+Ux\ntewv\r\n=v8eR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBs4tS5cBIE8PUlHnQTQtR8ZcU50pvoWvRbpgO09ZR/yAiEA81qH8nAnHOqBOI/gcfLlOtNpCQjU9a0VNDowFLbESTc="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.15.0-canary.c29a683d.0_1585084594978_0.017682055904800542"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.15.0-canary.fca3dd9d.0":{"name":"@material/mwc-textfield","version":"0.15.0-canary.fca3dd9d.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.8707953b6.0","@material/line-ripple":"=6.0.0-canary.8707953b6.0","@material/mwc-base":"0.15.0-canary.fca3dd9d.0","@material/mwc-floating-label":"0.15.0-canary.fca3dd9d.0","@material/mwc-icon":"0.15.0-canary.fca3dd9d.0","@material/mwc-line-ripple":"0.15.0-canary.fca3dd9d.0","@material/mwc-notched-outline":"0.15.0-canary.fca3dd9d.0","@material/shape":"=6.0.0-canary.8707953b6.0","@material/textfield":"=6.0.0-canary.8707953b6.0","@material/theme":"=6.0.0-canary.8707953b6.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"3eb322e4775d836b8959bdd2dfe63f09dd0e0fee","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3eb322e4775d836b8959bdd2dfe63f09dd0e0fee/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3eb322e4775d836b8959bdd2dfe63f09dd0e0fee/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3eb322e4775d836b8959bdd2dfe63f09dd0e0fee/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3eb322e4775d836b8959bdd2dfe63f09dd0e0fee/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3eb322e4775d836b8959bdd2dfe63f09dd0e0fee/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3eb322e4775d836b8959bdd2dfe63f09dd0e0fee/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3eb322e4775d836b8959bdd2dfe63f09dd0e0fee/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3eb322e4775d836b8959bdd2dfe63f09dd0e0fee/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3eb322e4775d836b8959bdd2dfe63f09dd0e0fee/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3eb322e4775d836b8959bdd2dfe63f09dd0e0fee/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3eb322e4775d836b8959bdd2dfe63f09dd0e0fee/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\n| Name                | Type             | Description\n| ------------------- | ---------------- |------------\n| `value`             | `string`         | The input control's value.\n| `type`              | `TextFieldType*` | A string specifying the type of control to render.\n| `label`             | `string`         | Sets floating label value.\n| `placeholder`       | `string`         | Sets disappearing input placeholder.\n| `icon`              | `string`         | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `iconTrailing`      | `string`         | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `disabled`          | `boolean`        | Whether or not the input should be disabled.\n| `charCounter`       | `boolean`        | **Note: requries `maxLength` to be set.** Display character counter with max length.\n| `outlined`          | `boolean`        | Whether or not to show the material outlined variant.\n| `fullwidth`         | `boolean`        | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n| `helper`            | `string`         | Helper text to display below the input. Display default only when focused.\n| `helperPersistent`  | `boolean`        | Always show the helper text despite focus.\n| `required`          | `boolean`        | Displays error state if value is empty and input is blurred.\n| `maxLength`         | `number`         | Maximum length to accept input.\n| `validationMessage` | `string`         | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n| `pattern`           | `string`         | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `min`               | `number`\\|`string`  | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `max`               | `number`\\|`string`  | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `step`              | `number`\\|`null`    | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n| `autoValidate`      | `boolean`           | Reports validity on input rather than only on blur.\n| `validity`          | `ValidityState` (readonly) | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n| `willValidate`      | `boolean` (readonly)       | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n| `validityTransform` | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n| `validateOnInitialRender` | `boolean`            | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's  bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's  bottom line when hovering.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.15.0-canary.fca3dd9d.0","_nodeVersion":"10.19.0","_npmVersion":"lerna/3.20.2/node@v10.19.0+x64 (linux)","dist":{"integrity":"sha512-vBU4TmpgINbdKR/lYLGEpG9gizHBBEgSS6hr6ZwFo5peB+2cvjE1TEK1yOTQngn8c51MgDLdRZRTVw+5Kg+sAQ==","shasum":"196f5e47468499fae41b8f4cf64b16dc455bb2cb","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.15.0-canary.fca3dd9d.0.tgz","fileCount":20,"unpackedSize":254624,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeepsLCRA9TVsSAnZWagAA8VgQAIV+vtqRX470MXkm2t/Y\ncj2ZPCHcI5/jP2w/NMAQl+0Wp4CSC66FYSAYk+neZaSmO9SMR/jHFH30iGOy\nMD9iAwi69KqJeEQ8Jj1gf0yUo7KCurEQf2+mWtimEW6zv4IxvlDsJslnqiYQ\nQEhbMIX7yNSTRuSw+yEj62NQJK1dFRE5reNeTEdJLZvjxFQM8dAp+Tyvtnmt\nhRLMNDNsApfd3VEa7VIz/fMLcMeafKJH5iI4qMBvfJesMJ+zZRQLKXulDQft\nJ7veFZ54IOM/FNrBk77qikiv6mlTdAXVxPM4AzevDkA6obkEo4ysUz1IoKmc\nGsdmL9x/zyA2GhqE2zSwU7Mj1f8ZH13j2Cxd82tdY22QKLmdxtCuouKqPLX5\nnbQaNRA+q7usT4jrzRkkaoOUo+kYc+uWyKo1XzvRlhAsKAobO+ea4Q6suq1+\nrSHkNWzYc6u9+KdswnaZid14bUXMD5g/EzqSx5i1Xy2KYwwYVFBXaw6KuAe4\nMuGyzZuMVdos0Ww0SffjQrJcDbDgWWMTPYsfeNlaaTxCeJCn+mL9iO6cyDmh\n3cQTyqvPFR3PjkRw/9NvJGEdVfhy5lpGexHgv6Ku9dwqvPXGxtv/CQieu60q\nZw0CLAwYwSAAsWjM5NeJ/IvlfKyLZ9RPydZfxfoJY8XEkVC1Qoa/Ue8t0JGt\nrp+8\r\n=31jO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB4WXQcqZq7AIUrKGRqqHOs5o2D9oU6WunszGShANbDnAiAbgRGdPNyrXMZ6t5+HZCT1QD+LItIAp/4NeVJSEAXdBQ=="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.15.0-canary.fca3dd9d.0_1585093386704_0.9378693463206225"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.15.0-canary.1e73da49.0":{"name":"@material/mwc-textfield","version":"0.15.0-canary.1e73da49.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.10af6cf39.0","@material/line-ripple":"=6.0.0-canary.10af6cf39.0","@material/mwc-base":"0.15.0-canary.1e73da49.0","@material/mwc-floating-label":"0.15.0-canary.1e73da49.0","@material/mwc-icon":"0.15.0-canary.1e73da49.0","@material/mwc-line-ripple":"0.15.0-canary.1e73da49.0","@material/mwc-notched-outline":"0.15.0-canary.1e73da49.0","@material/shape":"=6.0.0-canary.10af6cf39.0","@material/textfield":"=6.0.0-canary.10af6cf39.0","@material/theme":"=6.0.0-canary.10af6cf39.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"cbf63b814d242690910ae4946b6144120c317eb0","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cbf63b814d242690910ae4946b6144120c317eb0/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cbf63b814d242690910ae4946b6144120c317eb0/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cbf63b814d242690910ae4946b6144120c317eb0/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cbf63b814d242690910ae4946b6144120c317eb0/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cbf63b814d242690910ae4946b6144120c317eb0/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cbf63b814d242690910ae4946b6144120c317eb0/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cbf63b814d242690910ae4946b6144120c317eb0/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cbf63b814d242690910ae4946b6144120c317eb0/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cbf63b814d242690910ae4946b6144120c317eb0/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cbf63b814d242690910ae4946b6144120c317eb0/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cbf63b814d242690910ae4946b6144120c317eb0/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\n| Name                | Type             | Description\n| ------------------- | ---------------- |------------\n| `value`             | `string`         | The input control's value.\n| `type`              | `TextFieldType*` | A string specifying the type of control to render.\n| `label`             | `string`         | Sets floating label value.\n| `placeholder`       | `string`         | Sets disappearing input placeholder.\n| `icon`              | `string`         | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `iconTrailing`      | `string`         | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `disabled`          | `boolean`        | Whether or not the input should be disabled.\n| `charCounter`       | `boolean`        | **Note: requries `maxLength` to be set.** Display character counter with max length.\n| `outlined`          | `boolean`        | Whether or not to show the material outlined variant.\n| `fullwidth`         | `boolean`        | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n| `helper`            | `string`         | Helper text to display below the input. Display default only when focused.\n| `helperPersistent`  | `boolean`        | Always show the helper text despite focus.\n| `required`          | `boolean`        | Displays error state if value is empty and input is blurred.\n| `maxLength`         | `number`         | Maximum length to accept input.\n| `validationMessage` | `string`         | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n| `pattern`           | `string`         | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `min`               | `number`\\|`string`  | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `max`               | `number`\\|`string`  | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `step`              | `number`\\|`null`    | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n| `autoValidate`      | `boolean`           | Reports validity on input rather than only on blur.\n| `validity`          | `ValidityState` (readonly) | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n| `willValidate`      | `boolean` (readonly)       | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n| `validityTransform` | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n| `validateOnInitialRender` | `boolean`            | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's  bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's  bottom line when hovering.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.15.0-canary.1e73da49.0","_nodeVersion":"10.19.0","_npmVersion":"lerna/3.20.2/node@v10.19.0+x64 (linux)","dist":{"integrity":"sha512-IjvrkGKTIJlDYk7sQkhxpzN215CM+ct2DfqNGCD/2NU5IDbJysIGifhS2qLU1co4gmw/gLdn2WjioG/T1sb6lQ==","shasum":"ae49fa705d9bc541574b7a77ef64ba879cdf63f2","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.15.0-canary.1e73da49.0.tgz","fileCount":20,"unpackedSize":254624,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJee81TCRA9TVsSAnZWagAAoJcP+wZnojUxkynLIYmKkAur\ndSfA4EFaEYL6ydepoEBU7cOUXQ5IX3GdN3CadLQbTXq6Z0y0I6MXr5iESB0C\neMX1XNkx4KI82iOafp0TOKRJ+8o2HK9YhNldppLFwtKMnvtgPEQUl8UQjGX6\nxPZTZRpu9gKuVdqQf9xQN9Sz058dPNNGrWhJ2/mdQp+oMbzrEgQGWiJZbFKu\nT0TkDAT4MYcRLQJDwTgOKpR74l8sIwFd2Ch0uX8hsA53Z7F5a3f6ul89WtpN\nExOTjnUXpm6XHNIbBziBXWZX6ibNudQvKWgoj6cv6Kx5BuJZCvb2JAS59sbO\n79SP0nABJLjH4FurFduZ2vwVKnEdG+jtVxUX7IwjuesNsyMhvi1CL18OV+Ov\n0OenVQF/FaZwRZJ7gxig3JAKOnemdLE8CHwJfhAt6RgkrQaRhLBgxTraCIya\na8hxxQYwzHFCY0jIpPnb3z/0xUhk7UcvVLxUpuGHJ1GfExwMwqCTZK8Cl9r8\nlvmDkdv9iBRh2RtuarkgqumJ1bJBBI6fN0OFZgOGPvU9ivObffiJSyOrJzTP\nbyuRlr39rN1Y5n8GB3kRApbhsYRVMMuZtnZ2BkYF/ZhVae4GtC0X1//wgC/e\nV/lEvD+1wtM2k5S+0UVu2K2Wna4S+/iXc7n6fBCUKm1Dm4opfcxfWQ4wu8o+\nAZ6V\r\n=SKx9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAgWOLOwcSxPKTWdqryyi3plx4QKY0vuccM+8iK6+VxMAiAljDpcOTIWHh/pdVU4kgqG97Ku5yQkFUZbbEOrFkoOwA=="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.15.0-canary.1e73da49.0_1585171794875_0.05792115264134434"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.15.0-canary.bb6dfc5a.0":{"name":"@material/mwc-textfield","version":"0.15.0-canary.bb6dfc5a.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.10af6cf39.0","@material/line-ripple":"=6.0.0-canary.10af6cf39.0","@material/mwc-base":"0.15.0-canary.bb6dfc5a.0","@material/mwc-floating-label":"0.15.0-canary.bb6dfc5a.0","@material/mwc-icon":"0.15.0-canary.bb6dfc5a.0","@material/mwc-line-ripple":"0.15.0-canary.bb6dfc5a.0","@material/mwc-notched-outline":"0.15.0-canary.bb6dfc5a.0","@material/shape":"=6.0.0-canary.10af6cf39.0","@material/textfield":"=6.0.0-canary.10af6cf39.0","@material/theme":"=6.0.0-canary.10af6cf39.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"beb2656148ba3ea8e2b2b5053396cd8d9ae8e52f","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/beb2656148ba3ea8e2b2b5053396cd8d9ae8e52f/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/beb2656148ba3ea8e2b2b5053396cd8d9ae8e52f/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/beb2656148ba3ea8e2b2b5053396cd8d9ae8e52f/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/beb2656148ba3ea8e2b2b5053396cd8d9ae8e52f/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/beb2656148ba3ea8e2b2b5053396cd8d9ae8e52f/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/beb2656148ba3ea8e2b2b5053396cd8d9ae8e52f/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/beb2656148ba3ea8e2b2b5053396cd8d9ae8e52f/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/beb2656148ba3ea8e2b2b5053396cd8d9ae8e52f/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/beb2656148ba3ea8e2b2b5053396cd8d9ae8e52f/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/beb2656148ba3ea8e2b2b5053396cd8d9ae8e52f/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/beb2656148ba3ea8e2b2b5053396cd8d9ae8e52f/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\n| Name                | Type             | Description\n| ------------------- | ---------------- |------------\n| `value`             | `string`         | The input control's value.\n| `type`              | `TextFieldType*` | A string specifying the type of control to render.\n| `label`             | `string`         | Sets floating label value.\n| `placeholder`       | `string`         | Sets disappearing input placeholder.\n| `icon`              | `string`         | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `iconTrailing`      | `string`         | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `disabled`          | `boolean`        | Whether or not the input should be disabled.\n| `charCounter`       | `boolean`        | **Note: requries `maxLength` to be set.** Display character counter with max length.\n| `outlined`          | `boolean`        | Whether or not to show the material outlined variant.\n| `fullwidth`         | `boolean`        | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n| `helper`            | `string`         | Helper text to display below the input. Display default only when focused.\n| `helperPersistent`  | `boolean`        | Always show the helper text despite focus.\n| `required`          | `boolean`        | Displays error state if value is empty and input is blurred.\n| `maxLength`         | `number`         | Maximum length to accept input.\n| `validationMessage` | `string`         | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n| `pattern`           | `string`         | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `min`               | `number`\\|`string`  | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `max`               | `number`\\|`string`  | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `step`              | `number`\\|`null`    | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n| `autoValidate`      | `boolean`           | Reports validity on input rather than only on blur.\n| `validity`          | `ValidityState` (readonly) | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n| `willValidate`      | `boolean` (readonly)       | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n| `validityTransform` | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n| `validateOnInitialRender` | `boolean`            | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.15.0-canary.bb6dfc5a.0","_nodeVersion":"10.19.0","_npmVersion":"lerna/3.20.2/node@v10.19.0+x64 (linux)","dist":{"integrity":"sha512-UQ5awp/QC3cUFdBAybradOtpeFKDBeQkywdADhmeZ++mol6TZO0cK3kHqQlAgAeLgojIVY02DBrxojIspsQZnQ==","shasum":"14b15122ce652c54e7e22fd4a18ad92d9e2fc199","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.15.0-canary.bb6dfc5a.0.tgz","fileCount":20,"unpackedSize":256046,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJefVV1CRA9TVsSAnZWagAAS7wP/R4ANt04hX4+YYqKg/iM\nYgUhu86F0ek/kMejLcIESI4Ih461ZOi9XGUxf1mIm322XK8+jTeeu7UjL0sD\n8T+UR7zxolbGFjPySq92xL15WxX+KQ2x3yMQV3xhVzZxU3tRK5oibLNgFPVV\n+6sruAQEqoqWLJgHG7WIiAiIauDKh7tzh/ycbfAur7ZjSap+K5oV5TFSm0MY\nnCJY0dwW1uc0DvzKX/gU79titqyUjy0bIJPy/FaYqqse84U6RF8nPg6Ey0Cd\nGins5p+Q3pR7X/TMkAmNSyv9FczkuPdQnoj2Z1N+vihvgnb60zpYZZMxML+t\nSfDxp7bfrF/kWLkO+bjisoWLSUQichK1rn9ZgUOzYdWQZaOJNAWBbgxx7dMd\n28GNxpO8T+nHc5ZWG1e+8J9YWgZBWsIPrMlSMCOwxxuKrBxRxxAAl0FO2xYe\no77zgAFgCcd7+6UPhAxlwJBlNT01UiVxNtfMVeZiEXAmW9R5dbGdzNT7eWf7\nasPv5kWtKkePKJ53SIHOJxQgoGRT0W2A/V9ZflRdkF366sNRz1KXLtPOh2pA\n9yOKpt2Y/wWNRjBjZY+Qw0ARWY8unZHLmKT7ga29T9bWPDmndydpHqEzInH4\nfBo8tDFObv+ORW+qVugO7K4/R9DKeYOXPZ+d5o3XfvIT+akL0vuBfiLdEAgl\nWuTU\r\n=wTpW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEc8ONTu4xBN7KHlp4B1Z65Em3Lexy4y0ozMr/V4QF4WAiEA9YiN/1NjRMnHvC8ooLC8+CUulED6KMRvNhT11EU/Pr0="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.15.0-canary.bb6dfc5a.0_1585272180802_0.8004443316056109"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.15.0-canary.1884603d.0":{"name":"@material/mwc-textfield","version":"0.15.0-canary.1884603d.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.10af6cf39.0","@material/line-ripple":"=6.0.0-canary.10af6cf39.0","@material/mwc-base":"0.15.0-canary.1884603d.0","@material/mwc-floating-label":"0.15.0-canary.1884603d.0","@material/mwc-icon":"0.15.0-canary.1884603d.0","@material/mwc-line-ripple":"0.15.0-canary.1884603d.0","@material/mwc-notched-outline":"0.15.0-canary.1884603d.0","@material/shape":"=6.0.0-canary.10af6cf39.0","@material/textfield":"=6.0.0-canary.10af6cf39.0","@material/theme":"=6.0.0-canary.10af6cf39.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"9a072ce4f7812e5120dbc51ed124d9669e1f7be5","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9a072ce4f7812e5120dbc51ed124d9669e1f7be5/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9a072ce4f7812e5120dbc51ed124d9669e1f7be5/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9a072ce4f7812e5120dbc51ed124d9669e1f7be5/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9a072ce4f7812e5120dbc51ed124d9669e1f7be5/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9a072ce4f7812e5120dbc51ed124d9669e1f7be5/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9a072ce4f7812e5120dbc51ed124d9669e1f7be5/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9a072ce4f7812e5120dbc51ed124d9669e1f7be5/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9a072ce4f7812e5120dbc51ed124d9669e1f7be5/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9a072ce4f7812e5120dbc51ed124d9669e1f7be5/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9a072ce4f7812e5120dbc51ed124d9669e1f7be5/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9a072ce4f7812e5120dbc51ed124d9669e1f7be5/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\n| Name                | Type             | Description\n| ------------------- | ---------------- |------------\n| `value`             | `string`         | The input control's value.\n| `type`              | `TextFieldType*` | A string specifying the type of control to render.\n| `label`             | `string`         | Sets floating label value.\n| `placeholder`       | `string`         | Sets disappearing input placeholder.\n| `icon`              | `string`         | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `iconTrailing`      | `string`         | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `disabled`          | `boolean`        | Whether or not the input should be disabled.\n| `charCounter`       | `boolean`        | **Note: requries `maxLength` to be set.** Display character counter with max length.\n| `outlined`          | `boolean`        | Whether or not to show the material outlined variant.\n| `fullwidth`         | `boolean`        | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n| `helper`            | `string`         | Helper text to display below the input. Display default only when focused.\n| `helperPersistent`  | `boolean`        | Always show the helper text despite focus.\n| `required`          | `boolean`        | Displays error state if value is empty and input is blurred.\n| `maxLength`         | `number`         | Maximum length to accept input.\n| `validationMessage` | `string`         | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n| `pattern`           | `string`         | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `min`               | `number`\\|`string`  | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `max`               | `number`\\|`string`  | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `step`              | `number`\\|`null`    | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n| `autoValidate`      | `boolean`           | Reports validity on input rather than only on blur.\n| `validity`          | `ValidityState` (readonly) | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n| `willValidate`      | `boolean` (readonly)       | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n| `validityTransform` | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n| `validateOnInitialRender` | `boolean`            | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.15.0-canary.1884603d.0","_nodeVersion":"10.19.0","_npmVersion":"lerna/3.20.2/node@v10.19.0+x64 (linux)","dist":{"integrity":"sha512-dIwRQyJnw1WybVFOxFeRTGfQBAxGObR8kHwKe6YMOrNuUbTy4CII2EprJVXZN+d2h1R8WAAZEuXO/JXr8+96oQ==","shasum":"304929085afd1da91f18155c03d3cf8f1968eedf","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.15.0-canary.1884603d.0.tgz","fileCount":20,"unpackedSize":256046,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeflorCRA9TVsSAnZWagAAS9sP/RBUusTJBMgrd/osVQ2H\n+wFOmvEKpbT9bng7ONDOQgvQ9OjHBSS/s1ALtLE9nbcgC7uV7ZdWFB4Z/1WP\nuifEwxE8xeEd00xS8q/1YutSuNauqUwwjc0sRIxqUkEYKOWHxnHcBb/VxNM+\nhONdx1m2UsoZ4gRA9eMm38zJ1mL88HIZSAqy0RXTWvGnVIuLCdoMp4MojA38\n/TmQHJvnopze9vlCTjJv0D9Cjfr73rb5YBCW2kiDomMsNCk2ulkCdhJNWzLb\nP4DWMk4iUxi5BlPkgYFJ/URSt4DCvsX7eL5rCmUtJvNwiNA+FeBsdiuw6bMR\nmvQFOPHTKzII/M2Vtb21b6MgMYyYw/DWH3nl8rBd5DIXtXhuWcwx8fdJdSQC\nPpNvphwC7HtOA8o3yWmEeVQ4H/NDPim5pg/hD8V+UQ5Fu84XNYQXcKRjWioc\nKdLt1VD02HPxLF5qPRUXN8s/yYoPYBrHw59jBhwucrmfMNsCSWvxJj3NnXVt\nJHHR7+S1Sda8q0kLRnSH8OmDpgyLIiIWdxHVa0T/5S6/AkFaIGmOGYuF8vJj\niW8BDzBBMOFKvrEiVhNpFpe+beZHZjbJ79Kbwx/qlx3vS6IYMl5mDFiHuyVX\nW+35rshmA8S0zvjo0U8hoM7hKY/OoOVdCPuSCtIIQGVAXQIT6/uEkhjfVeA5\nJqFL\r\n=UFnl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDWrAFtU7fsFpF3l0yBH/WYTK2PWp2vyXjX41pUabhGiAIhAMnu7csASW9fBqDwsZ+p4unpO/t2+0xrz5Xb2/vaNA3j"}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.15.0-canary.1884603d.0_1585338923371_0.028894477535077234"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.15.0-canary.aff73cab.0":{"name":"@material/mwc-textfield","version":"0.15.0-canary.aff73cab.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.d6315efe2.0","@material/line-ripple":"=6.0.0-canary.d6315efe2.0","@material/mwc-base":"0.15.0-canary.aff73cab.0","@material/mwc-floating-label":"0.15.0-canary.aff73cab.0","@material/mwc-icon":"0.15.0-canary.aff73cab.0","@material/mwc-line-ripple":"0.15.0-canary.aff73cab.0","@material/mwc-notched-outline":"0.15.0-canary.aff73cab.0","@material/shape":"=6.0.0-canary.d6315efe2.0","@material/textfield":"=6.0.0-canary.d6315efe2.0","@material/theme":"=6.0.0-canary.d6315efe2.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"40f9b297ee5f13af191b6bf450012454426c44b0","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/40f9b297ee5f13af191b6bf450012454426c44b0/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/40f9b297ee5f13af191b6bf450012454426c44b0/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/40f9b297ee5f13af191b6bf450012454426c44b0/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/40f9b297ee5f13af191b6bf450012454426c44b0/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/40f9b297ee5f13af191b6bf450012454426c44b0/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/40f9b297ee5f13af191b6bf450012454426c44b0/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/40f9b297ee5f13af191b6bf450012454426c44b0/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/40f9b297ee5f13af191b6bf450012454426c44b0/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/40f9b297ee5f13af191b6bf450012454426c44b0/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/40f9b297ee5f13af191b6bf450012454426c44b0/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/40f9b297ee5f13af191b6bf450012454426c44b0/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\n| Name                | Type             | Description\n| ------------------- | ---------------- |------------\n| `value`             | `string`         | The input control's value.\n| `type`              | `TextFieldType*` | A string specifying the type of control to render.\n| `label`             | `string`         | Sets floating label value.\n| `placeholder`       | `string`         | Sets disappearing input placeholder.\n| `icon`              | `string`         | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `iconTrailing`      | `string`         | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `disabled`          | `boolean`        | Whether or not the input should be disabled.\n| `charCounter`       | `boolean`        | **Note: requries `maxLength` to be set.** Display character counter with max length.\n| `outlined`          | `boolean`        | Whether or not to show the material outlined variant.\n| `fullwidth`         | `boolean`        | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n| `helper`            | `string`         | Helper text to display below the input. Display default only when focused.\n| `helperPersistent`  | `boolean`        | Always show the helper text despite focus.\n| `required`          | `boolean`        | Displays error state if value is empty and input is blurred.\n| `maxLength`         | `number`         | Maximum length to accept input.\n| `validationMessage` | `string`         | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n| `pattern`           | `string`         | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `min`               | `number`\\|`string`  | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `max`               | `number`\\|`string`  | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `step`              | `number`\\|`null`    | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n| `autoValidate`      | `boolean`           | Reports validity on input rather than only on blur.\n| `validity`          | `ValidityState` (readonly) | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n| `willValidate`      | `boolean` (readonly)       | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n| `validityTransform` | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n| `validateOnInitialRender` | `boolean`            | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.15.0-canary.aff73cab.0","_nodeVersion":"10.19.0","_npmVersion":"lerna/3.20.2/node@v10.19.0+x64 (linux)","dist":{"integrity":"sha512-yXA8VI/bsqRGYIP2YTw0NoIX5LI2G4IZTdBFppZgLPY+6Z4uCJGQgfc299vw06re8EGZn1XSvi5kSEJe79yyUA==","shasum":"b610e19507209462ab64dbc43f57da49e60a6225","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.15.0-canary.aff73cab.0.tgz","fileCount":20,"unpackedSize":256046,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJefmyrCRA9TVsSAnZWagAA4hUP/R6+rsv3bmvbouHIBByt\n02IW5Kmi+9VX8q/8CtExfLgfiOP6uiELcDoagFD3OoU1msy85EpOUgvjP4nw\nej5bPniVN3uwh2ug5y3viQSp93lTnl8c3ObQM7A3s/6cLYUOy9j8Uh2ov0dD\nAfXp51KNKNRIqQCLF16jPpS82BsH39+KZ1LRmRHeIjTSAdibvtVSFEQFXLoY\nP9rAEW0ZZM8t+j2LVvzwJqBhn5vQK+21HUUJTRkUA5HripAeRS+sVh3vWvCU\nf7dJv8GKnYC8Du4qbGHSSaJ572/6N965bGCjyc5KGW6q23jpbvkAfsnscDyI\nipBcydHxdgAblLpIx/y9so9TJ/Mbq19LSOMoT7Ub7IlPwLIm+ITyvyO9H3RN\nbkUOGKC3+YX3lDYfVCcJ03xy+7623amBhox2OYNWQsTP+1L6rAQ3onzgzlSi\nCn6qUhxz2Ft7wrGHSG4QIaVKJJv3uRPT82xIRC5O9PL2iwpxro8eNt2Dd69/\nVrZARhx4fwyK14zYzIxoHMNXDz9rQAVayESUqboHos8hvjYQsPO60jvMDuZK\no60gFtRlZdi2i6lUwLc8Dn07cyYKozC6bGiqGnvHx0DYLOhSg5K2KMTlcHy9\nDea70sjR9qqCsa1lpsuFy6St9oHbwDYKnpI4l4/ffQO5DV9STMUDMehvjuMa\nL5Zv\r\n=hmBK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICUhrhoTUuQz5ehugaQp5deaOluNYrWO97UCd9iWlcZUAiAPe53kE/I39vaRFmc/3paF6nrD9P2jPOp7aQjfTCGOCQ=="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.15.0-canary.aff73cab.0_1585343658794_0.16716259853184146"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.15.0-canary.63168f61.0":{"name":"@material/mwc-textfield","version":"0.15.0-canary.63168f61.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.a3016368d.0","@material/line-ripple":"=6.0.0-canary.a3016368d.0","@material/mwc-base":"0.15.0-canary.63168f61.0","@material/mwc-floating-label":"0.15.0-canary.63168f61.0","@material/mwc-icon":"0.15.0-canary.63168f61.0","@material/mwc-line-ripple":"0.15.0-canary.63168f61.0","@material/mwc-notched-outline":"0.15.0-canary.63168f61.0","@material/shape":"=6.0.0-canary.a3016368d.0","@material/textfield":"=6.0.0-canary.a3016368d.0","@material/theme":"=6.0.0-canary.a3016368d.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"84107987770a82843942246baa8226b37f269240","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/84107987770a82843942246baa8226b37f269240/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/84107987770a82843942246baa8226b37f269240/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/84107987770a82843942246baa8226b37f269240/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/84107987770a82843942246baa8226b37f269240/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/84107987770a82843942246baa8226b37f269240/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/84107987770a82843942246baa8226b37f269240/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/84107987770a82843942246baa8226b37f269240/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/84107987770a82843942246baa8226b37f269240/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/84107987770a82843942246baa8226b37f269240/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/84107987770a82843942246baa8226b37f269240/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/84107987770a82843942246baa8226b37f269240/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\n| Name                | Type             | Description\n| ------------------- | ---------------- |------------\n| `value`             | `string`         | The input control's value.\n| `type`              | `TextFieldType*` | A string specifying the type of control to render.\n| `label`             | `string`         | Sets floating label value.\n| `placeholder`       | `string`         | Sets disappearing input placeholder.\n| `icon`              | `string`         | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `iconTrailing`      | `string`         | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `disabled`          | `boolean`        | Whether or not the input should be disabled.\n| `charCounter`       | `boolean`        | **Note: requries `maxLength` to be set.** Display character counter with max length.\n| `outlined`          | `boolean`        | Whether or not to show the material outlined variant.\n| `fullwidth`         | `boolean`        | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n| `helper`            | `string`         | Helper text to display below the input. Display default only when focused.\n| `helperPersistent`  | `boolean`        | Always show the helper text despite focus.\n| `required`          | `boolean`        | Displays error state if value is empty and input is blurred.\n| `maxLength`         | `number`         | Maximum length to accept input.\n| `validationMessage` | `string`         | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n| `pattern`           | `string`         | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `min`               | `number`\\|`string`  | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `max`               | `number`\\|`string`  | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `step`              | `number`\\|`null`    | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n| `autoValidate`      | `boolean`           | Reports validity on input rather than only on blur.\n| `validity`          | `ValidityState` (readonly) | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n| `willValidate`      | `boolean` (readonly)       | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n| `validityTransform` | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n| `validateOnInitialRender` | `boolean`            | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.15.0-canary.63168f61.0","_nodeVersion":"10.19.0","_npmVersion":"lerna/3.20.2/node@v10.19.0+x64 (linux)","dist":{"integrity":"sha512-3kvBQPweB6HwRz+onslIuCeNVGYMPwEofR4CHZRRVcOKBszt3/pHmszr/DsGxQcB6F/RTzBgJ5sW3Iw4GeeYnw==","shasum":"f00a041d02cbeaf192a5a17f37693d9c5967053c","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.15.0-canary.63168f61.0.tgz","fileCount":20,"unpackedSize":256046,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeg4gLCRA9TVsSAnZWagAAdNAP/1a1tgGkZR6o/o4QPjA3\ngW9leerhnPgUymXPskjK3pcUlc4WnPA1iNgkWFvHUC3L4gHwt9Elj908sQ+G\nwBna3Y4LRjtt0691I7X4mpDA0zNv1RCT4xCsN5v4YYzPaIol6R88LsnuTtFH\nzj20nHe8oLSbHVt2Iu3LGmqenKfEXXjIpisB1wb8rw7272tCyOyvqH4iNmNw\nnP3hX7IJYU4Ep/0e7WdltrLHoCXzAlp/Rjw/FqyaqXZ64OKiay2SPASRQYa6\n7q5S1IirQR1S3RnIoHmmKjaNGVgzXX+2J8Kcoeb2Xc4CBBTdjOFQSZHXysGP\n4t8CXhFGfyBkz+NcQ9Hrlh+ARfNCYP5s9Lw2B8x/4CcNiVEyQog0VQHeHwBy\nUZbU3n6KCXmdHTrqDQIUVWEUSaLwPB5pHBeu2oNWOarW40AF6reFiRwqQ7eI\nsDXNuluJ2n0BttQJk2NG4moYV+2of1UORPaDeiH8KJisX44tOnzmspsoGodE\nzcckWiD8ubXG7Z8wI8NLVMY3wnaFKYSF6hxhfmNLATxdVJGND0B6Vfw8O1I5\n0dPUOo/pnNBFW8IzWHMGoyigfLDZeL9TVFz4KoBXWgV+sx3lsLtEYch+kGwq\nx+r5UPbAqkMUQDqjQSGGptXmboNjg7UrVZMnbABsALLD2rMD29dD/Rw9loB0\njRNm\r\n=kz51\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICmuKNfhg8VSQ/neB0NDh1OOtC7nJqnGmpDJN4gAbDl+AiBPPJOcV/QD7olbVmayHwXVg3Rx1vQWdF8Xdg+oFtLKTw=="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.15.0-canary.63168f61.0_1585678346613_0.4908796963349582"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.15.0-canary.9fb79b3e.0":{"name":"@material/mwc-textfield","version":"0.15.0-canary.9fb79b3e.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.4b45b6620.0","@material/line-ripple":"=6.0.0-canary.4b45b6620.0","@material/mwc-base":"0.15.0-canary.9fb79b3e.0","@material/mwc-floating-label":"0.15.0-canary.9fb79b3e.0","@material/mwc-icon":"0.15.0-canary.9fb79b3e.0","@material/mwc-line-ripple":"0.15.0-canary.9fb79b3e.0","@material/mwc-notched-outline":"0.15.0-canary.9fb79b3e.0","@material/shape":"=6.0.0-canary.4b45b6620.0","@material/textfield":"=6.0.0-canary.4b45b6620.0","@material/theme":"=6.0.0-canary.4b45b6620.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"6669949a31d7f92febd25f5d49eb40a5db4aa7f5","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6669949a31d7f92febd25f5d49eb40a5db4aa7f5/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6669949a31d7f92febd25f5d49eb40a5db4aa7f5/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6669949a31d7f92febd25f5d49eb40a5db4aa7f5/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6669949a31d7f92febd25f5d49eb40a5db4aa7f5/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6669949a31d7f92febd25f5d49eb40a5db4aa7f5/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6669949a31d7f92febd25f5d49eb40a5db4aa7f5/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6669949a31d7f92febd25f5d49eb40a5db4aa7f5/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6669949a31d7f92febd25f5d49eb40a5db4aa7f5/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6669949a31d7f92febd25f5d49eb40a5db4aa7f5/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6669949a31d7f92febd25f5d49eb40a5db4aa7f5/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6669949a31d7f92febd25f5d49eb40a5db4aa7f5/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\n| Name                | Type             | Description\n| ------------------- | ---------------- |------------\n| `value`             | `string`         | The input control's value.\n| `type`              | `TextFieldType*` | A string specifying the type of control to render.\n| `label`             | `string`         | Sets floating label value.\n| `placeholder`       | `string`         | Sets disappearing input placeholder.\n| `icon`              | `string`         | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `iconTrailing`      | `string`         | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `disabled`          | `boolean`        | Whether or not the input should be disabled.\n| `charCounter`       | `boolean`        | **Note: requries `maxLength` to be set.** Display character counter with max length.\n| `outlined`          | `boolean`        | Whether or not to show the material outlined variant.\n| `fullwidth`         | `boolean`        | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n| `helper`            | `string`         | Helper text to display below the input. Display default only when focused.\n| `helperPersistent`  | `boolean`        | Always show the helper text despite focus.\n| `required`          | `boolean`        | Displays error state if value is empty and input is blurred.\n| `maxLength`         | `number`         | Maximum length to accept input.\n| `validationMessage` | `string`         | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n| `pattern`           | `string`         | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `min`               | `number`\\|`string`  | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `max`               | `number`\\|`string`  | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `step`              | `number`\\|`null`    | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n| `autoValidate`      | `boolean`           | Reports validity on input rather than only on blur.\n| `validity`          | `ValidityState` (readonly) | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n| `willValidate`      | `boolean` (readonly)       | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n| `validityTransform` | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n| `validateOnInitialRender` | `boolean`            | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.15.0-canary.9fb79b3e.0","_nodeVersion":"10.19.0","_npmVersion":"lerna/3.20.2/node@v10.19.0+x64 (linux)","dist":{"integrity":"sha512-NFClYJ/iE88snAvbF7yxLnt2cLzYA8exlmTeltrD/AwLqdjWAlj5ZcCgwF2+WSCIqtpDwGXCn6yUlZzV13sJ3A==","shasum":"105cb3c74515699d31b94bec04e15c6f4cf58ca2","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.15.0-canary.9fb79b3e.0.tgz","fileCount":20,"unpackedSize":256046,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeg7QMCRA9TVsSAnZWagAA2WYQAIlW3CAYjK9pBOi5c4/o\nIidUGnAFA5EV6WtPZNQahejLhLrSA2EltNVEGFixMftyqsmT45I9ukoYCw03\ni0oJFyDXObkVQicjWZq3HeaXfDv07abix9yjwV9Y6qj8V01BjKbNHH/cgb/x\nZ6cX5B55GgvZwRDw1yWJ9nTk02JpQ1O1n+/JHg39X0/hTOlwYWxlvUKO/lRf\nNaNRAagIMkEryewqo74ljxBq4a9eI/3PCoF/ocvgDn7p27Ph5qqFe34XDwd2\n0LOak6IJTf+9JXHgAdROUPwfLOg13pvOjI5OR3SS9mU00/YT9vW615FuFYYF\nV12jCYYf1ZyHiUF+odE/GeJHOPS/aWHzj1WGu9AT0FWaQQAchX6dy3S3HlxH\nNz+qPszXuAgGi5viTkYmsGgS1mGtpPAQsVxXW1c0nS5HbTG9X6UzK/cOuEvx\n6XbVCpdO2434/NPXmWQ2r9pWMtLmR8rY7gSGqjHn/eoxdksgRdNMiYNuLiZq\nLIcsnTUwE0+h24zWSCp+XSIH5mOgSK0qn8cK6m4oClS4frO1fIEW5NJB0ydt\nYguCMTkAnzuW10lm6JJh9yfJuybPjaWvbyh84At6Cy8jUO/6MfPed6g5LUZo\nUcDtT9bjZFvLmnCnyDyg3jch563BHIUzUOkwmVS2SYUoKkgujFSw6/YFCttl\n6DC7\r\n=ML8g\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD90ineWliN52BF1rajbTYjitrIplL9d1eyn4OZ52wdyAIgWJKJincsZiwgc4b9nkS5a9w7gudIMAcnc5i9NNjo0y0="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.15.0-canary.9fb79b3e.0_1585689612319_0.2805756514530813"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.15.0-canary.9bd3e9e2.0":{"name":"@material/mwc-textfield","version":"0.15.0-canary.9bd3e9e2.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.4b45b6620.0","@material/line-ripple":"=6.0.0-canary.4b45b6620.0","@material/mwc-base":"0.15.0-canary.9bd3e9e2.0","@material/mwc-floating-label":"0.15.0-canary.9bd3e9e2.0","@material/mwc-icon":"0.15.0-canary.9bd3e9e2.0","@material/mwc-line-ripple":"0.15.0-canary.9bd3e9e2.0","@material/mwc-notched-outline":"0.15.0-canary.9bd3e9e2.0","@material/shape":"=6.0.0-canary.4b45b6620.0","@material/textfield":"=6.0.0-canary.4b45b6620.0","@material/theme":"=6.0.0-canary.4b45b6620.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"9b56904aedd36911e83576292843c11af1a00006","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9b56904aedd36911e83576292843c11af1a00006/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9b56904aedd36911e83576292843c11af1a00006/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9b56904aedd36911e83576292843c11af1a00006/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9b56904aedd36911e83576292843c11af1a00006/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9b56904aedd36911e83576292843c11af1a00006/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9b56904aedd36911e83576292843c11af1a00006/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9b56904aedd36911e83576292843c11af1a00006/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9b56904aedd36911e83576292843c11af1a00006/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9b56904aedd36911e83576292843c11af1a00006/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9b56904aedd36911e83576292843c11af1a00006/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9b56904aedd36911e83576292843c11af1a00006/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\n| Name                | Type             | Description\n| ------------------- | ---------------- |------------\n| `value`             | `string`         | The input control's value.\n| `type`              | `TextFieldType*` | A string specifying the type of control to render.\n| `label`             | `string`         | Sets floating label value.\n| `placeholder`       | `string`         | Sets disappearing input placeholder.\n| `icon`              | `string`         | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `iconTrailing`      | `string`         | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `disabled`          | `boolean`        | Whether or not the input should be disabled.\n| `charCounter`       | `boolean`        | **Note: requries `maxLength` to be set.** Display character counter with max length.\n| `outlined`          | `boolean`        | Whether or not to show the material outlined variant.\n| `fullwidth`         | `boolean`        | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n| `helper`            | `string`         | Helper text to display below the input. Display default only when focused.\n| `helperPersistent`  | `boolean`        | Always show the helper text despite focus.\n| `required`          | `boolean`        | Displays error state if value is empty and input is blurred.\n| `maxLength`         | `number`         | Maximum length to accept input.\n| `validationMessage` | `string`         | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n| `pattern`           | `string`         | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `min`               | `number`\\|`string`  | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `max`               | `number`\\|`string`  | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `step`              | `number`\\|`null`    | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n| `autoValidate`      | `boolean`           | Reports validity on input rather than only on blur.\n| `validity`          | `ValidityState` (readonly) | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n| `willValidate`      | `boolean` (readonly)       | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n| `validityTransform` | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n| `validateOnInitialRender` | `boolean`            | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.15.0-canary.9bd3e9e2.0","_nodeVersion":"10.19.0","_npmVersion":"lerna/3.20.2/node@v10.19.0+x64 (linux)","dist":{"integrity":"sha512-BLbgD3mTYxIHHw0aRKVLt9xgSPLS7qyqghPVwf1gLINKZ9gLDMbAkeq/OxRhlXWarGSOphOqVznNu4leAjGViA==","shasum":"6b3f95a8e02d3616c4c6432430e5ca25d42f76f5","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.15.0-canary.9bd3e9e2.0.tgz","fileCount":20,"unpackedSize":256046,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeg91RCRA9TVsSAnZWagAAgToP+gKUIShOKLVdOKwR1XLO\np5KLmCAtMZzx0r0C4tFLpDNYDjNO8rDr59zdMKA9MVLcE6CR/Cg1Mmj4Jm8J\n1svqJ5a1neJ73Jujm000Pf2co9FCPiYuzSyENk9LljxEGfr2IjdG/lMN4Mjr\nT7j+K2NGfCUKY7YQ4HAOyKEdmOIw2cKG7yDyAdbumyEmhSNbKNoRp6kSX+BO\nlQTVNvKy1tocWIfoaj8wlF4nax8hKOkrI4ZytlRIP5iIye1+8w+YPfGTKXST\nznLYIGyJh1PRtzJKC5u1769bVhm7UFcqNbSIzRRqGPNnbClx8uWXeBOYncFj\nNYWDlsF3SG/SARKSzVg2a7uuSmkQIOgsQwxH60n7dtu4VHrkFMy42q6EP/3h\nsP0lQdDRIKXvyqWSkUtjkuiZrZZHLD2gJyz/07vYjbSadNapnNuTRhpkDGCp\nVLksAVS1jzvzEGfMj46QRW5NhQKaRpJe4VuGgUErzXSvhuOvpcuq+4lhnFlI\nFCCvx1zPByqMAMnxaQAaRw+UACCr/ZzhQaz696NMYYz4a18sBA2D4uSDW+uZ\ntM/VSQBn7tVSdFjrPlnVQGoVfWL8hor0qmWa5zEl+YjN17qPLmQU+Xs6p1pG\nWyCUdSb2DNQo4mLzTpuXtT84qEwchrV0pEdE8AVRXUfE68x4Z+6mRcgeGysQ\n6n7N\r\n=f9JO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDmEnuzaFv85WpYicn33QqQIxTTsEvxnSaXqOiqYYTS9wIgWH4dCktD4lV/zOVK9bwZ7X3cRxPJmNGVcL09Wrc1Ahk="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.15.0-canary.9bd3e9e2.0_1585700177236_0.5213916159067715"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.15.0-canary.072084ab.0":{"name":"@material/mwc-textfield","version":"0.15.0-canary.072084ab.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.e84b9c8.0","@material/line-ripple":"=6.0.0-canary.e84b9c8.0","@material/mwc-base":"0.15.0-canary.072084ab.0","@material/mwc-floating-label":"0.15.0-canary.072084ab.0","@material/mwc-icon":"0.15.0-canary.072084ab.0","@material/mwc-line-ripple":"0.15.0-canary.072084ab.0","@material/mwc-notched-outline":"0.15.0-canary.072084ab.0","@material/shape":"=6.0.0-canary.e84b9c8.0","@material/textfield":"=6.0.0-canary.e84b9c8.0","@material/theme":"=6.0.0-canary.e84b9c8.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"98a539f9970dea2ebc84f30f462c69e72dc0c4b1","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/98a539f9970dea2ebc84f30f462c69e72dc0c4b1/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/98a539f9970dea2ebc84f30f462c69e72dc0c4b1/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/98a539f9970dea2ebc84f30f462c69e72dc0c4b1/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/98a539f9970dea2ebc84f30f462c69e72dc0c4b1/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/98a539f9970dea2ebc84f30f462c69e72dc0c4b1/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/98a539f9970dea2ebc84f30f462c69e72dc0c4b1/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/98a539f9970dea2ebc84f30f462c69e72dc0c4b1/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/98a539f9970dea2ebc84f30f462c69e72dc0c4b1/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/98a539f9970dea2ebc84f30f462c69e72dc0c4b1/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/98a539f9970dea2ebc84f30f462c69e72dc0c4b1/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/98a539f9970dea2ebc84f30f462c69e72dc0c4b1/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\n| Name                | Type             | Description\n| ------------------- | ---------------- |------------\n| `value`             | `string`         | The input control's value.\n| `type`              | `TextFieldType*` | A string specifying the type of control to render.\n| `label`             | `string`         | Sets floating label value.\n| `placeholder`       | `string`         | Sets disappearing input placeholder.\n| `icon`              | `string`         | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `iconTrailing`      | `string`         | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `disabled`          | `boolean`        | Whether or not the input should be disabled.\n| `charCounter`       | `boolean`        | **Note: requries `maxLength` to be set.** Display character counter with max length.\n| `outlined`          | `boolean`        | Whether or not to show the material outlined variant.\n| `fullwidth`         | `boolean`        | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n| `helper`            | `string`         | Helper text to display below the input. Display default only when focused.\n| `helperPersistent`  | `boolean`        | Always show the helper text despite focus.\n| `required`          | `boolean`        | Displays error state if value is empty and input is blurred.\n| `maxLength`         | `number`         | Maximum length to accept input.\n| `validationMessage` | `string`         | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n| `pattern`           | `string`         | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `min`               | `number`\\|`string`  | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `max`               | `number`\\|`string`  | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `step`              | `number`\\|`null`    | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n| `autoValidate`      | `boolean`           | Reports validity on input rather than only on blur.\n| `validity`          | `ValidityState` (readonly) | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n| `willValidate`      | `boolean` (readonly)       | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n| `validityTransform` | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n| `validateOnInitialRender` | `boolean`            | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.15.0-canary.072084ab.0","_nodeVersion":"10.19.0","_npmVersion":"lerna/3.20.2/node@v10.19.0+x64 (linux)","dist":{"integrity":"sha512-ncUBzIySzVwqXlHYPXk6eQOG3KO4X8KB9pXZXQ5Jst0LW+rXy+t3fHqr0m0omf4iMVsq5EJlmjg4Xm67AkStCA==","shasum":"783412378ff6dfabfb629ba7f13f0241aaacb182","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.15.0-canary.072084ab.0.tgz","fileCount":20,"unpackedSize":256036,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJehN/wCRA9TVsSAnZWagAAvGkP/AnZ4meHtwi2DDH7l1Km\nerZ7MjraS10qjx1+PG9ftDBmjICuwuH3OvD2tznLUtgEy/izcISHOwzuxbTz\nP1fijyq6EUZi/ViZy4edNZn4g9w6tRPFPytWEEhMTkp9YlVFo44npxav9ppw\nYzFeX3TCGqVtuS73+SBrHmI8jKcC9fdZexsbFLqOcM4zS+N3AIZXNst6xBfB\nfC+1LOhmCQ1dxpaz/Xfef3tLjntdw8TW12ZFSAMAHTEIOpTRX9NOtP3iS8B7\n4DUrKaQ1Aruks9QxxnipgpGZDCXcQdvOHCC7JvllfNxUwOWoyAnBjUPRvB+p\n08HYnb55hYGRvv3PPBDBc2RuXJDqEWOy1d6YYGPfP07MAp3eZTnwZdv2oyBk\nKQm2T7Rk1NkwSeNsBKHTIbiCGGmVV69iKdo+jsUB9mQFgrDkJvnvicTHD+zP\nQSaBnHti6iS4fJKVmYJ1adKIMpQ/WygXBszOSC1pnoEGhLYA0CMdqSusngW2\ntVfBv2PXJqglhtCsK1DqMdu2x5qqPaOycMBhQldvqJbR+mzlRZ71v4WHS+rn\nHifbmM9oR85WLKHkO0SYwhO6sqDMukeMiAKc1B05LBVLN05+3SPNHc3oUv3U\nhmO1eljNn2ScuoXlCKdNuX+CDocrvmT/uQIJtZu9evNgSUY3G3aIW6uGAm54\nhGLy\r\n=5hQe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDUHV7ISpExum+DzKHKixPgD7brFnspcXdx1hj6eW8NvwIhAPrxflGvt4WTX38nDoyEopZsaJkkwr+nV5k7b8pgF9jg"}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.15.0-canary.072084ab.0_1585766384281_0.8466326981553598"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.15.0-canary.4dec04af.0":{"name":"@material/mwc-textfield","version":"0.15.0-canary.4dec04af.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.f1f8e60.0","@material/line-ripple":"=6.0.0-canary.f1f8e60.0","@material/mwc-base":"0.15.0-canary.4dec04af.0","@material/mwc-floating-label":"0.15.0-canary.4dec04af.0","@material/mwc-icon":"0.15.0-canary.4dec04af.0","@material/mwc-line-ripple":"0.15.0-canary.4dec04af.0","@material/mwc-notched-outline":"0.15.0-canary.4dec04af.0","@material/shape":"=6.0.0-canary.f1f8e60.0","@material/textfield":"=6.0.0-canary.f1f8e60.0","@material/theme":"=6.0.0-canary.f1f8e60.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"5d47dd9ed52c3dc1e1895467031d4a7a1df6cedd","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5d47dd9ed52c3dc1e1895467031d4a7a1df6cedd/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5d47dd9ed52c3dc1e1895467031d4a7a1df6cedd/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5d47dd9ed52c3dc1e1895467031d4a7a1df6cedd/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5d47dd9ed52c3dc1e1895467031d4a7a1df6cedd/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5d47dd9ed52c3dc1e1895467031d4a7a1df6cedd/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5d47dd9ed52c3dc1e1895467031d4a7a1df6cedd/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5d47dd9ed52c3dc1e1895467031d4a7a1df6cedd/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5d47dd9ed52c3dc1e1895467031d4a7a1df6cedd/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5d47dd9ed52c3dc1e1895467031d4a7a1df6cedd/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5d47dd9ed52c3dc1e1895467031d4a7a1df6cedd/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5d47dd9ed52c3dc1e1895467031d4a7a1df6cedd/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\n| Name                | Type             | Description\n| ------------------- | ---------------- |------------\n| `value`             | `string`         | The input control's value.\n| `type`              | `TextFieldType*` | A string specifying the type of control to render.\n| `label`             | `string`         | Sets floating label value.\n| `placeholder`       | `string`         | Sets disappearing input placeholder.\n| `icon`              | `string`         | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `iconTrailing`      | `string`         | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `disabled`          | `boolean`        | Whether or not the input should be disabled.\n| `charCounter`       | `boolean`        | **Note: requries `maxLength` to be set.** Display character counter with max length.\n| `outlined`          | `boolean`        | Whether or not to show the material outlined variant.\n| `fullwidth`         | `boolean`        | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n| `helper`            | `string`         | Helper text to display below the input. Display default only when focused.\n| `helperPersistent`  | `boolean`        | Always show the helper text despite focus.\n| `required`          | `boolean`        | Displays error state if value is empty and input is blurred.\n| `maxLength`         | `number`         | Maximum length to accept input.\n| `validationMessage` | `string`         | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n| `pattern`           | `string`         | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `min`               | `number`\\|`string`  | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `max`               | `number`\\|`string`  | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `step`              | `number`\\|`null`    | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n| `autoValidate`      | `boolean`           | Reports validity on input rather than only on blur.\n| `validity`          | `ValidityState` (readonly) | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n| `willValidate`      | `boolean` (readonly)       | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n| `validityTransform` | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n| `validateOnInitialRender` | `boolean`            | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.15.0-canary.4dec04af.0","_nodeVersion":"10.19.0","_npmVersion":"lerna/3.20.2/node@v10.19.0+x64 (linux)","dist":{"integrity":"sha512-WaPnn4xFFFGwAf9YaQ/BbQ/HTEf+flikmmH8vq1dRnWaBy0dSVV2fW+XZeWZE/xkHNL+84jSIjhYqwKb2QZ0vQ==","shasum":"a6c63f01a3bf9c84b2db9550c62e683b5c51f6ea","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.15.0-canary.4dec04af.0.tgz","fileCount":20,"unpackedSize":254590,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeh5y0CRA9TVsSAnZWagAAfu4P+QE2elnHo/i8dzUq+jaT\n5nbr2Ix9sl8BcSxdUuXODjN11BD5yyS/vOpPLeLHSj/0RBbCICJifqy+twpW\n7Ja05J8CmbZYObL18+8RCLEiUEc7SZtFZFTq/zjfcMqoa1/AzURgMMMZUBV3\nMi5iGqyBc6R0NjScSkpzZFgwl5u6/FT8CbhMY9GcNBpLPEvf1krIeX360W7O\nEX0vCJsAYu94oCh+aBeIj8suZGfzETHHVUES5NLhvFvWis7bwtxZcrpEyoo0\nQIsWX5bNNW7bZjtmEI4Z4v0M/UyZZTSNP26LeTc9WTVv+S/XXpCvq4m5KSVr\nBYrRHwgKAtraxoXibJNajwSKRTyeehN64ssyQMSGvLc9AFaB/RSYU54jLVVo\n8orSiDq8DxPopGwDfoCxdw2qvAb3WYn+j00G8OO0ogktaV5M9AZhe0sPzllR\nz3w+6ecVKOI0991/Hz3wS0BPWjxNHn4B1ddwtfTcyDxX35SRMI0CGU1agmTA\nkaaRF6h6ExQKNnLT0i/pszfCUNiZNcZcCQsvsdPbnOqg0JrWeQiwvcsYGKnG\nbUt1+AlHutj3jenbeuOeoRHRA3zqHNDXh3G3I6PHx5D67wFwetsKnAnPVMNm\n0On02N1s+XHkQXCL5OhBF+eLvJKqVgQNR4AaImh5Vk0A7AcqFWUKqK40dakD\n4u5f\r\n=A5zR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFJQbJmM1LUzxHMoEgm1rMUE2WOQlQFr84A4IvfyUlDTAiAfLBFK6b1vtKhm7ot+XTxSY50RJ7WfxEDPnK9X8CwVWA=="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.15.0-canary.4dec04af.0_1585945780121_0.6379765066678185"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.15.0-canary.9b676354.0":{"name":"@material/mwc-textfield","version":"0.15.0-canary.9b676354.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.e84b9c8.0","@material/line-ripple":"=6.0.0-canary.e84b9c8.0","@material/mwc-base":"0.15.0-canary.9b676354.0","@material/mwc-floating-label":"0.15.0-canary.9b676354.0","@material/mwc-icon":"0.15.0-canary.9b676354.0","@material/mwc-line-ripple":"0.15.0-canary.9b676354.0","@material/mwc-notched-outline":"0.15.0-canary.9b676354.0","@material/shape":"=6.0.0-canary.e84b9c8.0","@material/textfield":"=6.0.0-canary.e84b9c8.0","@material/theme":"=6.0.0-canary.e84b9c8.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"423f1ad2d234953804097bdb30484154440adc63","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/423f1ad2d234953804097bdb30484154440adc63/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/423f1ad2d234953804097bdb30484154440adc63/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/423f1ad2d234953804097bdb30484154440adc63/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/423f1ad2d234953804097bdb30484154440adc63/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/423f1ad2d234953804097bdb30484154440adc63/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/423f1ad2d234953804097bdb30484154440adc63/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/423f1ad2d234953804097bdb30484154440adc63/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/423f1ad2d234953804097bdb30484154440adc63/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/423f1ad2d234953804097bdb30484154440adc63/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/423f1ad2d234953804097bdb30484154440adc63/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/423f1ad2d234953804097bdb30484154440adc63/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\n| Name                | Type             | Description\n| ------------------- | ---------------- |------------\n| `value`             | `string`         | The input control's value.\n| `type`              | `TextFieldType*` | A string specifying the type of control to render.\n| `label`             | `string`         | Sets floating label value.\n| `placeholder`       | `string`         | Sets disappearing input placeholder.\n| `icon`              | `string`         | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `iconTrailing`      | `string`         | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `disabled`          | `boolean`        | Whether or not the input should be disabled.\n| `charCounter`       | `boolean`        | **Note: requries `maxLength` to be set.** Display character counter with max length.\n| `outlined`          | `boolean`        | Whether or not to show the material outlined variant.\n| `fullwidth`         | `boolean`        | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n| `helper`            | `string`         | Helper text to display below the input. Display default only when focused.\n| `helperPersistent`  | `boolean`        | Always show the helper text despite focus.\n| `required`          | `boolean`        | Displays error state if value is empty and input is blurred.\n| `maxLength`         | `number`         | Maximum length to accept input.\n| `validationMessage` | `string`         | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n| `pattern`           | `string`         | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `min`               | `number`\\|`string`  | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `max`               | `number`\\|`string`  | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `step`              | `number`\\|`null`    | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n| `autoValidate`      | `boolean`           | Reports validity on input rather than only on blur.\n| `validity`          | `ValidityState` (readonly) | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n| `willValidate`      | `boolean` (readonly)       | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n| `validityTransform` | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n| `validateOnInitialRender` | `boolean`            | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.15.0-canary.9b676354.0","_nodeVersion":"10.19.0","_npmVersion":"lerna/3.20.2/node@v10.19.0+x64 (linux)","dist":{"integrity":"sha512-W1A0gNeTWC2X8O2Wk/YJF1eisBG39XTDtLFdh7IaILpB6maqyTIjvFwNJBSKe35vh7WOpRbzp55sdr8zEY309g==","shasum":"4a31d5e060ce8b72a3aebfd3f7f0c679ca8a429f","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.15.0-canary.9b676354.0.tgz","fileCount":20,"unpackedSize":256036,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeh5zHCRA9TVsSAnZWagAAj8IP/0YDfAOIMX1OFLp370+D\nbTGHtR9+MzeQFYgSxaimJcTGKeJEiMM8MntWEHljPTHCGkDa8+seA/CChf3G\n46m7nvi7jL3W7MQaxdfTy0PLrydxsjlRakwiaArH6nu5fw52wo/iO3PO0fDZ\nh7GR0apJlVZMQ8DN47en4qeo39clK+3F8cLi3eeRolhU0Mxug8Cd0gCtWNAm\nbBy7u5hQnYGw4yN0c9/pNyAsS/Yv+EqD0N1OSxNUHOpyiPB10cywSYMI4aFC\n+N51iZjc/TJtd1iM+E0XuztetHSqA8VEAnCEOFc3i/5M06f06MgFJSK1l2UG\ndjEwJyxkPoY2Q7yEcYD+t4ekqJKhZ5Hhe8O8DmO8rTE/S6YH6YZjcpt0I43+\n/wcmHNGllZuIteHY2RlwWTuuMJeSMEEDgnV6PSwjLboFhiBTBbd/2GOmS9C6\nnnxE03t5B7GrSKVzpUhMh7ctLPiylbyDaGyahuTc0kIeNevGDOvv/SQCDQJL\nDS21Ok0MPxfmhiTKqcHhZU27YFONfLjKVTzsC0O2d4HRi+umP1W3Pt0Bj7MS\nbL3MyxyxH6ZsyBQy9WiPhFV5e+LvV+7x8YJYS1BpHySrrj/pv9LHwKNYF2A8\nQYX9GuHcrOcrKD4gs994TvAWgec1cmHDHz6XGcd1lBHwlnUMeJwW3ACMQ5b2\n/RkS\r\n=1qwK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDhCa3Urmg56XCoKZOEWE8Gif6ty8+kapocoK8RtFi2EAiEAljRKJdAVEFy4igEhc7/ZoInJANVtakNMlQTd37/atzE="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.15.0-canary.9b676354.0_1585945798474_0.8253905211097123"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.15.0-canary.6b946095.0":{"name":"@material/mwc-textfield","version":"0.15.0-canary.6b946095.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.f1f8e60.0","@material/line-ripple":"=6.0.0-canary.f1f8e60.0","@material/mwc-base":"0.15.0-canary.6b946095.0","@material/mwc-floating-label":"0.15.0-canary.6b946095.0","@material/mwc-icon":"0.15.0-canary.6b946095.0","@material/mwc-line-ripple":"0.15.0-canary.6b946095.0","@material/mwc-notched-outline":"0.15.0-canary.6b946095.0","@material/shape":"=6.0.0-canary.f1f8e60.0","@material/textfield":"=6.0.0-canary.f1f8e60.0","@material/theme":"=6.0.0-canary.f1f8e60.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"1b65dfb6b4d3dea0ac5681487459f46352e399e2","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1b65dfb6b4d3dea0ac5681487459f46352e399e2/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1b65dfb6b4d3dea0ac5681487459f46352e399e2/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1b65dfb6b4d3dea0ac5681487459f46352e399e2/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1b65dfb6b4d3dea0ac5681487459f46352e399e2/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1b65dfb6b4d3dea0ac5681487459f46352e399e2/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1b65dfb6b4d3dea0ac5681487459f46352e399e2/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1b65dfb6b4d3dea0ac5681487459f46352e399e2/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1b65dfb6b4d3dea0ac5681487459f46352e399e2/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1b65dfb6b4d3dea0ac5681487459f46352e399e2/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1b65dfb6b4d3dea0ac5681487459f46352e399e2/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1b65dfb6b4d3dea0ac5681487459f46352e399e2/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\n| Name                | Type             | Description\n| ------------------- | ---------------- |------------\n| `value`             | `string`         | The input control's value.\n| `type`              | `TextFieldType*` | A string specifying the type of control to render.\n| `label`             | `string`         | Sets floating label value.\n| `placeholder`       | `string`         | Sets disappearing input placeholder.\n| `icon`              | `string`         | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `iconTrailing`      | `string`         | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `disabled`          | `boolean`        | Whether or not the input should be disabled.\n| `charCounter`       | `boolean`        | **Note: requries `maxLength` to be set.** Display character counter with max length.\n| `outlined`          | `boolean`        | Whether or not to show the material outlined variant.\n| `fullwidth`         | `boolean`        | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n| `helper`            | `string`         | Helper text to display below the input. Display default only when focused.\n| `helperPersistent`  | `boolean`        | Always show the helper text despite focus.\n| `required`          | `boolean`        | Displays error state if value is empty and input is blurred.\n| `maxLength`         | `number`         | Maximum length to accept input.\n| `validationMessage` | `string`         | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n| `pattern`           | `string`         | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `min`               | `number`\\|`string`  | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `max`               | `number`\\|`string`  | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `step`              | `number`\\|`null`    | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n| `autoValidate`      | `boolean`           | Reports validity on input rather than only on blur.\n| `validity`          | `ValidityState` (readonly) | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n| `willValidate`      | `boolean` (readonly)       | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n| `validityTransform` | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n| `validateOnInitialRender` | `boolean`            | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.15.0-canary.6b946095.0","_nodeVersion":"10.19.0","_npmVersion":"lerna/3.20.2/node@v10.19.0+x64 (linux)","dist":{"integrity":"sha512-ggWRTLw6lAte0poDRalkLuOv5dulLME6zyaqugaZA31vi8aVSi3NbuTlgA5zGwynvLaV26oJeWi/qJctJjKFuA==","shasum":"9979711cc4d9fcaabcf5303428ed253e52659292","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.15.0-canary.6b946095.0.tgz","fileCount":20,"unpackedSize":254590,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeh6mFCRA9TVsSAnZWagAACusP/0JGH2WkbQHmfBDpq4lF\nI2GkD51pa2upY8KH/QaPPb9ilr4IISvMbe+hkhLgnJlJyXPB++3EBbsZb0u6\nB3GYeJ+upux/mHlDXeRGJaHXrbCaD5dBbjJDNy5ZToXIE84bHnaJ/uaLxcYV\n2Ov0atarueZANl+k0HTliXlD2ZxzdO+1n9B7oMPXi6qVYSjyymH/GkZgvIt7\nc8UBsg2sXq8/HKZ3NJqGZDc4qF7NTvZVZ5OiQLgqW4VTIaktVeSIrtdZn0b3\nvEV+YB2KQWJSJW4m1eD9f4UDJ5MqFNXUl/jQdip6562DvN804VdqxEtQByio\nW0RPXYjlBMUBMgGHVr1+HuKRGDIwItEorK16Vw2OsatsUM5OD4gsfTAwDsJN\nVXAsd9vO13wM8KuFcQQa6d/uasF9jqXADAeswHYk9N7UkSJhSy/g2EW7amAc\nQKDKk5Hv+nL4sliqvkiC2AqdipwIN3tmL/31DXD7j99frop1M2P6+Ee0zoK+\nlbdmW8rPtWiuCTIUAlUF74XeqNn0+p2GtXkpAZdUMdu/G8F97FZ8NYVdbh7d\n6axT0OFy27Zo3hx0jlpwtmliYZx/W+SGlgeemlzaBbE8oUFC5p4CSnAFn7Yx\nazxb8wq/IwVCvGD8euR3iu2CGUEVHGAebCWrAA6o+e7qadXoG9PGsFyT7iXp\nhDvN\r\n=2NeP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDn9NFiya/cbF1QJxEdF9KiR0Z0ozwal6/O2u5djEyMeAIgXwNSCegU+5q/vdtFrSLve22R1lL90etDT1sGfP/H8N4="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.15.0-canary.6b946095.0_1585949061064_0.6897647660153134"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.15.0-canary.5ccbfaa2.0":{"name":"@material/mwc-textfield","version":"0.15.0-canary.5ccbfaa2.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.6a40ef217.0","@material/line-ripple":"=6.0.0-canary.6a40ef217.0","@material/mwc-base":"0.15.0-canary.5ccbfaa2.0","@material/mwc-floating-label":"0.15.0-canary.5ccbfaa2.0","@material/mwc-icon":"0.15.0-canary.5ccbfaa2.0","@material/mwc-line-ripple":"0.15.0-canary.5ccbfaa2.0","@material/mwc-notched-outline":"0.15.0-canary.5ccbfaa2.0","@material/shape":"=6.0.0-canary.6a40ef217.0","@material/textfield":"=6.0.0-canary.6a40ef217.0","@material/theme":"=6.0.0-canary.6a40ef217.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"b20d3f13f2b61c253e28c5f9e5adf15bfe26d88c","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b20d3f13f2b61c253e28c5f9e5adf15bfe26d88c/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b20d3f13f2b61c253e28c5f9e5adf15bfe26d88c/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b20d3f13f2b61c253e28c5f9e5adf15bfe26d88c/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b20d3f13f2b61c253e28c5f9e5adf15bfe26d88c/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b20d3f13f2b61c253e28c5f9e5adf15bfe26d88c/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b20d3f13f2b61c253e28c5f9e5adf15bfe26d88c/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b20d3f13f2b61c253e28c5f9e5adf15bfe26d88c/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b20d3f13f2b61c253e28c5f9e5adf15bfe26d88c/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b20d3f13f2b61c253e28c5f9e5adf15bfe26d88c/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b20d3f13f2b61c253e28c5f9e5adf15bfe26d88c/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b20d3f13f2b61c253e28c5f9e5adf15bfe26d88c/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\n| Name                | Type             | Description\n| ------------------- | ---------------- |------------\n| `value`             | `string`         | The input control's value.\n| `type`              | `TextFieldType*` | A string specifying the type of control to render.\n| `label`             | `string`         | Sets floating label value.\n| `placeholder`       | `string`         | Sets disappearing input placeholder.\n| `icon`              | `string`         | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `iconTrailing`      | `string`         | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `disabled`          | `boolean`        | Whether or not the input should be disabled.\n| `charCounter`       | `boolean`        | **Note: requries `maxLength` to be set.** Display character counter with max length.\n| `outlined`          | `boolean`        | Whether or not to show the material outlined variant.\n| `fullwidth`         | `boolean`        | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n| `helper`            | `string`         | Helper text to display below the input. Display default only when focused.\n| `helperPersistent`  | `boolean`        | Always show the helper text despite focus.\n| `required`          | `boolean`        | Displays error state if value is empty and input is blurred.\n| `maxLength`         | `number`         | Maximum length to accept input.\n| `validationMessage` | `string`         | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n| `pattern`           | `string`         | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `min`               | `number`\\|`string`  | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `max`               | `number`\\|`string`  | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `step`              | `number`\\|`null`    | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n| `autoValidate`      | `boolean`           | Reports validity on input rather than only on blur.\n| `validity`          | `ValidityState` (readonly) | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n| `willValidate`      | `boolean` (readonly)       | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n| `validityTransform` | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n| `validateOnInitialRender` | `boolean`            | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.15.0-canary.5ccbfaa2.0","_nodeVersion":"10.19.0","_npmVersion":"lerna/3.20.2/node@v10.19.0+x64 (linux)","dist":{"integrity":"sha512-ynWrH/x00d73I+UIxRF2VxEK0CigmYBtaH9lO1jMwidaiji1N1StrvRpKGDlArY1GpwgpugD2DfBdWnE38R15A==","shasum":"8f1b6be45d5b0ca136517bb186a142e213a29099","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.15.0-canary.5ccbfaa2.0.tgz","fileCount":20,"unpackedSize":254600,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeh6rRCRA9TVsSAnZWagAAReoP/3cFdg/U/k4SUr5n6H7u\nfZrVAEZTqkVsFvCa1VwIIlPJEFiUO0OY93h/nV1Xvxc6o3KNU5F1rXHwsl68\nZaV2nDzyKGOJLb/iGW/hdbI30cuuu/J2KWOTkT/b/8dqSW6hUVeN5jgOa6yk\npclnLo+q8ztKBMTlhDA04ldlEvQDG+hLJjLrqTwwNMoUZb1vW8y7I4bYqUsM\ni/YTSSSQvk0Qu4tjeQnghwN37vb+V3S1yGU9PO85JOX2kV06cfvxeLPL5VtX\n6wnbFaqFSdVoaqw/ClB6mT1odd/7Dxn9OZhbmtyBeTeXQRm8nHnToTS6IN9c\nWmPzX1sNpDemxSzMQ+d6LUeJVgddfMZZAd/7RNrJ4lpmOwoEVVlWVmCyG02H\nobBrz9NAuhYxwy7Y2YuTlPaiimij4BH/JVJ+Ab38tOc74/vTgdU+UqtViB+C\nFwUSXWJmZUubif/y9hgz6CoTx24vAGoxVkh3FjhTqtonSf5ax9jKAoJNwHjn\nKS1J3jNufXzjCaBHxsXo1FkdsRJzc6Z51BpapBUPYKj0ew+0pVVCtSf6cedd\n2JvH/eTHpNW0RkFv4bEdOrUOrel8Oq1gtdR/mQwUM0bMhrEHeG8FvljRZ6WM\n7wReXurjZFVP7cXhW182Mg2mSPNSQY69Kt+iofeONmNe2/LbJ73J3s8yCxvP\nSmCs\r\n=ZxLP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFefEc92jpOTRudTpfR/aPaMpT/OL0U5gGDbb7uluzPMAiAuVB4hQxcUsB2N2xy7oobAzgKKz7zEF2zwW4QA5OXjXA=="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.15.0-canary.5ccbfaa2.0_1585949393266_0.032122801768318165"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.15.0-canary.a0ab8772.0":{"name":"@material/mwc-textfield","version":"0.15.0-canary.a0ab8772.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.6a40ef217.0","@material/line-ripple":"=6.0.0-canary.6a40ef217.0","@material/mwc-base":"0.15.0-canary.a0ab8772.0","@material/mwc-floating-label":"0.15.0-canary.a0ab8772.0","@material/mwc-icon":"0.15.0-canary.a0ab8772.0","@material/mwc-line-ripple":"0.15.0-canary.a0ab8772.0","@material/mwc-notched-outline":"0.15.0-canary.a0ab8772.0","@material/shape":"=6.0.0-canary.6a40ef217.0","@material/textfield":"=6.0.0-canary.6a40ef217.0","@material/theme":"=6.0.0-canary.6a40ef217.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"a7db0e2fe222d87e1ee22c0515cbf02cad4b1cc0","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a7db0e2fe222d87e1ee22c0515cbf02cad4b1cc0/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a7db0e2fe222d87e1ee22c0515cbf02cad4b1cc0/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a7db0e2fe222d87e1ee22c0515cbf02cad4b1cc0/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a7db0e2fe222d87e1ee22c0515cbf02cad4b1cc0/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a7db0e2fe222d87e1ee22c0515cbf02cad4b1cc0/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a7db0e2fe222d87e1ee22c0515cbf02cad4b1cc0/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a7db0e2fe222d87e1ee22c0515cbf02cad4b1cc0/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a7db0e2fe222d87e1ee22c0515cbf02cad4b1cc0/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a7db0e2fe222d87e1ee22c0515cbf02cad4b1cc0/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a7db0e2fe222d87e1ee22c0515cbf02cad4b1cc0/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a7db0e2fe222d87e1ee22c0515cbf02cad4b1cc0/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\n| Name                | Type             | Description\n| ------------------- | ---------------- |------------\n| `value`             | `string`         | The input control's value.\n| `type`              | `TextFieldType*` | A string specifying the type of control to render.\n| `label`             | `string`         | Sets floating label value.\n| `placeholder`       | `string`         | Sets disappearing input placeholder.\n| `icon`              | `string`         | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `iconTrailing`      | `string`         | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `disabled`          | `boolean`        | Whether or not the input should be disabled.\n| `charCounter`       | `boolean`        | **Note: requries `maxLength` to be set.** Display character counter with max length.\n| `outlined`          | `boolean`        | Whether or not to show the material outlined variant.\n| `fullwidth`         | `boolean`        | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n| `helper`            | `string`         | Helper text to display below the input. Display default only when focused.\n| `helperPersistent`  | `boolean`        | Always show the helper text despite focus.\n| `required`          | `boolean`        | Displays error state if value is empty and input is blurred.\n| `maxLength`         | `number`         | Maximum length to accept input.\n| `validationMessage` | `string`         | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n| `pattern`           | `string`         | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `min`               | `number`\\|`string`  | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `max`               | `number`\\|`string`  | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `step`              | `number`\\|`null`    | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n| `autoValidate`      | `boolean`           | Reports validity on input rather than only on blur.\n| `validity`          | `ValidityState` (readonly) | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n| `willValidate`      | `boolean` (readonly)       | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n| `validityTransform` | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n| `validateOnInitialRender` | `boolean`            | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.15.0-canary.a0ab8772.0","_nodeVersion":"10.19.0","_npmVersion":"lerna/3.20.2/node@v10.19.0+x64 (linux)","dist":{"integrity":"sha512-0fhPGjrj9QkUvRxWHJ37uxyYmvy0sAfArquaX5DBJ/Sg1TzlVlWGrsisVzWE2UtsMfWlqlejhG1PEiQ6cu3RDw==","shasum":"40b9b10270d88ec605b0cf92b6a033b3bf7e7c1a","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.15.0-canary.a0ab8772.0.tgz","fileCount":20,"unpackedSize":254600,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJejN3fCRA9TVsSAnZWagAABHQP/ibxdd+ap1xLp8GuVuKR\nrWFpycXnrKsC7iuzbHeVJ53cS8UqC+Hj6QLfOACVYkxwMkfXSSG9EPJeQXwt\nffpaGrUMrLOD6ih4LTuDz8w3c8VPpatwe6RbJRyzfs8XZozb7pTcQFgYemmn\nO6R2uNEwAzOG3p/aN46joUfVxvlauQxXDc/Nu8USP9h2XmO1avKA4FK2XjOs\nZIsTfIQT+r7EwTVG6Cx5rX1Om72VWrAwkwHdrGT9yO/zlX3KkSxX3+4a8lWx\n1Qlv3oAJ4BsZAvJQRZqq1w+dMZwYGZl2pi03l4dnPOTrHruXhFZCzLey6fdA\nhk5XICwIdnhgEDeCnM+4yphDNoPZsgJgDq4CEolefTUHWHdTbXll4jaA1XAc\nTr8r1yq71iXt8uxz/OuvyiDMLZVmvbJb7MHwuWBM42l1K0SxkNQRfTs7UaSY\nknui0dqj+rZuNs42+Z2CTbJLUVrVal4BFgwunGPmE60qxPyo9a095Tvw8Kc2\nQXhW2VYFkp9qIXzH29iYsLNNCNgIyZ5rsAgCMLNYmOkxhVdsAP4GO/aJ87MH\nuyqgP4mjjjS87MkY/pHryv412j2z/+qWpVvts7abS/1/vPLA5Gr18mF3xpwF\nMB8fHBAvpPoadQ0j+D3/OQM6rjV0Qb0CSyrDiafDETJ/CC9nPFCeK6c07Mw0\npkIr\r\n=AbXz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGfdQgxjauHndoOcgtyldrwCKjye//9BDQWeYPk1VgSlAiBXMXaNP4hdLhhxnTV/U38dEIhOgcl+wVBL5GEejOLvQg=="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.15.0-canary.a0ab8772.0_1586290143215_0.0834685204775869"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.15.0-canary.8d352305.0":{"name":"@material/mwc-textfield","version":"0.15.0-canary.8d352305.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.6a40ef217.0","@material/line-ripple":"=6.0.0-canary.6a40ef217.0","@material/mwc-base":"0.15.0-canary.8d352305.0","@material/mwc-floating-label":"0.15.0-canary.8d352305.0","@material/mwc-icon":"0.15.0-canary.8d352305.0","@material/mwc-line-ripple":"0.15.0-canary.8d352305.0","@material/mwc-notched-outline":"0.15.0-canary.8d352305.0","@material/shape":"=6.0.0-canary.6a40ef217.0","@material/textfield":"=6.0.0-canary.6a40ef217.0","@material/theme":"=6.0.0-canary.6a40ef217.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"d38e537751f3d38d903a5c7c03910a26cd301f20","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d38e537751f3d38d903a5c7c03910a26cd301f20/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d38e537751f3d38d903a5c7c03910a26cd301f20/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d38e537751f3d38d903a5c7c03910a26cd301f20/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d38e537751f3d38d903a5c7c03910a26cd301f20/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d38e537751f3d38d903a5c7c03910a26cd301f20/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d38e537751f3d38d903a5c7c03910a26cd301f20/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d38e537751f3d38d903a5c7c03910a26cd301f20/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d38e537751f3d38d903a5c7c03910a26cd301f20/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d38e537751f3d38d903a5c7c03910a26cd301f20/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d38e537751f3d38d903a5c7c03910a26cd301f20/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d38e537751f3d38d903a5c7c03910a26cd301f20/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\n| Name                | Type             | Description\n| ------------------- | ---------------- |------------\n| `value`             | `string`         | The input control's value.\n| `type`              | `TextFieldType*` | A string specifying the type of control to render.\n| `label`             | `string`         | Sets floating label value.\n| `placeholder`       | `string`         | Sets disappearing input placeholder.\n| `icon`              | `string`         | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `iconTrailing`      | `string`         | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `disabled`          | `boolean`        | Whether or not the input should be disabled.\n| `charCounter`       | `boolean`        | **Note: requries `maxLength` to be set.** Display character counter with max length.\n| `outlined`          | `boolean`        | Whether or not to show the material outlined variant.\n| `fullwidth`         | `boolean`        | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n| `helper`            | `string`         | Helper text to display below the input. Display default only when focused.\n| `helperPersistent`  | `boolean`        | Always show the helper text despite focus.\n| `required`          | `boolean`        | Displays error state if value is empty and input is blurred.\n| `maxLength`         | `number`         | Maximum length to accept input.\n| `validationMessage` | `string`         | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n| `pattern`           | `string`         | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `min`               | `number`\\|`string`  | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `max`               | `number`\\|`string`  | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `step`              | `number`\\|`null`    | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n| `autoValidate`      | `boolean`           | Reports validity on input rather than only on blur.\n| `validity`          | `ValidityState` (readonly) | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n| `willValidate`      | `boolean` (readonly)       | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n| `validityTransform` | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n| `validateOnInitialRender` | `boolean`            | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.15.0-canary.8d352305.0","_nodeVersion":"10.19.0","_npmVersion":"lerna/3.20.2/node@v10.19.0+x64 (linux)","dist":{"integrity":"sha512-5Z5dPJmfmks3XZn6oji4t7OUzv1VzLsrKOQ/hxAjUatDjoB6SEIRM2tUmpIix0MlsJZvKNRqLvXriz92YnrUKQ==","shasum":"f5225ae76cad3814bc2ba3165d4755fe2b30f36e","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.15.0-canary.8d352305.0.tgz","fileCount":20,"unpackedSize":254600,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJejPOmCRA9TVsSAnZWagAAHU8P/0pp6Bx1IMXmKjyhrMQq\nnGr/NW1kjL5qRZf7x4ng6RCarsPiOBwOL4oraAwEHitr6+7NAODGRv+17srh\nhJVTefI9NcFmEialik1IH5qs8+zjweAq6IFTS5fnuQa7bTpxvc7UKQEQXijg\nW8U8JQn4CVrFE6gaoY9JIY+Q4Ma6q+8iU4MpACmgrGKB8C0Byrcjh0wns/DE\nUwa+4nlMgklavdSQMPfVdq3ji+z8CqS2VBYrF1qUG+jcarnWycf9SVcqXdOD\n5ZS4ezwGcg2aUwtBtlUCgdH9fRnViDiL58bz2u5B/gIaqKBUIksfU40OHQrI\n0SqtYIqkvQize4UeqjKEt3X2dfbm9rIWze1uSMjw8mdRUDCGBYeZ5A0WmvIW\ntn6H22DG1qmpUGxm1RqPI55bdqoQKOYEbw0wPk+U9+TECfn1utrtRrDBpjFC\nhg3nO45rKXg8O65Q8RM7PstAgau70hZ7jZ2tRWYcBxWKJLZJrP6jVBHzgzrs\ngPTmdMCKNgxGHMqWN/JHHzFbizpFMOwDOZes/4ZPYYTEzYrRLkSRM0IoLF8e\nlO/beRAp5RkwXZZyOZNWXaK+YeaNcupKVfT0+HLpVu9x0fF/Ro9wrWo9pZmx\nAIs3K2wQfum0UDaBPP9AWmVCPmJZDuG+PxiIHiXkyG50gT5aV0FB2b3joX/L\n5u/4\r\n=Zo/l\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHZ0/zw7TqexUNe1ouydnDosVS6ED98zMYKzvoAoEM+AAiBLCwBhf8CWm9rl7HprfoxZW0CPLGjC3lvjL6mtcq1Rcg=="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.15.0-canary.8d352305.0_1586295717605_0.14059327518099796"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.15.0-canary.31eac79f.0":{"name":"@material/mwc-textfield","version":"0.15.0-canary.31eac79f.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.6a40ef217.0","@material/line-ripple":"=6.0.0-canary.6a40ef217.0","@material/mwc-base":"0.15.0-canary.31eac79f.0","@material/mwc-floating-label":"0.15.0-canary.31eac79f.0","@material/mwc-icon":"0.15.0-canary.31eac79f.0","@material/mwc-line-ripple":"0.15.0-canary.31eac79f.0","@material/mwc-notched-outline":"0.15.0-canary.31eac79f.0","@material/shape":"=6.0.0-canary.6a40ef217.0","@material/textfield":"=6.0.0-canary.6a40ef217.0","@material/theme":"=6.0.0-canary.6a40ef217.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"fc47d0412882f860dc7dc010657ade07c9a0215b","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/fc47d0412882f860dc7dc010657ade07c9a0215b/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/fc47d0412882f860dc7dc010657ade07c9a0215b/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/fc47d0412882f860dc7dc010657ade07c9a0215b/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/fc47d0412882f860dc7dc010657ade07c9a0215b/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/fc47d0412882f860dc7dc010657ade07c9a0215b/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/fc47d0412882f860dc7dc010657ade07c9a0215b/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/fc47d0412882f860dc7dc010657ade07c9a0215b/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/fc47d0412882f860dc7dc010657ade07c9a0215b/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/fc47d0412882f860dc7dc010657ade07c9a0215b/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/fc47d0412882f860dc7dc010657ade07c9a0215b/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/fc47d0412882f860dc7dc010657ade07c9a0215b/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\n| Name                | Type             | Description\n| ------------------- | ---------------- |------------\n| `value`             | `string`         | The input control's value.\n| `type`              | `TextFieldType*` | A string specifying the type of control to render.\n| `label`             | `string`         | Sets floating label value.\n| `placeholder`       | `string`         | Sets disappearing input placeholder.\n| `icon`              | `string`         | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `iconTrailing`      | `string`         | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `disabled`          | `boolean`        | Whether or not the input should be disabled.\n| `charCounter`       | `boolean`        | **Note: requries `maxLength` to be set.** Display character counter with max length.\n| `outlined`          | `boolean`        | Whether or not to show the material outlined variant.\n| `fullwidth`         | `boolean`        | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n| `helper`            | `string`         | Helper text to display below the input. Display default only when focused.\n| `helperPersistent`  | `boolean`        | Always show the helper text despite focus.\n| `required`          | `boolean`        | Displays error state if value is empty and input is blurred.\n| `maxLength`         | `number`         | Maximum length to accept input.\n| `validationMessage` | `string`         | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n| `pattern`           | `string`         | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `min`               | `number`\\|`string`  | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `max`               | `number`\\|`string`  | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `step`              | `number`\\|`null`    | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n| `autoValidate`      | `boolean`           | Reports validity on input rather than only on blur.\n| `validity`          | `ValidityState` (readonly) | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n| `willValidate`      | `boolean` (readonly)       | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n| `validityTransform` | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n| `validateOnInitialRender` | `boolean`            | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.15.0-canary.31eac79f.0","_nodeVersion":"10.19.0","_npmVersion":"lerna/3.20.2/node@v10.19.0+x64 (linux)","dist":{"integrity":"sha512-yjkt4qsS769o2tszvYAzhgahT5SB/Jkk4B7+p3C46hdPlDJ8/4bDeKFW8e0Wyk2daEKwT9yZJyN2S06+4c7sHw==","shasum":"cfadb9c452ef4a76dddd5468771c95bfcf6c5c3c","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.15.0-canary.31eac79f.0.tgz","fileCount":20,"unpackedSize":254600,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJejPdFCRA9TVsSAnZWagAA2RgP/AokEjmsFGm5hZhEyJd4\nryLZ6qKXbPd+hR0Ut1sdGDafmS5VA02A8qPWgJTRWIzyFJLk7CtsJJiS+uzz\nt9Cg9/eVOcFH7/Fjxjk33e1HNUcy4O91j37b7HkrCVlHFiotW+WESC8EHQCA\nJsiYqjUTUL/lEwiUZWRZHli4nmOtvYxvBJtElUntTTMCdltK4PZhAl1t0Npt\nLH8Fo6qmH656b3LMDs2tQhOOkVw+a5KapQ4gnq+xsZXPEZ5z3SLTiJ/GBf+F\nS36ee+obFr8GSGtnXSWOehsYWSeRLuTprrqDhFJNw1cM3JiU8JJslIt90HIq\nc8BwFSr/bjzu06GxdD0sTomUHcSeQF4GpltUob68Htx3H/9nzToQbjJJ19Ie\nWxAX9vkYchgB1v7W7kEVgnhbSmM/zCNpa9QR4+YfVds5EPDw0gpNQcHMokf3\neECKbKKYGot4YZkHm2h/fvckwFnqZv6/bAEyh8a4agZoPNGEwbprAC/XcaiT\n102/0dedVk84j0EVGZbnosrG+bpD6KzgCrQ6wn0YzVIwHAaveHlC202smM/v\nm44dO4serpJhDKJ3XZRx5HDTvmzpAqPyMQwVS2R++/0QC/UDJNuS/tMz+Lkw\nT2EAIXKszkMr3QzHb/MYFjp20sbAf/RAhLpvdcoFXTgLb9T+QKKL+ZBRqpOT\ndFQf\r\n=lw5A\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCcIQkvF4uAdPV4dtyKUL2O/qepFynVyUn0SErkjL7k3gIgMeCRD++t8RFt2FJDcVkAzhMfROozuRg3531QmiVS6rQ="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.15.0-canary.31eac79f.0_1586296644853_0.9587803143011844"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.15.0-canary.ba05565e.0":{"name":"@material/mwc-textfield","version":"0.15.0-canary.ba05565e.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.6a40ef217.0","@material/line-ripple":"=6.0.0-canary.6a40ef217.0","@material/mwc-base":"0.15.0-canary.ba05565e.0","@material/mwc-floating-label":"0.15.0-canary.ba05565e.0","@material/mwc-icon":"0.15.0-canary.ba05565e.0","@material/mwc-line-ripple":"0.15.0-canary.ba05565e.0","@material/mwc-notched-outline":"0.15.0-canary.ba05565e.0","@material/shape":"=6.0.0-canary.6a40ef217.0","@material/textfield":"=6.0.0-canary.6a40ef217.0","@material/theme":"=6.0.0-canary.6a40ef217.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"f03dce4944b4b3fb02a1467dd03f7afc0b279a0a","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f03dce4944b4b3fb02a1467dd03f7afc0b279a0a/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f03dce4944b4b3fb02a1467dd03f7afc0b279a0a/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f03dce4944b4b3fb02a1467dd03f7afc0b279a0a/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f03dce4944b4b3fb02a1467dd03f7afc0b279a0a/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f03dce4944b4b3fb02a1467dd03f7afc0b279a0a/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f03dce4944b4b3fb02a1467dd03f7afc0b279a0a/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f03dce4944b4b3fb02a1467dd03f7afc0b279a0a/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f03dce4944b4b3fb02a1467dd03f7afc0b279a0a/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f03dce4944b4b3fb02a1467dd03f7afc0b279a0a/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f03dce4944b4b3fb02a1467dd03f7afc0b279a0a/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f03dce4944b4b3fb02a1467dd03f7afc0b279a0a/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\n| Name                | Type             | Description\n| ------------------- | ---------------- |------------\n| `value`             | `string`         | The input control's value.\n| `type`              | `TextFieldType*` | A string specifying the type of control to render.\n| `label`             | `string`         | Sets floating label value.\n| `placeholder`       | `string`         | Sets disappearing input placeholder.\n| `icon`              | `string`         | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `iconTrailing`      | `string`         | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `disabled`          | `boolean`        | Whether or not the input should be disabled.\n| `charCounter`       | `boolean`        | **Note: requries `maxLength` to be set.** Display character counter with max length.\n| `outlined`          | `boolean`        | Whether or not to show the material outlined variant.\n| `fullwidth`         | `boolean`        | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n| `helper`            | `string`         | Helper text to display below the input. Display default only when focused.\n| `helperPersistent`  | `boolean`        | Always show the helper text despite focus.\n| `required`          | `boolean`        | Displays error state if value is empty and input is blurred.\n| `maxLength`         | `number`         | Maximum length to accept input.\n| `validationMessage` | `string`         | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n| `pattern`           | `string`         | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `min`               | `number`\\|`string`  | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `max`               | `number`\\|`string`  | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `step`              | `number`\\|`null`    | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n| `autoValidate`      | `boolean`           | Reports validity on input rather than only on blur.\n| `validity`          | `ValidityState` (readonly) | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n| `willValidate`      | `boolean` (readonly)       | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n| `validityTransform` | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n| `validateOnInitialRender` | `boolean`            | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.15.0-canary.ba05565e.0","_nodeVersion":"10.20.0","_npmVersion":"lerna/3.20.2/node@v10.20.0+x64 (linux)","dist":{"integrity":"sha512-Ywb2hF9GCjkhd9VVhjdr7QY/qRLEWhipMPRRT38DyhFXFZWJwsFdFQP5EyWFqVYiMubnQlwz4DgvVI0BrD0EkQ==","shasum":"33dcdfb7d482d080c26de3e658a165a1816d980c","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.15.0-canary.ba05565e.0.tgz","fileCount":20,"unpackedSize":254600,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJejgqtCRA9TVsSAnZWagAAnecP/3h4yWcl1h3/C9RLArL0\nM1C5pUXF6qhC7/t/z1AmE4QyLeGJk0ErpNihc1Ac0q6UxOcxeblIJiu42i2R\nlnHWGmj8+A2iSRv97b2uqD6abaUfSB8lWj4yGh+T8KSCi0bpR+ayLjKBO1hM\nJf0ci6IwPV1GbT8lLNjpu/fcFUegpnzLNGVKeDiRgLvjWCxUHMPT5YqdiBFA\n5QgcVCkg0fcdEfnY7+gRDIdvJPGZ4buc6iYVsDRpTZne5rzXh4nUm1fGq6SU\nmxuhuGwaEwU4hqg28nPQEvZ1VlKG87yQwkvHrknIFkA26LHZrMkk4wNkBLur\nE4zOY3bhI3UF5N9IsTupA9JSAlx6r/qcsOjVBvVMg8JQRsD1MZm0hPIGfOMR\nSLq3Yw2NIItR8Q9/atSFG2xJXZu27peEj63UF6OW2T701sEyKiSOFV3peVYl\nvTVrtcgEa9agHQx5c4OLXU67uGhxqoo8wkWE61bLVNRdKJ8MgNc56GWQTOPp\npzbW4yIsdWTGj6NmMCH8PdxhlJw4p0wKHHXAWSCP63wXm2QbR3n232vlwk0e\nuWyn691XPfiUHT9Wp+fPE7P9iwTjJMNUn+Kgq5+K4RPf8p4MB5GfFMmUMIGi\nCCYPeCfYzQp1WA1ULmwTXJhwYrBkiM5Y1KEjgrAOldgVWcFGdkb6fOxNKRBj\nVzXg\r\n=xw52\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICcuzEgsRDVJKso9D7PvqTTgJSWzn6Ize8zVexUqNZuyAiEAqBa2UkElH6iLO1Oci1Lg3+ENh44BOcWbXcG4jglq0uM="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.15.0-canary.ba05565e.0_1586367148987_0.013553634481521026"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.15.0-canary.25099f79.0":{"name":"@material/mwc-textfield","version":"0.15.0-canary.25099f79.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.9930d9cc5.0","@material/line-ripple":"=6.0.0-canary.9930d9cc5.0","@material/mwc-base":"0.15.0-canary.25099f79.0","@material/mwc-floating-label":"0.15.0-canary.25099f79.0","@material/mwc-icon":"0.15.0-canary.25099f79.0","@material/mwc-line-ripple":"0.15.0-canary.25099f79.0","@material/mwc-notched-outline":"0.15.0-canary.25099f79.0","@material/shape":"=6.0.0-canary.9930d9cc5.0","@material/textfield":"=6.0.0-canary.9930d9cc5.0","@material/theme":"=6.0.0-canary.9930d9cc5.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"d2069c5f3f79653f2526d8fcca853faca1f2cba0","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d2069c5f3f79653f2526d8fcca853faca1f2cba0/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d2069c5f3f79653f2526d8fcca853faca1f2cba0/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d2069c5f3f79653f2526d8fcca853faca1f2cba0/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d2069c5f3f79653f2526d8fcca853faca1f2cba0/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d2069c5f3f79653f2526d8fcca853faca1f2cba0/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d2069c5f3f79653f2526d8fcca853faca1f2cba0/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d2069c5f3f79653f2526d8fcca853faca1f2cba0/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d2069c5f3f79653f2526d8fcca853faca1f2cba0/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d2069c5f3f79653f2526d8fcca853faca1f2cba0/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d2069c5f3f79653f2526d8fcca853faca1f2cba0/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d2069c5f3f79653f2526d8fcca853faca1f2cba0/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\n| Name                | Type             | Description\n| ------------------- | ---------------- |------------\n| `value`             | `string`         | The input control's value.\n| `type`              | `TextFieldType*` | A string specifying the type of control to render.\n| `label`             | `string`         | Sets floating label value.\n| `placeholder`       | `string`         | Sets disappearing input placeholder.\n| `icon`              | `string`         | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `iconTrailing`      | `string`         | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n| `disabled`          | `boolean`        | Whether or not the input should be disabled.\n| `charCounter`       | `boolean`        | **Note: requries `maxLength` to be set.** Display character counter with max length.\n| `outlined`          | `boolean`        | Whether or not to show the material outlined variant.\n| `fullwidth`         | `boolean`        | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n| `helper`            | `string`         | Helper text to display below the input. Display default only when focused.\n| `helperPersistent`  | `boolean`        | Always show the helper text despite focus.\n| `required`          | `boolean`        | Displays error state if value is empty and input is blurred.\n| `maxLength`         | `number`         | Maximum length to accept input.\n| `validationMessage` | `string`         | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n| `pattern`           | `string`         | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `min`               | `number`\\|`string`  | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `max`               | `number`\\|`string`  | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n| `step`              | `number`\\|`null`    | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n| `autoValidate`      | `boolean`           | Reports validity on input rather than only on blur.\n| `validity`          | `ValidityState` (readonly) | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n| `willValidate`      | `boolean` (readonly)       | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n| `validityTransform` | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n| `validateOnInitialRender` | `boolean`            | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.15.0-canary.25099f79.0","_nodeVersion":"10.20.0","_npmVersion":"lerna/3.20.2/node@v10.20.0+x64 (linux)","dist":{"integrity":"sha512-ocDZFHeLCJPJ4UipattWxwrlc2IfmHO0btQgqiOrByRZXBPM4EC8dq+hFbPcs+ycSl3j8Dv4aA5aHEgX+3gnkw==","shasum":"e84fbf3ad3db41f124d355b8f964ea7d130988ee","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.15.0-canary.25099f79.0.tgz","fileCount":20,"unpackedSize":254600,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJejkKACRA9TVsSAnZWagAAzpwQAJOV5O6PU2xVcQzavZ20\nJxVL/HbiT38Ku0pcGXzo4Iyg+dBiz2kxb9huxibEcMoM2JdZKI7Ira7JNYAn\nK1zhwNCCVVq30XSb4dh8biYosJWhdDLYQvU0cxNOB1jVP8SdM+oaHbxHMnWy\n30mv0DK991NBKoFCiopUJOm6ZObXfr48nmsidA3cw2zlF2HuuSQM1V123lHM\nsde18dPHpl+qr/n0NJGo2d9so2jfpBe2Qn2IK7h96gFKlULq4RIWYYcWc0il\ngzQi5fwysrTFNV9kdbOyrcZuJru7FOlHkDCqjkk45T9NS9L4L+biXhZvNlpm\nqqlsBznaw53YEu5aCIYHyCwCTcIMPyZJD9tqfbWDZ0EkrSqmpHvsVayK92o7\nRdR9eJjb9GruigmNVGfdmkmLj5o0rWI87Q7PKlEcb7U67x9Zlpv7sURVPiUf\nmn2ElfcaRJUH91JyYm/fcgmPpO29zV+ifjxrqAcpbmD6p/V8F+tUguzuDZ9w\nC0ylMWtrxMAZCpunl10R4o/MN8s0YRHIRbLLR/vVBfrQiF3zBwEbUWP28CDW\nHjWdkzbUKYfG0ydsRdYcukK7wNUH9QtwaFd6wwYFaPtAfW64+fsEUdCASFlj\nZN0JkqIg4jyrHGyEWnprOUkdEBKpSaelV2XMiKUG9eTThvKsTuE7AqjHiz/U\nrVVg\r\n=rPf7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFuqXbBBbCqZa5+dfmtBv9x1A8gq5CJZu5EtbSn0VDD1AiEAj9oezfx9W6ufMhYqENrRbYEmagSZHrViIsU+UhjZZMM="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.15.0-canary.25099f79.0_1586381440068_0.10043922810151229"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.15.0-canary.447e31c6.0":{"name":"@material/mwc-textfield","version":"0.15.0-canary.447e31c6.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.9930d9cc5.0","@material/line-ripple":"=6.0.0-canary.9930d9cc5.0","@material/mwc-base":"0.15.0-canary.447e31c6.0","@material/mwc-floating-label":"0.15.0-canary.447e31c6.0","@material/mwc-icon":"0.15.0-canary.447e31c6.0","@material/mwc-line-ripple":"0.15.0-canary.447e31c6.0","@material/mwc-notched-outline":"0.15.0-canary.447e31c6.0","@material/shape":"=6.0.0-canary.9930d9cc5.0","@material/textfield":"=6.0.0-canary.9930d9cc5.0","@material/theme":"=6.0.0-canary.9930d9cc5.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"948dcd3d057312750fa0c58715c74d5ae576abb4","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/948dcd3d057312750fa0c58715c74d5ae576abb4/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/948dcd3d057312750fa0c58715c74d5ae576abb4/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/948dcd3d057312750fa0c58715c74d5ae576abb4/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/948dcd3d057312750fa0c58715c74d5ae576abb4/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/948dcd3d057312750fa0c58715c74d5ae576abb4/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/948dcd3d057312750fa0c58715c74d5ae576abb4/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/948dcd3d057312750fa0c58715c74d5ae576abb4/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/948dcd3d057312750fa0c58715c74d5ae576abb4/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/948dcd3d057312750fa0c58715c74d5ae576abb4/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/948dcd3d057312750fa0c58715c74d5ae576abb4/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/948dcd3d057312750fa0c58715c74d5ae576abb4/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.15.0-canary.447e31c6.0","_nodeVersion":"10.20.0","_npmVersion":"lerna/3.20.2/node@v10.20.0+x64 (linux)","dist":{"integrity":"sha512-OE6P5PmHojpCKNIgkIsrYz+GWqLTAWOPoA9yxt9Xm8B1eO/KAyAW8J8uT2ACU2QTAOF3yXaVUgynqNMxVOT2uQ==","shasum":"be4c87515e73ea3bcbabb1e6275d5c7016a6f48b","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.15.0-canary.447e31c6.0.tgz","fileCount":20,"unpackedSize":257571,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJejndtCRA9TVsSAnZWagAAU88P/iT7sWCgFHT8Nyopzy2r\ngVZPpoOVS3/WzgTpsOyg55pPyTnTpDvTfKfAlXk1/GQxTCoxzkpsbwqmr/vj\nb87OF1z3QD/L137S2tQwDRmOR3zB26zy7iiI6W+tKd1l9Uet2suzWB0PSdnz\n7ptubV3CCdYhfcZoB6LusLZ3DhhHm3my89jGfTuDoLt77OcFGeuq7ze4mRRP\nGCK7uaknzCM7ZHaUSrFqWDw4bUv8PnVvgjUIWuDveYA2DJEXDYXFK7z6sW9Q\n/UADEdaxyO1/dgWDOEc4orzMWgP3gwoXqKJyAXnuCw+539mHxyZtadI+x/RR\no+B5DYZkzuWHUQp7aqXcdm8hQAXT4MemuYGhI7UE6/tVE54BKOlw9eKcdFR/\nwsbhjHtsvva0RWnybxf2BI/8xvjwpRaiUrLkrPlgEoMCGyxKlUYHeWcCYo+Q\n1vl3Kr66jrawg7S9rYk5jWN+vMr6a5xPOwLwaOnHRBaMEx5EXmH7cpbHthId\n5wpXEFIrNJA1Jwkrvlk/yNnsf2+zHzIpFCgpmb3yz+VEzNxUJ3ZSDt3145SL\nDuDOgWpIRcDQ9Jf265bZCphe54wo14Svy5t0Ozosn/deHnX4gyoTDqXRKgk/\nE6Ik/wigGUUXrSAdECT8rBlM0bIqA2tCZBipnZIsWFf0Pur3JRT4vjw235Ql\nxn85\r\n=+7aQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCnZHIQAmAynlSsQnWIttChA1X5e49eP2T9/XtXGdhWxgIgMtC8cF3IURQMhOC71u2wdbuP+1+P5Duu+WSXUdt8E6U="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.15.0-canary.447e31c6.0_1586394989391_0.4555932305214865"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.15.0-canary.d6dd84f7.0":{"name":"@material/mwc-textfield","version":"0.15.0-canary.d6dd84f7.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.05f5e1583.0","@material/line-ripple":"=6.0.0-canary.05f5e1583.0","@material/mwc-base":"0.15.0-canary.d6dd84f7.0","@material/mwc-floating-label":"0.15.0-canary.d6dd84f7.0","@material/mwc-icon":"0.15.0-canary.d6dd84f7.0","@material/mwc-line-ripple":"0.15.0-canary.d6dd84f7.0","@material/mwc-notched-outline":"0.15.0-canary.d6dd84f7.0","@material/shape":"=6.0.0-canary.05f5e1583.0","@material/textfield":"=6.0.0-canary.05f5e1583.0","@material/theme":"=6.0.0-canary.05f5e1583.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"74f8e8617851a447758cb395b1e8bd3bf4c8c323","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/74f8e8617851a447758cb395b1e8bd3bf4c8c323/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/74f8e8617851a447758cb395b1e8bd3bf4c8c323/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/74f8e8617851a447758cb395b1e8bd3bf4c8c323/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/74f8e8617851a447758cb395b1e8bd3bf4c8c323/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/74f8e8617851a447758cb395b1e8bd3bf4c8c323/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/74f8e8617851a447758cb395b1e8bd3bf4c8c323/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/74f8e8617851a447758cb395b1e8bd3bf4c8c323/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/74f8e8617851a447758cb395b1e8bd3bf4c8c323/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/74f8e8617851a447758cb395b1e8bd3bf4c8c323/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/74f8e8617851a447758cb395b1e8bd3bf4c8c323/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/74f8e8617851a447758cb395b1e8bd3bf4c8c323/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.15.0-canary.d6dd84f7.0","_nodeVersion":"10.20.0","_npmVersion":"lerna/3.20.2/node@v10.20.0+x64 (linux)","dist":{"integrity":"sha512-MJd3WS4EUl6bXkJH2hdhm6v1ICH9ts4avkybbSmITl0XJMpNOSk6AG3ZEeCGy9FsZ5GjQo6RRuEjaPEzXD0nqQ==","shasum":"5998a0e5564852e2c1d6b76ec2962a9063d1f207","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.15.0-canary.d6dd84f7.0.tgz","fileCount":20,"unpackedSize":264672,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJejnlyCRA9TVsSAnZWagAABpMP/3sB4GwHqjqIDcdMFqGb\n4FgAao0ulpzkotVPanbdUk0sGmBsrzHElmHoMBszuaT/xGCFTqmWGLGgpOWZ\nxQ2zWPkUnuPgBFi0SyzsHj3Ua0lPbjGP8zyeo/jrl5rm0938afWjo1CETeVb\nxgQl4+EcYxPQij0dqTj7lWhcH0iIWZriBKxKvyGtMHdUxTUA1HzvOH0pMTzy\nEb/dGeGXD8n4FXrSsipzL9qeahawyuKVwW7dM0SmngulfGjhS38sIAfy0iic\ny8cygr5M9PN2Tb0Aca/uzoxGfIuLM+9Hhs1NcxvDV+urVje+H8sLHWFKMeSG\nUvQyMCypTxR4jF2mcVdmstCLPPuL+Vww0v0ec4yISmjv+b4wzxV4hXWH2T2D\n790/V1SrpWfP9WKxCM4b4ADCApw1YvG/Bn9wIezijcjHpZk0uop1jEBiehl2\nP9Jp74nN5iuAnGudopV/7rUhTqfYONJhxzVNyXIsKZPZtlWEi+xktDK5KOc+\nJfcnhI0iYg/lrqLGBNdUZE3hnLjkP25PzDg9o/+znlOqmaZiWK73ZgL/Yorx\n0N3EkjIFFOus43hVaCz8WYzL5sycPCrgn+UaS7ZLFBAEpYXlj/v5Pon4uUwE\nrWFD6dy4RlEV27GCqqWLonwi6kjhuW8z1a3c/dM+sOXK9npvUJYDSgMgxePh\nU+C6\r\n=gRIq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICq/3Y88WQBKQ+zpWNWQ7gOY9biNc0rDy7Vusci0d/qFAiEAh27eDPUV1TupELkiFdMbg1zKMlsy2DrF03oL/8Epms4="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.15.0-canary.d6dd84f7.0_1586395506534_0.9775041798712929"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.15.0-canary.9b03ee68.0":{"name":"@material/mwc-textfield","version":"0.15.0-canary.9b03ee68.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.05f5e1583.0","@material/line-ripple":"=6.0.0-canary.05f5e1583.0","@material/mwc-base":"0.15.0-canary.9b03ee68.0","@material/mwc-floating-label":"0.15.0-canary.9b03ee68.0","@material/mwc-icon":"0.15.0-canary.9b03ee68.0","@material/mwc-line-ripple":"0.15.0-canary.9b03ee68.0","@material/mwc-notched-outline":"0.15.0-canary.9b03ee68.0","@material/shape":"=6.0.0-canary.05f5e1583.0","@material/textfield":"=6.0.0-canary.05f5e1583.0","@material/theme":"=6.0.0-canary.05f5e1583.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"ab8e352b8af06379b151d5a80b316fcdfd6e2024","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ab8e352b8af06379b151d5a80b316fcdfd6e2024/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ab8e352b8af06379b151d5a80b316fcdfd6e2024/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ab8e352b8af06379b151d5a80b316fcdfd6e2024/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ab8e352b8af06379b151d5a80b316fcdfd6e2024/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ab8e352b8af06379b151d5a80b316fcdfd6e2024/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ab8e352b8af06379b151d5a80b316fcdfd6e2024/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ab8e352b8af06379b151d5a80b316fcdfd6e2024/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ab8e352b8af06379b151d5a80b316fcdfd6e2024/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ab8e352b8af06379b151d5a80b316fcdfd6e2024/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ab8e352b8af06379b151d5a80b316fcdfd6e2024/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ab8e352b8af06379b151d5a80b316fcdfd6e2024/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.15.0-canary.9b03ee68.0","_nodeVersion":"10.20.0","_npmVersion":"lerna/3.20.2/node@v10.20.0+x64 (linux)","dist":{"integrity":"sha512-a/LQxw4Fgd0/tOoIyGzKH00p0DEdYTgAnmHNOmqw7ULuqMzW7pAUuEOGgoymIjvZNQivBx6ZCct6T8a442FUag==","shasum":"8f4341e95a4f30042332a2497b9bce9d90e3bb34","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.15.0-canary.9b03ee68.0.tgz","fileCount":20,"unpackedSize":264672,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJej39qCRA9TVsSAnZWagAAHoAP/jsloLvIvxmztyLtA5I9\nT9nGYuV3Mnh9bt4w5Db85XXQxyODgJHG0FQ5NZFjYXVBRU/fCRv3ougjXmx5\n5ZbdG1UQbKeE99B9jFSYcslV+YLtvXYtTiFPte5WfvHaFFj04wlVAgJcpbje\nDBBh1EcTuTHM4I1Fdxp79csvXyGVOvjv8CABqZ3z5FHUBXo7mr7Q43Eklt6F\nLtlBVtTFw3d7uNi3Dwf/vuN6Dl6XaaLGm3/cJY5j8ONKj47TbBl6Kzen2M6C\n9/1wO+Hb9HRc1u5aA99y2cf4DA3GXd1W9SE13E/1G17ViBq8A6a8I7cqifzK\nOQUlohJxSrU3J1ll5TZQHF3yGcIMUmPAkfFDH05wk2Zonoh3X5lJh/XoUk9s\n51eDpepR1QQniyfIYbQsrVPpIAK06dbHEzp2aPGKW7WeqoMe4juU/WAIEQ+1\noC38ueeXuP9ArpCMZ8UPPxQvpB87aD3yUE63p7EiiE76U095JAx24xdmcRXg\neef2s3YqIFL6U1tAFfml8xFrRI0xN7kzfhnFnxtRRRuKPV0XrgoLs6T+JiFP\nrQmuTre/qgdMT7JB6GHZ/0RPgkdiaxngbTjnwmXxeP4KPzpHlTfIqompgntd\nOzo+m8VZ1AldmoptA8bavusu8/T7+mIodBzJ57NglYYJIPNbdYzA/tfMPKJW\nqX+D\r\n=uUMe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICvsgwliXbmFX8OJSr5tddPedQmGlyqJZ9FT8TjzueBJAiEA7QPQ9jGMDnd7yKkCd5AeQnnTj/It6u8MY6SPMflfVnI="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.15.0-canary.9b03ee68.0_1586462569666_0.5880692329329067"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.15.0-canary.bbc25b10.0":{"name":"@material/mwc-textfield","version":"0.15.0-canary.bbc25b10.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.05f5e1583.0","@material/line-ripple":"=6.0.0-canary.05f5e1583.0","@material/mwc-base":"0.15.0-canary.bbc25b10.0","@material/mwc-floating-label":"0.15.0-canary.bbc25b10.0","@material/mwc-icon":"0.15.0-canary.bbc25b10.0","@material/mwc-line-ripple":"0.15.0-canary.bbc25b10.0","@material/mwc-notched-outline":"0.15.0-canary.bbc25b10.0","@material/shape":"=6.0.0-canary.05f5e1583.0","@material/textfield":"=6.0.0-canary.05f5e1583.0","@material/theme":"=6.0.0-canary.05f5e1583.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"a56f18fee2a99903e5867ab91175e4802a21cad0","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a56f18fee2a99903e5867ab91175e4802a21cad0/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a56f18fee2a99903e5867ab91175e4802a21cad0/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a56f18fee2a99903e5867ab91175e4802a21cad0/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a56f18fee2a99903e5867ab91175e4802a21cad0/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a56f18fee2a99903e5867ab91175e4802a21cad0/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a56f18fee2a99903e5867ab91175e4802a21cad0/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a56f18fee2a99903e5867ab91175e4802a21cad0/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a56f18fee2a99903e5867ab91175e4802a21cad0/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a56f18fee2a99903e5867ab91175e4802a21cad0/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a56f18fee2a99903e5867ab91175e4802a21cad0/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a56f18fee2a99903e5867ab91175e4802a21cad0/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.15.0-canary.bbc25b10.0","_nodeVersion":"10.20.0","_npmVersion":"lerna/3.20.2/node@v10.20.0+x64 (linux)","dist":{"integrity":"sha512-we2nrF/dkjGSh1yen74L2I/gfbSIl8EAYDEHd+/Pe96oEabGHHlzOhS6SBH7+kYp1x1CsfyloKN3UH7IKJDFdw==","shasum":"f4fe720632fdb441cae132ec159b16ce440f6054","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.15.0-canary.bbc25b10.0.tgz","fileCount":20,"unpackedSize":264672,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJekPcMCRA9TVsSAnZWagAA7PIP/R0Pr3G0IHeFJziwra49\n6L0K5jQKWzPgAMegoIadu/9jlabHfM3t9Zp0xOwuooL9QTkWG3ggnzekbnfb\nCKXeK17R5bwAPSnvMeX8jhT4aIRjTvA0YRckJX5E50Soijv/gV5YzJ4V+0dB\nhkja32zTdePISb7U+iEbb//CsBATwtimDoe4zbPMk7W+ZcJmPIAlqf+RlXEL\nTIVU+SHRwSZ00L1idRIPECzB1vpPz6Kr51ihxwNBQGcLl56uUgR7XQT1EutD\nmPgd2XZzqrCQWsS8ztsTDz7TrrVmJtrlUP6LFX1OV2RiYeV+6M0y4DQAj1sJ\nosnPbwcEhJvtrJJDqUU8YmZ5eEMiCONNal/he0HcvZlxWu1pu/30IpjmlXGS\nl5Ss6d+HwEdZG1PdFAgpTINJk6Jxk1V3ZinQWaK3yDMh1skcFybCtRTTf7er\ngWoHDI3iKU/6gkR4HgYtIRfg1DD4x6nc+QrGzTLx7ZPFlTNCAAwW3LYkSR8E\nZmhGAMuz3FYCZe0WVaF0IqFkTtZLyP3iH+LsZL7DAB0ijSXns5NKo/X3FUjM\nxzwPMfXiTy9DPCwJwK5vHkuz1/AE66Kc6m7d/NC3k3Pg20DuZu9WBJZmkl2V\npYRHB1MXfOxWARYPB6GMvpfv99CF0qlDHfOsjZOrcbMV2VWRXjipe4i+BElz\nt30V\r\n=7ogT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD6cMR+OKGwwa/2gyTllTBi2PWoVUk5fuAEcB+5eRXxbAIgfp4XepkSTOgsWT+EKVMIAgz4qi9j7f0XHnZrxHoGHKk="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.15.0-canary.bbc25b10.0_1586558732031_0.751479623763901"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.15.0-canary.339cbfd4.0":{"name":"@material/mwc-textfield","version":"0.15.0-canary.339cbfd4.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.f172b0f90.0","@material/line-ripple":"=6.0.0-canary.f172b0f90.0","@material/mwc-base":"0.15.0-canary.339cbfd4.0","@material/mwc-floating-label":"0.15.0-canary.339cbfd4.0","@material/mwc-icon":"0.15.0-canary.339cbfd4.0","@material/mwc-line-ripple":"0.15.0-canary.339cbfd4.0","@material/mwc-notched-outline":"0.15.0-canary.339cbfd4.0","@material/shape":"=6.0.0-canary.f172b0f90.0","@material/textfield":"=6.0.0-canary.f172b0f90.0","@material/theme":"=6.0.0-canary.f172b0f90.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"bb2a2c6f2ad1cc09cfc8d0cb5796203324564f76","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bb2a2c6f2ad1cc09cfc8d0cb5796203324564f76/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bb2a2c6f2ad1cc09cfc8d0cb5796203324564f76/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bb2a2c6f2ad1cc09cfc8d0cb5796203324564f76/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bb2a2c6f2ad1cc09cfc8d0cb5796203324564f76/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bb2a2c6f2ad1cc09cfc8d0cb5796203324564f76/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bb2a2c6f2ad1cc09cfc8d0cb5796203324564f76/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bb2a2c6f2ad1cc09cfc8d0cb5796203324564f76/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bb2a2c6f2ad1cc09cfc8d0cb5796203324564f76/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bb2a2c6f2ad1cc09cfc8d0cb5796203324564f76/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bb2a2c6f2ad1cc09cfc8d0cb5796203324564f76/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bb2a2c6f2ad1cc09cfc8d0cb5796203324564f76/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.15.0-canary.339cbfd4.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-BRcMKzisDVl5uXHsxr5Vnn16z/g1fIse+pAUtaY7qUlndNfnMQoi9AUjDNA/iol4vfXjvd1ReQIewGYGXxqXHQ==","shasum":"66754af9eb2da44e5d200ca1b822ca60e8247977","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.15.0-canary.339cbfd4.0.tgz","fileCount":20,"unpackedSize":264672,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJel0agCRA9TVsSAnZWagAAIzUP/0vR4FgpY9vHG4J4U2yO\nwxOJaqIseV66ofogAIyhR9bFTQAm9E7PbXRieprbxlEqpjtZif3ER0rHnXdN\n0AQ19j6AGEbi+cHzhGCRHbU+/w86Rpf1WdhT9VZYUpheN2DfHNiaOWh/IlDT\nD+94thYcl17jHF9NNHQCmRyv+aFXFbrGrwCArQp1c6DkURRlky5zXxas1UU8\nUpFgidZLjnXorCM7lihEiBGcgSVs2NPRVnYOHbNTEpsGxoAX8gdlWvmH1v2K\niVi6BwHsINcJXvzbeekrGHdga7Ratkpz+rU6TDk5QyLQ4ET4eHZq/ytexBcK\nRwSCRfQw1f6rKr9fBkp0yad88YwxfnDdcYhyCUAckBhpS9SCnGB0p8pZof1Y\nMn7iSlm1ojwqgR/G3BGN3Z8uvud7XX3fbqZTDnT/lUWmKXmKNE5IaqJBa8pW\ns1lKP/yzVG2l89klPZH589iO5IShumCVVmqpjKQ2d6exVbi8avnHO4XGIXHY\n1y0pe7tgHMyYvo0CuthZc3AdptmmDoVoJ4TH0Wav+sW3jct6QEcV8cpTSNV6\n2nRj3NAbGx5Exbg7FiqOW8O26ELQrywoeBbk3uS97eKTTTxmsc1EDyvKlZA5\nWX6tac01ggViFhrG9fOHv1McKY7UPb0IHSzZumRRTYwDYmgSqMShTGBuBscF\nHGau\r\n=VJ4/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC/Kc4N8zCTVBc2ULT0fsW7skSjIoGRzce0EpnQj2zeQgIhANYBm+V6R3YCEVjEVX8W1NA0rQShgHAs08g6rQ0llJDm"}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.15.0-canary.339cbfd4.0_1586972320214_0.9830457470054432"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.15.0-canary.b74ff19f.0":{"name":"@material/mwc-textfield","version":"0.15.0-canary.b74ff19f.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.c02642273.0","@material/line-ripple":"=6.0.0-canary.c02642273.0","@material/mwc-base":"0.15.0-canary.b74ff19f.0","@material/mwc-floating-label":"0.15.0-canary.b74ff19f.0","@material/mwc-icon":"0.15.0-canary.b74ff19f.0","@material/mwc-line-ripple":"0.15.0-canary.b74ff19f.0","@material/mwc-notched-outline":"0.15.0-canary.b74ff19f.0","@material/shape":"=6.0.0-canary.c02642273.0","@material/textfield":"=6.0.0-canary.c02642273.0","@material/theme":"=6.0.0-canary.c02642273.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"4a8d0d2eb87a0979a2039ae68ccef8af0c8b7b48","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4a8d0d2eb87a0979a2039ae68ccef8af0c8b7b48/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4a8d0d2eb87a0979a2039ae68ccef8af0c8b7b48/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4a8d0d2eb87a0979a2039ae68ccef8af0c8b7b48/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4a8d0d2eb87a0979a2039ae68ccef8af0c8b7b48/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4a8d0d2eb87a0979a2039ae68ccef8af0c8b7b48/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4a8d0d2eb87a0979a2039ae68ccef8af0c8b7b48/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4a8d0d2eb87a0979a2039ae68ccef8af0c8b7b48/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4a8d0d2eb87a0979a2039ae68ccef8af0c8b7b48/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4a8d0d2eb87a0979a2039ae68ccef8af0c8b7b48/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4a8d0d2eb87a0979a2039ae68ccef8af0c8b7b48/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4a8d0d2eb87a0979a2039ae68ccef8af0c8b7b48/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.15.0-canary.b74ff19f.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-HOBdJMS9z88VZFYRw8GHuWnOY1H/RuV06qGStAqFkyfY6Jwq1ClJS5gMPWUjKxIWdulEY49RpBjYMbPMK9mKig==","shasum":"3284698efaf5ed1d4b428092b89d36a71ae8b4fd","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.15.0-canary.b74ff19f.0.tgz","fileCount":20,"unpackedSize":264672,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJel2jQCRA9TVsSAnZWagAA/E0P/2l9zaWtPdf50YgZBixq\nK9PjfyOucqK/yYR72MvN9qKnqXS17DIqMfNKSzpG+vsw2tYUJloSdr1JvbZa\niVT+L7aI9QIm+C6Hc3iL0QX71D73h4gCrui68w5X2F4okNPT07dONtF0EBHT\nJqjYNiOwUM7GYMxr4OBO4VxBAwDIRgKPLFlYUwJ7VmecvkbnjMRSqZ+iqDFz\n7xdiIPYd7pcQbT7a+lkPFot3wQUawkLQLb9uHtJtu3Xnx/zmyr3fopo4a5SF\nkKUi9orvpZd/yz/Lb0W5FhPpQWQv3ojfdvlpVjQjS4lIQ7Rc2w7sa451OuA9\n/lloSiBjgzpdXFLXRcQM0tnLSNv2Rz7xlS6P//ZKpgV0e4k/0bFYnm7fUnFW\nQlobO7xAQ9/k18x4tw5umTxDSNRlHeGAT+zB6EKxbnDu80/Oquv8uiSrIqyr\nyGq7jUYUcN9L+LJfq68USKbDiQxi0Tvxyr+LXhLCglzcMSdAqAc25cSxu5aN\n1EOMue72LVF56QACJVp0vItzwJeCwKS7AiPSbin/mRl7zkw1d+pTdaFf0Sjr\nZqIl1XkM/yC2fJjpaiLEErco/vQr09rPQglBvCu6g6hy0LR9R6uIpBpk0yJx\nKhvk5Rv52OVKTb1CkPHapIKS3vkoefoFx6dOyWpLw1oHIj95PtWSJ5a45NS0\noVbM\r\n=44Wn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDDkiRjPIW4CpqG8fwA+mohJcTWcfqKfN4SUqD12A7joAiBV6th6WQdHR3Ntl9c572nD7NihF86iqsljLM9X0P98mQ=="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.15.0-canary.b74ff19f.0_1586981072527_0.248301085141041"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.15.0-canary.aaa16853.0":{"name":"@material/mwc-textfield","version":"0.15.0-canary.aaa16853.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.c02642273.0","@material/line-ripple":"=6.0.0-canary.c02642273.0","@material/mwc-base":"0.15.0-canary.aaa16853.0","@material/mwc-floating-label":"0.15.0-canary.aaa16853.0","@material/mwc-icon":"0.15.0-canary.aaa16853.0","@material/mwc-line-ripple":"0.15.0-canary.aaa16853.0","@material/mwc-notched-outline":"0.15.0-canary.aaa16853.0","@material/shape":"=6.0.0-canary.c02642273.0","@material/textfield":"=6.0.0-canary.c02642273.0","@material/theme":"=6.0.0-canary.c02642273.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"7546404b77983a36ca5e25efc1078681498f260b","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7546404b77983a36ca5e25efc1078681498f260b/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7546404b77983a36ca5e25efc1078681498f260b/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7546404b77983a36ca5e25efc1078681498f260b/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7546404b77983a36ca5e25efc1078681498f260b/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7546404b77983a36ca5e25efc1078681498f260b/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7546404b77983a36ca5e25efc1078681498f260b/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7546404b77983a36ca5e25efc1078681498f260b/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7546404b77983a36ca5e25efc1078681498f260b/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7546404b77983a36ca5e25efc1078681498f260b/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7546404b77983a36ca5e25efc1078681498f260b/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7546404b77983a36ca5e25efc1078681498f260b/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.15.0-canary.aaa16853.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-8/LapdRuU4kg0zHXBOJ+17/0WdNSfTQgpMuf9gfiOBVokZIzs4qj9RlozePVsXvqEPShPLJGFhPRWGh6JcZrbQ==","shasum":"b9ead35d96231953fabede3680aa2bb7335bc597","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.15.0-canary.aaa16853.0.tgz","fileCount":20,"unpackedSize":264672,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJel418CRA9TVsSAnZWagAA67IP/jJvHl6bxI6YU0RWYvsi\nB54ZLWQDKkLxmW8JaEZIPwLA2WUcZmOUSA+E0+reB78UWU6LU8YtvSkroN40\nqoDBmACWHUc7ksDrLRisjFr02U94NvhGRPlzmnAhicFBhv6ROf1EHJv4qBpi\n2pr3XDgLRGYBhAptRREim2JJOC2/2sy+1zC4h+SFkAGOsuW/EuqUucM/bmx3\nsaUjIgBuTFzbjwA/dcctwvyPAlpr7Em35J22bVvolAk5H6ELTBcn9IeKLXx+\nUwONJ4jNiYcQXCSNHE6RwkLgPD9uAw29UtXJqCeBIXA7z9Z+ksJjzVMBpcPb\nS4AtLel6/WE/g5nINCaMiuMhX0pppjFmyRkofk10GfX2kSZFDtpc/mHBWDb3\nyalvrX7GQym+KsT/UxfkBt1LxGTIixCqwqReJzViFvc/f6Tm/GvFQdG3ElVu\nNrFOv28OSj5QBPFmCkQvh5YVGcDmsZ3Xck+Qyem85+sASJVtzDdg41pSmAKs\nRJ3R3M5gVmzGGm7xIWY+cMotzq0SHVlYausrF280q/oTsbQ+oUeMqqBIBew6\nkSy2lypEeP6oX+Jby6X0Xz/IUbqSMdTbl1yCbgEK0Ss1vxPXykQkupLYtnwg\nWfYRuXovaKjyvB91IKldNuo3UdZsCRvSZCfAK6FQuNOzA0qAsw4AI10AgV5L\nE0vP\r\n=DpsT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHzfLfsbxzzlD24yZ6fOY17Wpua4oSsURUHwZ46K4rgeAiEAtsre7ZRDmKgYd55xhb67R+S16Qf70Lb48f76JnDriPI="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.15.0-canary.aaa16853.0_1586990459762_0.5535670278794205"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.15.0-canary.826b23e7.0":{"name":"@material/mwc-textfield","version":"0.15.0-canary.826b23e7.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.ce6cb7024.0","@material/line-ripple":"=6.0.0-canary.ce6cb7024.0","@material/mwc-base":"0.15.0-canary.826b23e7.0","@material/mwc-floating-label":"0.15.0-canary.826b23e7.0","@material/mwc-icon":"0.15.0-canary.826b23e7.0","@material/mwc-line-ripple":"0.15.0-canary.826b23e7.0","@material/mwc-notched-outline":"0.15.0-canary.826b23e7.0","@material/shape":"=6.0.0-canary.ce6cb7024.0","@material/textfield":"=6.0.0-canary.ce6cb7024.0","@material/theme":"=6.0.0-canary.ce6cb7024.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"00403df32c75dc9e2a64a38be1eb1df45ecc57ff","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/00403df32c75dc9e2a64a38be1eb1df45ecc57ff/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/00403df32c75dc9e2a64a38be1eb1df45ecc57ff/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/00403df32c75dc9e2a64a38be1eb1df45ecc57ff/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/00403df32c75dc9e2a64a38be1eb1df45ecc57ff/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/00403df32c75dc9e2a64a38be1eb1df45ecc57ff/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/00403df32c75dc9e2a64a38be1eb1df45ecc57ff/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/00403df32c75dc9e2a64a38be1eb1df45ecc57ff/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/00403df32c75dc9e2a64a38be1eb1df45ecc57ff/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/00403df32c75dc9e2a64a38be1eb1df45ecc57ff/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/00403df32c75dc9e2a64a38be1eb1df45ecc57ff/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/00403df32c75dc9e2a64a38be1eb1df45ecc57ff/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.15.0-canary.826b23e7.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-NBKXRf+7/1zfOGN2J5osgM1nk+40t48X/IVtS6VFcXympmeGq/ULIUOg8N3hSypIhkFCUMJ5WypkAgalaG6sPw==","shasum":"2813fe70dbd3f0f636ab9f31f99d186e27bfbf70","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.15.0-canary.826b23e7.0.tgz","fileCount":20,"unpackedSize":270300,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemKp7CRA9TVsSAnZWagAA8XQP/0LOJh7TeNK/J2ql/i0W\nj5hyhO7L3lYP1aE+RID+bNn+xtH8olx7/2Lvxe8S35hZ0oOwgwRTCF8MrQGY\nJXyrowR+LI5kOFY7C+BXLjJR4qUq3e2FW757hTmfItapCpnrvEiQahY6Rexu\ncidMAF73bDj8RP72vkxmX4fSZSFYxUmQkMPAzvOUrfKs0m+P/XizaJobDnVI\n45elezyXwHjgH8gTnOKMClr2Ql/F55mT83CtE7tS8oGHKahOZX83NIal/vBP\nuYVb2y57Q1i7s1tjRgK1tcQr3Zylv8ivMgMsQaCPwNK39kUc4Yc5y+xNtAli\n5dsed8uJFVZ8ONwQmK4BRsbyAwxnzujuakQMx3TlLW38vECH3ro8BxJLJDxA\n0zMCevklqzAnw2JXqs8lSSlrAZRBq/vH9ZcLzwYkzo0KYiugZ4FipTl6FfAA\ntXB3ElJX4A36lmheRypE+2+FcfxWAeg3j5mYnKUkbaku7v2RRMQsqsUpYffV\nBUMg/abklwWKpIBlGNUwb5SXZlueDUD3kAm+X62purPgys/g2NVZx63pSs8k\nTYUWrfa1pxJ9lfa3FcusBordDb2ZPIfD+xKzLogR9Ba3yXJ8wejUDIKae9g5\nMGVpT+lD4vpK8x4hRRgTt18B2MMbWFKWpUxsB3coyFB3qeEpPuKVpuSwkzn3\nvDjN\r\n=jwOY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGfgog2DQrkMFF4FAfSZGPqQeTa7mZyh4LyXlSlm5mBNAiEA8TAQNSDyK58nOUaGybWbAHgSsvc75p5o+HLYqiW0sBs="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.15.0-canary.826b23e7.0_1587063418789_0.6422475027187584"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.15.0-canary.e1ad2b2f.0":{"name":"@material/mwc-textfield","version":"0.15.0-canary.e1ad2b2f.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.ce6cb7024.0","@material/line-ripple":"=6.0.0-canary.ce6cb7024.0","@material/mwc-base":"0.15.0-canary.e1ad2b2f.0","@material/mwc-floating-label":"0.15.0-canary.e1ad2b2f.0","@material/mwc-icon":"0.15.0-canary.e1ad2b2f.0","@material/mwc-line-ripple":"0.15.0-canary.e1ad2b2f.0","@material/mwc-notched-outline":"0.15.0-canary.e1ad2b2f.0","@material/shape":"=6.0.0-canary.ce6cb7024.0","@material/textfield":"=6.0.0-canary.ce6cb7024.0","@material/theme":"=6.0.0-canary.ce6cb7024.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"148a509de33ca1ac17781a9e24bf8735ec5b2874","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/148a509de33ca1ac17781a9e24bf8735ec5b2874/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/148a509de33ca1ac17781a9e24bf8735ec5b2874/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/148a509de33ca1ac17781a9e24bf8735ec5b2874/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/148a509de33ca1ac17781a9e24bf8735ec5b2874/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/148a509de33ca1ac17781a9e24bf8735ec5b2874/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/148a509de33ca1ac17781a9e24bf8735ec5b2874/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/148a509de33ca1ac17781a9e24bf8735ec5b2874/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/148a509de33ca1ac17781a9e24bf8735ec5b2874/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/148a509de33ca1ac17781a9e24bf8735ec5b2874/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/148a509de33ca1ac17781a9e24bf8735ec5b2874/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/148a509de33ca1ac17781a9e24bf8735ec5b2874/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.15.0-canary.e1ad2b2f.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-UOkyxzhFWCNvFnrw9XP61OhUHIg7d9k8fzxPMAQWYzOxHrWaK72acuFAu30buK6MtA/2W/u0fhb28y8AFu4h3g==","shasum":"cef11449126877e258321b7efde66e783bf23edf","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.15.0-canary.e1ad2b2f.0.tgz","fileCount":20,"unpackedSize":270300,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemjVECRA9TVsSAnZWagAAIQMP/2maEVyhbBUZWo/EAf51\n6Jdgg9MtNxoTs7Hgk9W/zswoAdZzjkS51Am/VF1ZZQ9iuV87HvcZvGbHvImK\ng4EV9ugeR0tHKm4g5pk3L0J4Gts0WtsnCsANKY/Vfdp5VN7jL0L4S0FGzX4R\nWw72nnY6LemkRg1/R5MfzKbjJvykLAypBI/XZceIAJcPXg/zL3M3RePfg15m\nnfEqU5wKBfyEeyZ44hmiQnszgp61bJSxVUkY5v3V9oKjW5UKLIAT6+PrGpPS\nwlMPgUx1H6EX4fzTXSCee+W04oOfl74Qh+MswSffalgt8J4yHJAe6Jox4esL\nP5VD3MiJu+vBoOmNlJfcmj8mwqawdbFk8Z1tnIH7Ihnv5t6kekPEAeTFxKlo\nuEh9YYfyDqVMvtcc9f1GPuITsuSkOJU4kWDX4GMqss2Grc3zFE0ob4ZxnxqW\nW5Rr2qNvL4KnhTHgGNiPNIyc2Oww50w9LQwTBvtas/l2SvYwCpZ3QMWu+/hr\nHbcxWucm1vMOiMlI0IoAOIroCd8KC6JULigeT2iqFO3XNWSY/MbbvEe8Ukje\n5bsCRHtfF3K1tlWcAxkNB8lpdIk0xlsb98e5mavgHZx/FrppP4su7jwLCoAS\n8Ql1nAMMYxN9v+OdOrSRYTWaF3TDkZeHRcVs7GzOneVuGAOL+Y8SDrwEQZix\nFdQP\r\n=i679\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIANTwwucF/CIbiXlws7TrEfVAESYYWBYp6v05j8vx2PdAiBaqCOIK8axKOkBW5mIeEpeX1G1FBfp8Y6gq5G0ZwwnuA=="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.15.0-canary.e1ad2b2f.0_1587164484015_0.6242170691637297"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.15.0-canary.bade5580.0":{"name":"@material/mwc-textfield","version":"0.15.0-canary.bade5580.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.ce6cb7024.0","@material/line-ripple":"=6.0.0-canary.ce6cb7024.0","@material/mwc-base":"0.15.0-canary.bade5580.0","@material/mwc-floating-label":"0.15.0-canary.bade5580.0","@material/mwc-icon":"0.15.0-canary.bade5580.0","@material/mwc-line-ripple":"0.15.0-canary.bade5580.0","@material/mwc-notched-outline":"0.15.0-canary.bade5580.0","@material/shape":"=6.0.0-canary.ce6cb7024.0","@material/textfield":"=6.0.0-canary.ce6cb7024.0","@material/theme":"=6.0.0-canary.ce6cb7024.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"6e463a20777b8cff5146a68db7bffe3f5aa9674d","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6e463a20777b8cff5146a68db7bffe3f5aa9674d/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6e463a20777b8cff5146a68db7bffe3f5aa9674d/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6e463a20777b8cff5146a68db7bffe3f5aa9674d/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6e463a20777b8cff5146a68db7bffe3f5aa9674d/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6e463a20777b8cff5146a68db7bffe3f5aa9674d/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6e463a20777b8cff5146a68db7bffe3f5aa9674d/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6e463a20777b8cff5146a68db7bffe3f5aa9674d/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6e463a20777b8cff5146a68db7bffe3f5aa9674d/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6e463a20777b8cff5146a68db7bffe3f5aa9674d/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6e463a20777b8cff5146a68db7bffe3f5aa9674d/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6e463a20777b8cff5146a68db7bffe3f5aa9674d/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.15.0-canary.bade5580.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-7zhSVlmh1a2Na9ZJlKz6pbMgzdMqzwP/jhYtuB4W4+AH8/fB0RFGeda/O/1MiOE4zwhO42O4O8uO8AMBX9kMng==","shasum":"d6701c1c4d5bfd35695835be0aefc171a001dd84","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.15.0-canary.bade5580.0.tgz","fileCount":20,"unpackedSize":270878,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemjlxCRA9TVsSAnZWagAAvJsP/0B+dd9QbQjAzJK+Te2r\ng/7rMGk4dpqHvYkkq+5JkVij9HU9Pa6G4oYJwDN0fLZ4zqzDasza+x64kHn6\nexwZ24Hg2r4enzH+MXOZz/t67AFXuGO5dZ21yIJPd9lbi7tzQBpJToX5lluu\nY+I8kwxg6QHd6wt+TtSbwYs41KMW5ZCBCK3r3nKxLEyB3S6VUjz2kIyZKTCw\nw9bqLzOzKFtV/gEUx1PBEJUvnEc5Xb8zCZ2208raklJAxIT6L4vsNjAgiqpg\nowIDOP87AEW4sD288K6bfQKV3LBTk095yw8opBB7dLJVlJCnlmxn70YHXZfe\nXSYH0SU/FETVaQRpdTOtYLwuuM7gRRP4dKGv4e7Nl4WkC7szn5IYw5ewMju5\n5zKoGCYxj/IpuCPRPUzdER6VHU53D0xZpqITfZ6Nm2SORhkAEHDmHLkUioFp\nklw7Pnpph1bGaOknkaP9znp4gZ0hfFV/frHiXfZ+x4T8ZOLOWj4/MNrzuZgw\nsFVsZb1oSBU4BUeJA+Q74MUEb201kQNXovFQSKCCZHNfBSi4aZER+Aao3sUr\nqiecL72scqLh9KUTt9W8Bv6woALDS2ogDZVLAw6vk76T9fVYwoDPuxdbF9pE\nKTVnMfdawkBbykYQvlbknhd0lLfzrdkY6dsw0bxUHHjD/BF/6h7FclTNliUT\nt1Ob\r\n=xjKQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCw5BUi+TdsMXxQbxLFceqvuqeb2MF7awL2j0b/p34CPwIhANhlfJB+3Z6NbZ5NPA9IpQyMogg6/cr5RXloOumK77mO"}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.15.0-canary.bade5580.0_1587165553474_0.7219281530601465"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.15.0-canary.dae38247.0":{"name":"@material/mwc-textfield","version":"0.15.0-canary.dae38247.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.ce6cb7024.0","@material/line-ripple":"=6.0.0-canary.ce6cb7024.0","@material/mwc-base":"0.15.0-canary.dae38247.0","@material/mwc-floating-label":"0.15.0-canary.dae38247.0","@material/mwc-icon":"0.15.0-canary.dae38247.0","@material/mwc-line-ripple":"0.15.0-canary.dae38247.0","@material/mwc-notched-outline":"0.15.0-canary.dae38247.0","@material/shape":"=6.0.0-canary.ce6cb7024.0","@material/textfield":"=6.0.0-canary.ce6cb7024.0","@material/theme":"=6.0.0-canary.ce6cb7024.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"b704c816f10599ee9a5d9b89a55d9c95d2e36f4e","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b704c816f10599ee9a5d9b89a55d9c95d2e36f4e/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b704c816f10599ee9a5d9b89a55d9c95d2e36f4e/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b704c816f10599ee9a5d9b89a55d9c95d2e36f4e/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b704c816f10599ee9a5d9b89a55d9c95d2e36f4e/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b704c816f10599ee9a5d9b89a55d9c95d2e36f4e/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b704c816f10599ee9a5d9b89a55d9c95d2e36f4e/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b704c816f10599ee9a5d9b89a55d9c95d2e36f4e/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b704c816f10599ee9a5d9b89a55d9c95d2e36f4e/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b704c816f10599ee9a5d9b89a55d9c95d2e36f4e/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b704c816f10599ee9a5d9b89a55d9c95d2e36f4e/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b704c816f10599ee9a5d9b89a55d9c95d2e36f4e/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.15.0-canary.dae38247.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-s75lsMJKSQQcDd4Fh8ILj1/26BkAEoLPIIFO+Tcepyh0T9W89Sg1vgqmlPqSym6/+KM0LuQ5JpqEk4s/+tDInw==","shasum":"c72d76659aafb6dce28f6839f929ce92690eef05","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.15.0-canary.dae38247.0.tgz","fileCount":20,"unpackedSize":270878,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemkbJCRA9TVsSAnZWagAALbYP/jSvImj0botCRRU+vq2H\n//fM4B9Bs6rl1LRRJjYzWCYaxkL860YW7YAYCEPpgm1RfCvoLcT51xAoyuj1\nqv9oV5WjDGeyqKkq3f1HXmhRylYP4TYH6ex6dYIciXxyYgL2pYxVntZLZNHF\nSYJ6Cmkg3owu8kR1raMFnYFQVEPEPTs0dO3b7NGCfWX1uDK+L4P0Q4jbxuE2\nEaNUOfpkjd0G2XrO+1SDyL/XN32scn6rl98B71pcmruX2VsddnYoPxKLiIUb\n8aB9T4HKsCEuZMvpqFTAXzA2mU11yhHrtlxpXKigVPlzByriWVJjb7JYyIWB\nqvZ2X6R2IMFAVTdX+DmU2KyoCYG7Bn4olELz4DVfUTlvykd7gho7b6Gzj7y8\n6kklyNAcFKnb/6fHKYRfwbPC92ZaiYx+X6+nq0EA/BcdYOMQnnJSlK6WS7gJ\nVu8HP4M3eo50kdy4Ik85baGgWUV77hmvFHfuDUI8c4BVXgYIxuthfdvEktp4\n2srEsz+EqZUKHU77wzNjnvgcgDjKXJ/9V8jeoRjMC1NoEka0ob8zax7lbk75\n84Wk75MGdnSTNYP0AEDL9+m96RlLakfBHrLQAxGXG/q3AmcwMgegmJQsuIck\nBRaUkH8i1E0d4QDMK7ajoIXmXlhm2XbWHAXhC33w286rT7T5nChWsTyh2G7I\nqM9u\r\n=42x7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD9Hth6KgrT5go1KTpElCBk12XvbsCocr5VuqRtrh1SoQIhANUOZN20bHHy/ySEE7qVhcLEyorlazQuLPnixYQLMlAH"}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.15.0-canary.dae38247.0_1587168969367_0.673930342228086"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.15.0-canary.a04c0b82.0":{"name":"@material/mwc-textfield","version":"0.15.0-canary.a04c0b82.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.c4b4bba96.0","@material/line-ripple":"=6.0.0-canary.c4b4bba96.0","@material/mwc-base":"0.15.0-canary.a04c0b82.0","@material/mwc-floating-label":"0.15.0-canary.a04c0b82.0","@material/mwc-icon":"0.15.0-canary.a04c0b82.0","@material/mwc-line-ripple":"0.15.0-canary.a04c0b82.0","@material/mwc-notched-outline":"0.15.0-canary.a04c0b82.0","@material/shape":"=6.0.0-canary.c4b4bba96.0","@material/textfield":"=6.0.0-canary.c4b4bba96.0","@material/theme":"=6.0.0-canary.c4b4bba96.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"23904437ed2cd67305827b08d512e6dd06858b16","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/23904437ed2cd67305827b08d512e6dd06858b16/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/23904437ed2cd67305827b08d512e6dd06858b16/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/23904437ed2cd67305827b08d512e6dd06858b16/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/23904437ed2cd67305827b08d512e6dd06858b16/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/23904437ed2cd67305827b08d512e6dd06858b16/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/23904437ed2cd67305827b08d512e6dd06858b16/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/23904437ed2cd67305827b08d512e6dd06858b16/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/23904437ed2cd67305827b08d512e6dd06858b16/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/23904437ed2cd67305827b08d512e6dd06858b16/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/23904437ed2cd67305827b08d512e6dd06858b16/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/23904437ed2cd67305827b08d512e6dd06858b16/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.15.0-canary.a04c0b82.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-jW6eHQwJtDWCuA1GI73PNqacEbdztD/Lj2luOPqYLNEXennqrhxb/okq5aau8PsbIbaf5otThv6YNVgijsMu6g==","shasum":"b73bacb47e27c7a3715b2b30f3c8d89953e0ee97","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.15.0-canary.a04c0b82.0.tgz","fileCount":20,"unpackedSize":260276,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemksKCRA9TVsSAnZWagAAF1oQAIAvY9Ln0vYp0g3DZhoM\n5RdQxKopxMeGGNrz5nlhq7SeQ3ko2h1HqXLRO9p5rSZiS9xnydCXcL1DPs/f\nW8uM4zZIB72GLVvDt9225qY6UWAz5boFCsK9aBw/n1OQ2J25rwLAhAiIwIB4\nBqTOEmIE3lxIuLvEiHoeuRf02cjRPvhUWbmQvWGk2sB0f/tBNBpVLwssIehu\n3prPnbu8T/M1gdtWCCfTgJ905XeRfAVKkxvmqdtNETv438TjjyLXjXtmsj4p\nvlTK02FlQD16Ax9nFm4QXcVyiq3U6B1KKniBTpN4HPBrvomZK1Jd4YS3OD/y\nlQMi4fW3BbwozmqVrh5tgKfftdkuFvSV9gNTIba2DUvoZZRJX0pHMvSk6ZPx\nGnN7Hw5uIOPX0RROnk0ScXScZFVaVvVYA8HWIh+4lOo8rGT3EmvKmJzpKOkn\nJhBrCw8wSRDTm6iPNVmaPeX9C8YZAPu/FicKu3invSf8ue2qkImPAG2H114r\nBmo5zX9RhT18Wv5XQK/6FhGXZBW/DGETym1Sx25ClmMLJUeYogD3XjJE4zvx\nL7rLfdL2OUiA7TfJWvzgeWpbwU8BQcr2F4Z1+h6u8VgRXwS4IXT/UBerrizG\n2bWZqKZSET96vMBVxCk2rAycdC9Ij2+9z8IDLza32sNLGmrxEmzcV0nXR1Aj\nRR9K\r\n=S+jC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCoXKXpgm4CmtQQZ7dq0xLJIg2cdLiMpmUqlUbfa6g44AIhAPezMYzg9AmhkMLZ1nVePKShOQq0q2vGIJh5R5q/vD3u"}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.15.0-canary.a04c0b82.0_1587170057617_0.44488987253031276"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.15.0-canary.715decfe.0":{"name":"@material/mwc-textfield","version":"0.15.0-canary.715decfe.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.c4b4bba96.0","@material/line-ripple":"=6.0.0-canary.c4b4bba96.0","@material/mwc-base":"0.15.0-canary.715decfe.0","@material/mwc-floating-label":"0.15.0-canary.715decfe.0","@material/mwc-icon":"0.15.0-canary.715decfe.0","@material/mwc-line-ripple":"0.15.0-canary.715decfe.0","@material/mwc-notched-outline":"0.15.0-canary.715decfe.0","@material/shape":"=6.0.0-canary.c4b4bba96.0","@material/textfield":"=6.0.0-canary.c4b4bba96.0","@material/theme":"=6.0.0-canary.c4b4bba96.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"ddba034f53f308afea3b1390f775b49e8a473e91","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ddba034f53f308afea3b1390f775b49e8a473e91/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ddba034f53f308afea3b1390f775b49e8a473e91/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ddba034f53f308afea3b1390f775b49e8a473e91/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ddba034f53f308afea3b1390f775b49e8a473e91/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ddba034f53f308afea3b1390f775b49e8a473e91/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ddba034f53f308afea3b1390f775b49e8a473e91/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ddba034f53f308afea3b1390f775b49e8a473e91/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ddba034f53f308afea3b1390f775b49e8a473e91/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ddba034f53f308afea3b1390f775b49e8a473e91/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ddba034f53f308afea3b1390f775b49e8a473e91/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ddba034f53f308afea3b1390f775b49e8a473e91/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.15.0-canary.715decfe.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-EvLveey6RxL0fnc2lhDEAjZreoxJWN0JrVDJ4Go79UCE7QazITqs38c8w1UvdIAAVr72se1RqH/z8Ce7+YSgNQ==","shasum":"55345be766273cc9ca0527f3567a5d9502beb68b","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.15.0-canary.715decfe.0.tgz","fileCount":20,"unpackedSize":260232,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenetjCRA9TVsSAnZWagAAc3MP/RZFDbZAvqIjp14Ez00T\nsSS9SWOlTMWYS7M60ETyydN9WgnykdPM8vNUgnRtA7eFzlbV23HWFAS5uhza\n1UeKv6rCEdWVsFvqc8qukuD4/rkSUALCRUqu4kYcBGd+30QVIH7xqrXRWgH4\nwEmXm19aXtW9V1RVtZ2TwNjSAfOhBX57C1k7N0JXSBLgdTuSee6kUBh8eltH\nI9hxmNlqWlVOFfGBS3aY5k1SV3kKX3EH1wa5Avd48p3N0FsKD5itYAxnw9y4\ncJ+dLA/I+fUdYbJ2xv7eNN9YWiq2QGboRZlDD/KrvTf23hhA2QU1UijQa1wr\nPQUqxOKi3ZiRH0qj1JgXCi9n5xxGelC6yScT9VpY44aWz8U7qpbn138qDSLq\nDP9sZX7SPMFdm6e9YARIOpaUYnWUyk1y5ymCH5SKa9xfRA3g6eElbofE3MNI\nYRg0CODysbfSvGbV50bUqfI3aeZE6hm5xZqojLQ8nvSWP1vfLtkzbgHJ7wxi\nNaMBg389+kfEIWBUpBKkzJlzqZLhElos3nV4dtL82U9nE2TTCtj3Md7PMiWp\nOp7vp9M7ipWzW8fgiOWKSTgV2Jq4klMPIxggRwayeii68DBqA4dhwUYaB38A\nK7yXBxvFZm+kYtFRNMAiRmWQdKmUcpzWA2sYlnitjyEg3VG9+RrQMStbQl8p\njmeX\r\n=2AI2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCVGR63Hfp3fnxhKIfxn5oZdlDQZNMYuSC0x6yVQCA0vQIhAOY3r14bpvDRqSHoNG0t80homLKwj3yM+K02oTOVRHbO"}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.15.0-canary.715decfe.0_1587407715307_0.5530399316366441"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.15.0-canary.c862cd04.0":{"name":"@material/mwc-textfield","version":"0.15.0-canary.c862cd04.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.c4b4bba96.0","@material/line-ripple":"=6.0.0-canary.c4b4bba96.0","@material/mwc-base":"0.15.0-canary.c862cd04.0","@material/mwc-floating-label":"0.15.0-canary.c862cd04.0","@material/mwc-icon":"0.15.0-canary.c862cd04.0","@material/mwc-line-ripple":"0.15.0-canary.c862cd04.0","@material/mwc-notched-outline":"0.15.0-canary.c862cd04.0","@material/shape":"=6.0.0-canary.c4b4bba96.0","@material/textfield":"=6.0.0-canary.c4b4bba96.0","@material/theme":"=6.0.0-canary.c4b4bba96.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"59b73d92f5709c37a2da654102a61dfabe148db1","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/59b73d92f5709c37a2da654102a61dfabe148db1/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/59b73d92f5709c37a2da654102a61dfabe148db1/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/59b73d92f5709c37a2da654102a61dfabe148db1/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/59b73d92f5709c37a2da654102a61dfabe148db1/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/59b73d92f5709c37a2da654102a61dfabe148db1/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/59b73d92f5709c37a2da654102a61dfabe148db1/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/59b73d92f5709c37a2da654102a61dfabe148db1/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/59b73d92f5709c37a2da654102a61dfabe148db1/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/59b73d92f5709c37a2da654102a61dfabe148db1/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/59b73d92f5709c37a2da654102a61dfabe148db1/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/59b73d92f5709c37a2da654102a61dfabe148db1/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.15.0-canary.c862cd04.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-rexYftHS051a7uOJJDV4Ou+FBjdTeQWpUwHad+czPGB9KD40upUmc/e7MQawf5BM9smJIVbdwIVNjr1vIe/Byw==","shasum":"1f8582549c4278ac1f1e962eeb05e483ac3d40d3","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.15.0-canary.c862cd04.0.tgz","fileCount":20,"unpackedSize":260232,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenhVdCRA9TVsSAnZWagAARaMP/2YPrbAQc/Kf7F08eXGh\n3yJ/qyA6MVyPPdnPyJ88VeynQM6p79Qs2gGz4epBRkWwlYY6neB5xDLRzTCm\nf5h65RGKsqYHS9IrrBc4woiP7m6kDphV5CNrN65gmEx7ABjYDq9YaCTKrKoq\nWfc9W0rVMgRRwIQoevhH4EyfoomYGzM8dP6E4aBMuL4wiv8x7Y1zGqyzfDL8\nTnnE6ksjPTbhjfyr7eiV8R5XywXSwBNW0maK3CRGKVoC1Z1YV1spSuA10WEx\n3rQwAm3La66HtBd8kIsIch3AN7CW8FlyTYdXZ0ss+RCn8A/M+jmgEZKVhVwh\ns7hb9xwBm6JyNj8AR5GWolYdf22Pm/RGgVQE5BMmiqc807brGBj2zVHYaJlV\nPoSshlFRJ8wRbUjjbiivMzRaBCnPH26QR+yFmMK6G+JSIdybgiqjLXSFdqkB\nEjndlI+ppDK/GYpb1+kVDqs87h+m8H1VbIJqRzdX4WR/p4dT7jhfzicRNa5W\nx5qdZGLiBKJgi6mye5z9RG/Q3FUckoclHFr4KnqTb+G/TJZKlTm9HlsA8pym\nQC5+DlABXQnYKcA12WhFMZrjE/gLVuEr3pWtpx29R96XyoyiY8rc+UH4kIat\nKWmxMfKhA1crsomSg+iuZrEA64hGVHmhc+RO0Dn06M44+PNO5hkl9Ns2ujdJ\nNy2h\r\n=u5dh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBfgo/Uoe9AUac1ZzfDoUBDTu3TxH4LARwqgZPRqrwrmAiAUq+ahD6zprDa88D7aZA4EJ+MnG1dv/r6JZYzL12Gqhg=="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.15.0-canary.c862cd04.0_1587418460766_0.09057585502681831"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.15.0-canary.e9b01b35.0":{"name":"@material/mwc-textfield","version":"0.15.0-canary.e9b01b35.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.c4b4bba96.0","@material/line-ripple":"=6.0.0-canary.c4b4bba96.0","@material/mwc-base":"0.15.0-canary.e9b01b35.0","@material/mwc-floating-label":"0.15.0-canary.e9b01b35.0","@material/mwc-icon":"0.15.0-canary.e9b01b35.0","@material/mwc-line-ripple":"0.15.0-canary.e9b01b35.0","@material/mwc-notched-outline":"0.15.0-canary.e9b01b35.0","@material/shape":"=6.0.0-canary.c4b4bba96.0","@material/textfield":"=6.0.0-canary.c4b4bba96.0","@material/theme":"=6.0.0-canary.c4b4bba96.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"873703765efd3bce3e325a39e56707cb2a7c47d8","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/873703765efd3bce3e325a39e56707cb2a7c47d8/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/873703765efd3bce3e325a39e56707cb2a7c47d8/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/873703765efd3bce3e325a39e56707cb2a7c47d8/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/873703765efd3bce3e325a39e56707cb2a7c47d8/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/873703765efd3bce3e325a39e56707cb2a7c47d8/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/873703765efd3bce3e325a39e56707cb2a7c47d8/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/873703765efd3bce3e325a39e56707cb2a7c47d8/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/873703765efd3bce3e325a39e56707cb2a7c47d8/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/873703765efd3bce3e325a39e56707cb2a7c47d8/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/873703765efd3bce3e325a39e56707cb2a7c47d8/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/873703765efd3bce3e325a39e56707cb2a7c47d8/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.15.0-canary.e9b01b35.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-3dWKhJ49OlZk7s8ONUfPBMKHhQgYglDzlI0uAlqBHv5kJz5OwX/JsQyw4mkGXBdBXb8gLr24+PxubCK1320cdg==","shasum":"995c12c6c17d5f47549b8bae90c52ede0134d5e0","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.15.0-canary.e9b01b35.0.tgz","fileCount":20,"unpackedSize":260232,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenjBVCRA9TVsSAnZWagAA8Q0P/i9ZyvdVW68QOuTKlbYw\nFTX2gUfZCLPxYZ6s/7k0qDlBfial9QqsAFXsdTk6o/oL+Kqcez8Or1gA863P\nRLhfYSFtikDoVYmy8x0J69K77pdcTa3TckIfu5cCK+Pb3p4kt2Hnqt2se64E\nfBmqb6IR+8uLbYsYFcKCnStBOzeEk1F6Y3e6ZPhEiHDEXkjOfxlZeb+BmyGZ\nIZIrKMNzUEJ0KloU3HX15jx5fqtBgbSS8dUMYQFYKpPRE0KFT80xtmtWvoEo\nti3aNrlyzmblrNv9lBSnKgcLbXEPJ6epDURFMqEl5aW1B4h+yAUqPYVOtUi/\nmu7qdMGb1Rxleki7+wDikGZ6glTFHte8l/areLhofF+fEcTeFiI9N3ECPysL\n6/gyoXlX1jUPwDMCgOHS1OKs+yyZ5N99eHRBCDdVp+3Q00+WYQ7AN5naWDlo\nAvSkmWdW0RN08v+t5Fr6iP94FNKBbwrRM5y5lV1BidSX4IvTuPZOwsK/BRcf\n4mJZq5+tt9xMWsLH8j2319Cpppy0nOgdamAH/bRdHwa5OC+TcjI0uLWCXSXV\nA4t8rD2gh0KEHHN7GXp2spz/ltlyyHS9llXqvW0y4FChFmlRvFcXpNP+2Vb8\nOxfdFsWwp5oEPEESbyTIkaDBFgONEvR+lEcNS2QW7GSp1W09PCh6rOoVYc7X\n5Z6O\r\n=AuNg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCv827LxJaVRV0DInbTosV+834qbBrvTQHX+tqatzeujAIgeyrCLBDpYxw1KypmIV2p0WLr2VDBoz+znCbaOVs04G4="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.15.0-canary.e9b01b35.0_1587425365282_0.8297550688191697"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.15.0-canary.ee7e8989.0":{"name":"@material/mwc-textfield","version":"0.15.0-canary.ee7e8989.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.7b4482402.0","@material/line-ripple":"=6.0.0-canary.7b4482402.0","@material/mwc-base":"0.15.0-canary.ee7e8989.0","@material/mwc-floating-label":"0.15.0-canary.ee7e8989.0","@material/mwc-icon":"0.15.0-canary.ee7e8989.0","@material/mwc-line-ripple":"0.15.0-canary.ee7e8989.0","@material/mwc-notched-outline":"0.15.0-canary.ee7e8989.0","@material/shape":"=6.0.0-canary.7b4482402.0","@material/textfield":"=6.0.0-canary.7b4482402.0","@material/theme":"=6.0.0-canary.7b4482402.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"3b58236c5ca9326b11d092c5b9977dbd601298a2","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3b58236c5ca9326b11d092c5b9977dbd601298a2/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3b58236c5ca9326b11d092c5b9977dbd601298a2/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3b58236c5ca9326b11d092c5b9977dbd601298a2/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3b58236c5ca9326b11d092c5b9977dbd601298a2/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3b58236c5ca9326b11d092c5b9977dbd601298a2/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3b58236c5ca9326b11d092c5b9977dbd601298a2/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3b58236c5ca9326b11d092c5b9977dbd601298a2/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3b58236c5ca9326b11d092c5b9977dbd601298a2/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3b58236c5ca9326b11d092c5b9977dbd601298a2/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3b58236c5ca9326b11d092c5b9977dbd601298a2/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3b58236c5ca9326b11d092c5b9977dbd601298a2/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.15.0-canary.ee7e8989.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-BN9DdV1ZF5BlkaBznD1SjDmVVQQh0Zt8+/4Vzzpsdbfsm73tvLcXxrZ2eBL/ZW82B8bmZUmHnHvhWjLMqyPHPA==","shasum":"1d23d7947b0423d5a54ddea9f4681c83e0cc9d1b","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.15.0-canary.ee7e8989.0.tgz","fileCount":20,"unpackedSize":260232,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenkOGCRA9TVsSAnZWagAAz+4P/2ZNGcky2mG/gly3jZ0l\nnyTVel1dEqEpANlNxB9/mBWJ4VXUa6lCaOv2U1WhU8NJHPOM5EYnm43esLnn\ntuvs/ppLmrWUMPTacz1lM9DwYs/Li9HwmDdKw8WqISa6UcJtVplbc3mLbvki\nKNI3gQGzF20iLZoMHmnL+48Y9CIub3wctJvAf7Zljg0L6QSMjqTPRopxZ05t\nWOEiFI60tJPyQuP7E17K39Rc6fOYGtX8ZI5u8r21J+gK9BJlS4HgvHltnkhJ\nxnoAaGRH+RMRiUUMub/+CdJkAQBtPNvTuWcmSThHh2WeEf4Q2PFGKeMr7+0D\n+0r0wypMdZYXpoC6bMX7StQp2xGTWjOk+JppXNjsuofAvi0vr+ck6Bhx2Tfz\n79beFZIDT3SxK7Sd/iQ3ulIj3jfxWgrqVN6u0j7y4gHvqZdJEJqZ7LSL6UVi\njL+sSLfAWTCn8NukJEu2p+DDNAZGXdpuZ+cFBunBqsltcMM+ux8cALhpyqe4\nWzXGkDA0Kw7+YMHh+S18/lLj8itql32mISCq0kUlgEpI/qMVLYzUTzTwTpN1\nUCmUbcLQG2IXOzcVqgv6JnGoGZEkeulrWOFty6PMBrbuc6+xrFGJZcUiKr8o\nBiQ7fYBHZD48Blj5XE1rL1J0iT6sR8XqeJZ9N3rMRTSmbK6BSqs8r9TmhDX5\nBGjX\r\n=TQ1E\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCSKD9kws6hg4BZv137uXUpZ9117b+jTcy0svf2HnCeQwIgc3qtnXWXwY1X/XYvjGCjoHRT8mMNU1WtqXkIFVJaHak="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.15.0-canary.ee7e8989.0_1587430278137_0.03470538080677521"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.15.0-canary.9bf47ffa.0":{"name":"@material/mwc-textfield","version":"0.15.0-canary.9bf47ffa.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.deda86d8c.0","@material/line-ripple":"=6.0.0-canary.deda86d8c.0","@material/mwc-base":"0.15.0-canary.9bf47ffa.0","@material/mwc-floating-label":"0.15.0-canary.9bf47ffa.0","@material/mwc-icon":"0.15.0-canary.9bf47ffa.0","@material/mwc-line-ripple":"0.15.0-canary.9bf47ffa.0","@material/mwc-notched-outline":"0.15.0-canary.9bf47ffa.0","@material/shape":"=6.0.0-canary.deda86d8c.0","@material/textfield":"=6.0.0-canary.deda86d8c.0","@material/theme":"=6.0.0-canary.deda86d8c.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"282e30290957ddb18c6119523574ba36c65d7abc","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/282e30290957ddb18c6119523574ba36c65d7abc/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/282e30290957ddb18c6119523574ba36c65d7abc/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/282e30290957ddb18c6119523574ba36c65d7abc/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/282e30290957ddb18c6119523574ba36c65d7abc/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/282e30290957ddb18c6119523574ba36c65d7abc/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/282e30290957ddb18c6119523574ba36c65d7abc/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/282e30290957ddb18c6119523574ba36c65d7abc/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/282e30290957ddb18c6119523574ba36c65d7abc/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/282e30290957ddb18c6119523574ba36c65d7abc/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/282e30290957ddb18c6119523574ba36c65d7abc/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/282e30290957ddb18c6119523574ba36c65d7abc/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.15.0-canary.9bf47ffa.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-uSE6unqx66MMkFo4vhN1zcMzINzoYTret7GidVaKytG+B8Ms89oyBo/98PEFTtGa8zzhT8Saj2+wpECsBYewPQ==","shasum":"f61a1ee7e500167b1c51210f561a12bf80ed5f5c","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.15.0-canary.9bf47ffa.0.tgz","fileCount":20,"unpackedSize":260232,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenz2BCRA9TVsSAnZWagAAhbQP/Ra77BDkjzrwu+GCNo1Y\ntPlS2pBTTspXYqNz3v7CgYDfc/Nw8zz4I2C/j+evTYiNEcWebdYrhRxtUAM0\nopc9P3lwJeYY5cF0b/Zt1wm3fVyYQSyUnzGwE08MtsrUWKBrXjtgU5bBieVr\nqk0Bk87QAQ3MJHgMlhallTTKOKrS5amI94DVvQyDu0qehrp8cM/PGgNGkfsH\nBvHRd4f7FSHYihiIDm27wnwNjPuVysQZMbHAzLIE9rTVM3lDUo2ehvucN4Cj\n4laIsXm6+0Z9Svrc/DztavEPsdjU9vRQmTEJQUoCqJZ3D3YEMQn3IR65zDwF\nD6UzuWJyDsR8eNpePI/6nAK/0C1d/MdPotJWbEHisqHTEx9Ih+HWoPxtTUZS\nEzXc+YGq7WwAFuFxaSj4w+vSrhf7ZIri8Lmj8TTtedfKUQDqjdRl026cLzeV\nvgfZDxIHRMVma70UDcmA8P/p7m60VcZ49OfOyKSkCLuKyb6v6Fi6i/Sgk2wy\nLq4MRQxETKMqb0tk3ww+3lXVP/WCDfEfQiV34yH9aWjNKnBR1jozeyLDY2pW\nKj8jdney5H+GiY3awk9oqfv5N7UXI7S8qE/rabj6ZevxEM4cQGcdCggTHS7j\nUPNhdQR0JLh9B8Wto1lo/zrJiZG4oqNQCgyiMvriPBzC7+5hHWwatFeQDwtr\nYpq2\r\n=UHU3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHwQj3BYnmEYnPVzhKnl9Xm48qcNADBCJxIQuHa2WEmeAiEA4ezmEsBjF4GkLfFuXUmDiiAoxbjE6PiuLhppVkdXO6o="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.15.0-canary.9bf47ffa.0_1587494273408_0.8721685025820887"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.15.0-canary.078dbd98.0":{"name":"@material/mwc-textfield","version":"0.15.0-canary.078dbd98.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.c141801d5.0","@material/line-ripple":"=6.0.0-canary.c141801d5.0","@material/mwc-base":"0.15.0-canary.078dbd98.0","@material/mwc-floating-label":"0.15.0-canary.078dbd98.0","@material/mwc-icon":"0.15.0-canary.078dbd98.0","@material/mwc-line-ripple":"0.15.0-canary.078dbd98.0","@material/mwc-notched-outline":"0.15.0-canary.078dbd98.0","@material/shape":"=6.0.0-canary.c141801d5.0","@material/textfield":"=6.0.0-canary.c141801d5.0","@material/theme":"=6.0.0-canary.c141801d5.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"a45b9b95a7710162ffb06fe74053ff1d108d5684","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a45b9b95a7710162ffb06fe74053ff1d108d5684/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a45b9b95a7710162ffb06fe74053ff1d108d5684/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a45b9b95a7710162ffb06fe74053ff1d108d5684/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a45b9b95a7710162ffb06fe74053ff1d108d5684/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a45b9b95a7710162ffb06fe74053ff1d108d5684/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a45b9b95a7710162ffb06fe74053ff1d108d5684/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a45b9b95a7710162ffb06fe74053ff1d108d5684/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a45b9b95a7710162ffb06fe74053ff1d108d5684/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a45b9b95a7710162ffb06fe74053ff1d108d5684/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a45b9b95a7710162ffb06fe74053ff1d108d5684/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a45b9b95a7710162ffb06fe74053ff1d108d5684/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.15.0-canary.078dbd98.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-9iXZizEsRwgmyW4Yyke/ybXRjhjzxxje/unbESat5gmZ/mG+bbkgRB9cAmMqfE1kScFrctj8EH9NgFdBs2/k9Q==","shasum":"a7135116131b1aef6c15134a8e2420d26abf73ae","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.15.0-canary.078dbd98.0.tgz","fileCount":20,"unpackedSize":262824,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJen2GuCRA9TVsSAnZWagAAkAMQAIu3QwO2HemI5OtT3tqO\nFNf1NAbKdYhKWsOqpBPmTKdhnB4RwJXRV6+5Pz7BcHZryXOvZ4ER0I3uyETq\nfFrXG9zvuhmge8tF+NRXlQPypsVxrkudmKebXX4n3II8dmnWnBFX/E7qHhDX\nO4wSAUtWw+mpTJkSflIL0PG9ABYtC4bbZDv7sqq55crze8uPNONUC6wr7nP6\nBor2HJDpOhcg+B/o6Bq6FZENdwVH+OhoFHKMrEs/TeULNjXwCXYt+HB1pNMo\neIhpIkafUvxSIA4EFuXNKaxz3UE62DxYvDHBAgqWGDLcZiy4fsZkCwnzcjau\nbCWtZqkUMeNu9iq06SqJyOV+RwROk5brOwrktD7XdBqX/kiJga70pickD2ht\n+y80ksT5ozqwAOx/S+TrRtg7KqTembyB8IMcKHHxFhgC/yCR6y1M1s0y7ngB\nckZswB3iqwPhemqcYA9+TNfCd4yKpF0mc4Vkhqxd3mxt0CAY2Oy96Q3PsO6M\nyl2bN8hp6XT34kJf+BL1bCumRcxEowRFdj12KdRbxyd93jeVkyIHS7YPu8lk\n6VE8rX8LMTmxZJb3IwC7mAIXX/elTDwmkRyhYFQoX7wc+ddTK2gTGDGauIGx\noPlXFQimnTynzvpa1Zg0f1ORxWikQysNbrbpewGjmK8rlLQhBvRvls+/c634\nuk6O\r\n=e2nw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIERYXlo2iRFXWbd0aeLudpWcbsCrwLNg2kVAjwixVyGtAiAhx7ilK2OpKNz4e/EuvbEDAMhTVuGvdRyvs04w/xrMyA=="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.15.0-canary.078dbd98.0_1587503533980_0.9221909159035215"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.15.0-canary.953015d6.0":{"name":"@material/mwc-textfield","version":"0.15.0-canary.953015d6.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.c141801d5.0","@material/line-ripple":"=6.0.0-canary.c141801d5.0","@material/mwc-base":"0.15.0-canary.953015d6.0","@material/mwc-floating-label":"0.15.0-canary.953015d6.0","@material/mwc-icon":"0.15.0-canary.953015d6.0","@material/mwc-line-ripple":"0.15.0-canary.953015d6.0","@material/mwc-notched-outline":"0.15.0-canary.953015d6.0","@material/shape":"=6.0.0-canary.c141801d5.0","@material/textfield":"=6.0.0-canary.c141801d5.0","@material/theme":"=6.0.0-canary.c141801d5.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"d875e6d658b1a3287b35d2c77aa8274d9828fb46","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d875e6d658b1a3287b35d2c77aa8274d9828fb46/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d875e6d658b1a3287b35d2c77aa8274d9828fb46/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d875e6d658b1a3287b35d2c77aa8274d9828fb46/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d875e6d658b1a3287b35d2c77aa8274d9828fb46/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d875e6d658b1a3287b35d2c77aa8274d9828fb46/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d875e6d658b1a3287b35d2c77aa8274d9828fb46/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d875e6d658b1a3287b35d2c77aa8274d9828fb46/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d875e6d658b1a3287b35d2c77aa8274d9828fb46/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d875e6d658b1a3287b35d2c77aa8274d9828fb46/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d875e6d658b1a3287b35d2c77aa8274d9828fb46/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d875e6d658b1a3287b35d2c77aa8274d9828fb46/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.15.0-canary.953015d6.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-tJ+cd501vBTqlttF9o0hEpjUjncn0zBt/qytHJ7vimiTvMICiLMkGyZv+awgkytupuL6bARg46LEJRM7KUZeFA==","shasum":"477ff59a0215a3f1fe3b34a44341cd3ba0d98f86","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.15.0-canary.953015d6.0.tgz","fileCount":20,"unpackedSize":262824,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJen2cnCRA9TVsSAnZWagAAQxMP/RXCVaGMiUnVuv4LzUCS\nJEesv/KAlunvUGT8KYmpC8hPDAz2OP+gEyCeF3umQHEGtn5USc9+DnAed9BR\nj2ap7UhoV0mznlL3Pckil/yVhAW3Jdw1RNFP1lLPaMp1Ny1PHhB1A19g+BMm\nW3GU6K++j5Xal3KbZIOv8ma58J681BBxdb6YP0gyvuwxSfRrFB1jDeeXi6rP\nqqBfcy4YTZl3AZkVCDJi6P69/aXxJTnVjlIfSZwAP0tvaso+0ZD+mqM40WT4\nw8KfGB7yrVTC8Ihnwbp6/B2kAofq+htXdfuBCGNeBWpmQKmxP/SqsBE1VfHq\nm4SBRA+0Gk/2v1LlaK4oeQPOJ590t6qFLzEZIfETz6uhAeb9iPMoGagAFBS5\nu4wVT6EGfC/r1vvUO2wo2ldkhmcWdLYN2sW1nVQ1F9/D6YXJ6UQ1k3DptuZU\nELMzmLNriIYYpcUmQkWOxhybyabH/6FvuYK+LTkZ9fzYTX+4Ixifsys7SWsj\nHIQfCkzbj9BaCRB7LAkcqEnCi0y0n6clj0Ht60ysdhN6WGqoKdLKyZfb1gFa\nLjbNZDZ+aeLSQyF1deiyZxlsAIyWSTmDM+XtzJnl/mIvdtzMYi/7VdnacD/Q\nKwPY9j5w6t8q7SUJf3ofFxZ/N33FeodN3ukYs6zt6OIINF9K3QJL/6e7m61/\nxNGT\r\n=7cPS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE0Vl5cV68ssVxT4aZFPOfkIm5aygsbWPM97T2yjIVbiAiAXia/uJR2FgHWkd3oOvYheujjPBhDeuW43n80ZKnZYFQ=="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.15.0-canary.953015d6.0_1587504935071_0.3121510594470158"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.15.0-canary.c360ec63.0":{"name":"@material/mwc-textfield","version":"0.15.0-canary.c360ec63.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.c141801d5.0","@material/line-ripple":"=6.0.0-canary.c141801d5.0","@material/mwc-base":"0.15.0-canary.c360ec63.0","@material/mwc-floating-label":"0.15.0-canary.c360ec63.0","@material/mwc-icon":"0.15.0-canary.c360ec63.0","@material/mwc-line-ripple":"0.15.0-canary.c360ec63.0","@material/mwc-notched-outline":"0.15.0-canary.c360ec63.0","@material/shape":"=6.0.0-canary.c141801d5.0","@material/textfield":"=6.0.0-canary.c141801d5.0","@material/theme":"=6.0.0-canary.c141801d5.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"5147ccee26bbbacc14a1d7d86adb845ed406bbac","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5147ccee26bbbacc14a1d7d86adb845ed406bbac/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5147ccee26bbbacc14a1d7d86adb845ed406bbac/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5147ccee26bbbacc14a1d7d86adb845ed406bbac/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5147ccee26bbbacc14a1d7d86adb845ed406bbac/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5147ccee26bbbacc14a1d7d86adb845ed406bbac/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5147ccee26bbbacc14a1d7d86adb845ed406bbac/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5147ccee26bbbacc14a1d7d86adb845ed406bbac/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5147ccee26bbbacc14a1d7d86adb845ed406bbac/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5147ccee26bbbacc14a1d7d86adb845ed406bbac/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5147ccee26bbbacc14a1d7d86adb845ed406bbac/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5147ccee26bbbacc14a1d7d86adb845ed406bbac/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.15.0-canary.c360ec63.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-vCnuOFwk6i5eVIPJ/DjpaR81eSaQekFH429Ey0thL1OjIJ1LnlZVOoOr+APo097rupUQj5OB/gCp9DGJ+05zjA==","shasum":"03582a81b1d911d900535a49edae434f4cf243b9","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.15.0-canary.c360ec63.0.tgz","fileCount":20,"unpackedSize":263689,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJen2ytCRA9TVsSAnZWagAA0OsP/R/7NAvodq7P6DIRQDQr\n+TTZS1V8+ioSof9eZNjWIZdwo5Ax8hxc6PxNuft5B7YuOjANw5R2vqLXxbVD\nuxFGjIbROCau8HtY+5tfd3eTsu6uNQp2v7mNYucI5Ywtvd6aPFYXlW559YKm\ngRLfeFzbAU/2OlclU+IeFXCHIcqkB5xt/nHTBaO4r5+4BrBXQIoZx5dVITh5\n/U1ixvXtwHpYZNcwFGkiTv0by0bkGpe3SZBUQjgYwSbNtcUl4t/8uV8OSeEv\nX0NIhMO1yPMwmqtvSFJgU0p/M6kAgbDXHM5+4/It1Q9AueyChh4Bu4OvkO4H\n5veQ5tapo48n7LKzN6Ll6IT1Zy+KOGGkobJzwdi9Z4QE6/5Za60sKqwJXMxk\nVF7in1dBrouMhJhonwYNB/W0WvTD5/WsYoPETX9Ptga0uzDCon6UkULN7o5b\nTCNYoAiGE2zbL7Oy5DP4aRsnlA2WyKHa6tzvLuGmso+7xLafGULcUZsWO32R\nkrcrYPt/71sGHnNjKFHHYyZnx+AUemXVDjkvNChLtYx8fq2dJZLCqGkL/C8K\n/zEW5VYbFo2BvYq39PYZQoPvdtkGEFnEGE8A11ymKrm6AHd043+i7Zb4q17D\nhnwakrS+rcEB3T+hIMDGI2D3Z1s7ZaSrX9A2bL6BRD/3Jhnt3YLn0XVDE5G0\nRSnu\r\n=b6NE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCOK5BJMlnBJnTwzPPQPwrS/1gPN4Fu+fhnciILOD1R6gIgT2nAYkjktYyWf4YL2O+4RgjJ5D79fX3ESZ0J6wzlxxQ="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.15.0-canary.c360ec63.0_1587506349385_0.9126060204394153"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.15.0-canary.d71b65aa.0":{"name":"@material/mwc-textfield","version":"0.15.0-canary.d71b65aa.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.c141801d5.0","@material/line-ripple":"=6.0.0-canary.c141801d5.0","@material/mwc-base":"0.15.0-canary.d71b65aa.0","@material/mwc-floating-label":"0.15.0-canary.d71b65aa.0","@material/mwc-icon":"0.15.0-canary.d71b65aa.0","@material/mwc-line-ripple":"0.15.0-canary.d71b65aa.0","@material/mwc-notched-outline":"0.15.0-canary.d71b65aa.0","@material/shape":"=6.0.0-canary.c141801d5.0","@material/textfield":"=6.0.0-canary.c141801d5.0","@material/theme":"=6.0.0-canary.c141801d5.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"5f57992160b26bdf181837dfc0b0ccac0425b3a2","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5f57992160b26bdf181837dfc0b0ccac0425b3a2/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5f57992160b26bdf181837dfc0b0ccac0425b3a2/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5f57992160b26bdf181837dfc0b0ccac0425b3a2/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5f57992160b26bdf181837dfc0b0ccac0425b3a2/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5f57992160b26bdf181837dfc0b0ccac0425b3a2/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5f57992160b26bdf181837dfc0b0ccac0425b3a2/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5f57992160b26bdf181837dfc0b0ccac0425b3a2/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5f57992160b26bdf181837dfc0b0ccac0425b3a2/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5f57992160b26bdf181837dfc0b0ccac0425b3a2/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5f57992160b26bdf181837dfc0b0ccac0425b3a2/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5f57992160b26bdf181837dfc0b0ccac0425b3a2/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.15.0-canary.d71b65aa.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-eCw03FTo5rv9dcibvHSeYxfPX360f1wsxqig/ftLluSgnqo54pXKYhpA1o9Nc0CxbO4GReTEF4pmf4mlgDIP7A==","shasum":"894dd6523f83d5bdd2f167c33355ad1b0ade4311","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.15.0-canary.d71b65aa.0.tgz","fileCount":20,"unpackedSize":263689,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJen3W0CRA9TVsSAnZWagAA4WUP/2ECBlw/quzKywe6XZpL\n61janctTaQ5UCIYztKiXWke0DuAZaQuUd8UBPOawjokpV9zeYeb54Y/SNrTj\nfkwqWBAVMLp4zeuR/LHjkDqItuhwvBKpPzqJDBMVnvcTJSpBRFKzIwm56Wj1\nej+j9Cyu0O79QaATZeQqm0K3DKKwi70wF6dYQOtLd1CNI5CbY0hlrKmS8Yax\n/6EQhb8MbwOTMNiDLPCy8pjbF+vml6bW0T9FAsJvUrjnom8PzMSUrWAWwHmh\n+rLuozus3J9i7u/Qy/jboWP4hQOiX3jFBHvL6arjDgNU7TMQefb/ksvgT1de\n1cF06TEzo4ETpUzLmtx2oT8Ev0AfqAVEBgPFbPPeAsxFXkD56f8yjUzWu0iL\nl1j26lRDZ9gOqtVHa/FPJsMkfrCtbFDQG2zT+zeBtZC9TmcxXg2YMoA2/ccm\n2R2fUiJutsrBs3AveF04jKWIsiewdwIU2PgrT9ovIbPLGlBWiZbi/C2UdI0v\no+YHlmuhKLabh0iBxnQl4Wvilr7ygCIwonxm568yD4NmQQymitiEYorFofMw\nkSJyv6r39ErWjFaXlq3c8QvzPp5a42jkOHUSLDny9Dv+jQaiHe8Jo3ggVZWN\nUVUAHmwFSkK4XLFOm2AxywACupNsuCOlv0dlZ8ppzsvOLcF8HEGWHE74J7FU\nbZCv\r\n=F/EM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCY5PDDpyUf2z5xeP856sygtirLK9QozbbuZVzwtorFIAIgF63IUeWviXwa0oIRImikNGiF14NkLlmDs28vuxUTV64="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.15.0-canary.d71b65aa.0_1587508660136_0.9555361949115795"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.15.0-canary.58d51135.0":{"name":"@material/mwc-textfield","version":"0.15.0-canary.58d51135.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.28d10a96e.0","@material/line-ripple":"=6.0.0-canary.28d10a96e.0","@material/mwc-base":"0.15.0-canary.58d51135.0","@material/mwc-floating-label":"0.15.0-canary.58d51135.0","@material/mwc-icon":"0.15.0-canary.58d51135.0","@material/mwc-line-ripple":"0.15.0-canary.58d51135.0","@material/mwc-notched-outline":"0.15.0-canary.58d51135.0","@material/shape":"=6.0.0-canary.28d10a96e.0","@material/textfield":"=6.0.0-canary.28d10a96e.0","@material/theme":"=6.0.0-canary.28d10a96e.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"1e70b1d32a2db9ff5da6f37c7b50790b6269e8b0","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1e70b1d32a2db9ff5da6f37c7b50790b6269e8b0/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1e70b1d32a2db9ff5da6f37c7b50790b6269e8b0/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1e70b1d32a2db9ff5da6f37c7b50790b6269e8b0/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1e70b1d32a2db9ff5da6f37c7b50790b6269e8b0/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1e70b1d32a2db9ff5da6f37c7b50790b6269e8b0/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1e70b1d32a2db9ff5da6f37c7b50790b6269e8b0/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1e70b1d32a2db9ff5da6f37c7b50790b6269e8b0/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1e70b1d32a2db9ff5da6f37c7b50790b6269e8b0/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1e70b1d32a2db9ff5da6f37c7b50790b6269e8b0/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1e70b1d32a2db9ff5da6f37c7b50790b6269e8b0/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1e70b1d32a2db9ff5da6f37c7b50790b6269e8b0/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.15.0-canary.58d51135.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-ZFxRbsu4gya+iZFPlUU5dTY0sbOHTAPdltT9019jGQTCIi8SXElmx4hlNHsDZkdyy4SUzYeYzc3flDw91utVnw==","shasum":"0ea352248dfdc192c7bf87f15005803a3b79d731","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.15.0-canary.58d51135.0.tgz","fileCount":20,"unpackedSize":263689,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeoOUFCRA9TVsSAnZWagAAgA0P/0DVl1vA0Dwe4Se182PS\nX79YC6fYrTVvrdj9GyiSxzwruv2haTY+5rrOEZBTmhbF1WmiTEJNGVwR1i7C\nhOLXtPijpVfDjoBtzl2ydOyNIlC56Ab8ps65qhFfetyyRozPtwfhZ178bht+\npqqtXU7Q3bR0lKOrHuvL112cLzVr5/9wNZx66PGc7zaSOWUdAuNR/Y1cKja3\nbMA3b4CYJH+wU/tf7rE3nRm8Y43TURdAw1T7joSNfuSvZNNwlxV8A5cZkYtY\n1TFSgL7WVq8jAUx8JlokaDfM0sUdsqqMFD/FAvWE3MPlWO8/F5Qbf27RPi/D\nL3mXkYrIZObHNx6Zn6P+CrsKhMJWUqcq3qPs8mtR//XjcYUzRTXcmEYEV3DU\nWOUcP0ImD9GBfMDbj2mkScVzcdWnnHTj3AUNg5wuo5CTNtaRpQpiihuPy4nk\ngGTv8DQouvKicrfUEAbjPR60wrClZfihKk9/rH4kPgsT4BLdLoheEUtiquPJ\nr795cggEAFtZjohohtUebAMxLTWHXYrx4jlhvKkodEzVRhQfDtIuE31yreLs\nN7W+QwOdUTT9WiMUJ6iuJ7Q1fgyj5GuuELtVHOuEIliaM73LEAJUHadW+8i8\nZzSxLv85Z9/k6t9MtbLUKEC0cefO59h1XjG8cJfL5IIifvXRLnws/NCab4FO\nGLAm\r\n=qADj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCDZ/RWYDyyexoPzaZmIjpWONYtuuzviZI+Ea8sv/eYqQIhANs6KYYN6rfvSKcefRaP0BwVy+99hJ1MhsUGZ3HUiBB7"}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.15.0-canary.58d51135.0_1587602692954_0.5263421231379237"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.15.0-canary.d0af8ba3.0":{"name":"@material/mwc-textfield","version":"0.15.0-canary.d0af8ba3.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=6.0.0-canary.28d10a96e.0","@material/line-ripple":"=6.0.0-canary.28d10a96e.0","@material/mwc-base":"0.15.0-canary.d0af8ba3.0","@material/mwc-floating-label":"0.15.0-canary.d0af8ba3.0","@material/mwc-icon":"0.15.0-canary.d0af8ba3.0","@material/mwc-line-ripple":"0.15.0-canary.d0af8ba3.0","@material/mwc-notched-outline":"0.15.0-canary.d0af8ba3.0","@material/shape":"=6.0.0-canary.28d10a96e.0","@material/textfield":"=6.0.0-canary.28d10a96e.0","@material/theme":"=6.0.0-canary.28d10a96e.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"86c71b26d7f2ffcaefe79c4882ac9867bef12b0e","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/86c71b26d7f2ffcaefe79c4882ac9867bef12b0e/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/86c71b26d7f2ffcaefe79c4882ac9867bef12b0e/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/86c71b26d7f2ffcaefe79c4882ac9867bef12b0e/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/86c71b26d7f2ffcaefe79c4882ac9867bef12b0e/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/86c71b26d7f2ffcaefe79c4882ac9867bef12b0e/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/86c71b26d7f2ffcaefe79c4882ac9867bef12b0e/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/86c71b26d7f2ffcaefe79c4882ac9867bef12b0e/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/86c71b26d7f2ffcaefe79c4882ac9867bef12b0e/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/86c71b26d7f2ffcaefe79c4882ac9867bef12b0e/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/86c71b26d7f2ffcaefe79c4882ac9867bef12b0e/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/86c71b26d7f2ffcaefe79c4882ac9867bef12b0e/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.15.0-canary.d0af8ba3.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-QOsaKBM29oi6ni9lJXmvpJAweq+fC2Xe3MmB5LzMk+9KWAh1B7Rf9EldiCrpxR5Mn2K4Q+dGEpTwaFUgyJ9vGQ==","shasum":"d76569b1486d14863d1b0ea96ac74ad8d12c3d5e","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.15.0-canary.d0af8ba3.0.tgz","fileCount":20,"unpackedSize":263689,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeodoDCRA9TVsSAnZWagAA+8sP/1WtBVdxNVEZRJy2j75q\nsWfQ6t6AvIJWSHuF3JFQhqkAVdYydF2IG2UCnIKVr5R6g1AXemaELYyQEhDx\nzZvLLrFdDOBuqgU9BUE4IGWjuINUc36bnlUuXjLETcPampk7H5LfMTJHvBIC\nUAfhN80iHpp4n18tzrvzuGr7p9kT2if8sBkCj+pBZMRjzywhpnoE42kFuzGl\nyN3MRabFSIhITaU59qmxv4pnfftKFbAgUP+YxqiAqtW31pZpc6GuORSTC5uK\nBtkZbayi0Yz9dAS9YGkj+cvZk9CIzwtj4/ISnnlkVsuAbboYKMTSAJGj1Qmo\nYlxCDiWdYisgypW9w5OW/GUWWawms0HYLQ60HxCPv6iSsNPVfxYr06Bz3YAm\n4fKuo9SokFUcQd6VrVy8dciEiWuyU0NCPwyFOnncs1CtJKKPTgLimUwF2hS/\ne+AuUFpovx2CSCUe4ZwlndIoUS/N9RLaxIV/HTssZuYLVcYBuV3EDTIB/5Ka\ns7uvULVrPPj/BWhxAe4e9mRejAzhCU31CSK5pRCzsPFz2UZDyc6Olsnesa0Z\nM/QgJo/VMOSBuZQGz/7w0yqkcrgDUD+jIyLk2iP2QQ3hAydrF1TmGqos+ZB3\nfnEFaQcq28A+9kOwpdau9FMdRQRcThDEKb9eeEDVDFRnbiNyUtqvdQU9R10P\nB/q5\r\n=BSFg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDKgw/XRd0kuLSfGTmEgZeaTkFmWRRdIrgcXnuqzj3P2AiAICYf4tjJZtkBuFMrntpfbfKEbfLx/d913CeC4XoUWUw=="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.15.0-canary.d0af8ba3.0_1587665410573_0.8252429534325239"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.15.0-canary.8872b17b.0":{"name":"@material/mwc-textfield","version":"0.15.0-canary.8872b17b.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.8540808be.0","@material/line-ripple":"=7.0.0-canary.8540808be.0","@material/mwc-base":"0.15.0-canary.8872b17b.0","@material/mwc-floating-label":"0.15.0-canary.8872b17b.0","@material/mwc-icon":"0.15.0-canary.8872b17b.0","@material/mwc-line-ripple":"0.15.0-canary.8872b17b.0","@material/mwc-notched-outline":"0.15.0-canary.8872b17b.0","@material/shape":"=7.0.0-canary.8540808be.0","@material/textfield":"=7.0.0-canary.8540808be.0","@material/theme":"=7.0.0-canary.8540808be.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"d1f49732d08170a0330f9fb28f2b2ca978daf858","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d1f49732d08170a0330f9fb28f2b2ca978daf858/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d1f49732d08170a0330f9fb28f2b2ca978daf858/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d1f49732d08170a0330f9fb28f2b2ca978daf858/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d1f49732d08170a0330f9fb28f2b2ca978daf858/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d1f49732d08170a0330f9fb28f2b2ca978daf858/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d1f49732d08170a0330f9fb28f2b2ca978daf858/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d1f49732d08170a0330f9fb28f2b2ca978daf858/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d1f49732d08170a0330f9fb28f2b2ca978daf858/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d1f49732d08170a0330f9fb28f2b2ca978daf858/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d1f49732d08170a0330f9fb28f2b2ca978daf858/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d1f49732d08170a0330f9fb28f2b2ca978daf858/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.15.0-canary.8872b17b.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-XRvSILyspK3J8fiT2c5u6Oz3XZkQsoDV7Lvw9wqYM3LfpkmITIhE+GWSixnmH5Us53DRkUQCtetjQqwIjNuqXg==","shasum":"50b4466752b29aaa221642710476c63e453fcebd","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.15.0-canary.8872b17b.0.tgz","fileCount":20,"unpackedSize":263689,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeof1bCRA9TVsSAnZWagAA6TMP/23fMilcjTtK63/rm1GY\nlTAuWEw80vhHUBM1c5OZZpIkYeb5uLLYJmgsla2OzSmuWJczdtq3UYSwl0tm\nXqq11TV7/R/XBBc3KeX5+X1VdEAg77bCnoqi4eiTDWfe5lnMd6HUTxgidq0H\ncys7UW5WTSHt4YyYUIzHBjvec3AnmTFKv3sy4pvkIk4pTuRbXJl9+VHjeIvn\nMa+G/RgJ254OdN56dPcNNokPWRiDPiqC2h7vP+VmDluMejLiivrlsCclJl+s\nl75u2WXHJHdbXA1PINydyVX2xovidAYJUQ8aGHOQFUxx5sQA2J9mYaJMsYIx\n8EGEaaGXOOfcAMP4EFQjtoRYIippO4rF4lg0QkHI/OXGgF/26rCX11HMNuFq\n/b0ydWWCmXNbQPlnyIFxa6JjpguIgFNgpYBBlNqoHyNSTIzJlk+r3T20X8nY\nUsV5eB8hbEkSZyxA7nog82jS3X6LFSiKyEHG59j9NgHR38EIqGKTNAy+3fTg\nDy+KnDAywsokCpNXFsWQ3W4uX37x7VZg9LUy+OjlBnrukVIO+4ibtlKIHrlu\nCIMuS5ssVP+nim3yIiC4Pe/96O+0PMo6lcv6uiHvDus9bJqME2qKTr8WYd5/\nRYIXTJN9BJmFMWKoEqKTnNGxJ5Bc4mUksMU3DKcIDk1sDZNJhgG6wA2s5V8N\nPA7P\r\n=8+9L\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIASidRkt86Cys7Gp3rhWAirutha2npso0xNP8zl+ybhrAiEA27FIz0u9C1tWWjiugxf/zhcBamiACh1ChwQ4CGpu2CY="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.15.0-canary.8872b17b.0_1587674459068_0.4825687716871294"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.15.0-canary.eca1a610.0":{"name":"@material/mwc-textfield","version":"0.15.0-canary.eca1a610.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.8540808be.0","@material/line-ripple":"=7.0.0-canary.8540808be.0","@material/mwc-base":"0.15.0-canary.eca1a610.0","@material/mwc-floating-label":"0.15.0-canary.eca1a610.0","@material/mwc-icon":"0.15.0-canary.eca1a610.0","@material/mwc-line-ripple":"0.15.0-canary.eca1a610.0","@material/mwc-notched-outline":"0.15.0-canary.eca1a610.0","@material/shape":"=7.0.0-canary.8540808be.0","@material/textfield":"=7.0.0-canary.8540808be.0","@material/theme":"=7.0.0-canary.8540808be.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"c2d2c958e6704a2df0a1a210e3c3d050dbe7a50f","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c2d2c958e6704a2df0a1a210e3c3d050dbe7a50f/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c2d2c958e6704a2df0a1a210e3c3d050dbe7a50f/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c2d2c958e6704a2df0a1a210e3c3d050dbe7a50f/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c2d2c958e6704a2df0a1a210e3c3d050dbe7a50f/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c2d2c958e6704a2df0a1a210e3c3d050dbe7a50f/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c2d2c958e6704a2df0a1a210e3c3d050dbe7a50f/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c2d2c958e6704a2df0a1a210e3c3d050dbe7a50f/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c2d2c958e6704a2df0a1a210e3c3d050dbe7a50f/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c2d2c958e6704a2df0a1a210e3c3d050dbe7a50f/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c2d2c958e6704a2df0a1a210e3c3d050dbe7a50f/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c2d2c958e6704a2df0a1a210e3c3d050dbe7a50f/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.15.0-canary.eca1a610.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-yprGFNnnaqaRLA21mq6TzGOKGxPZhX7umBPiqGT1plS5YsI5z6GEHic5n9TFkYF1hZhlLcJd24E+PnpBwV2JEg==","shasum":"b02aecc3915a9bd1b36ae50e07a0a0e6269eb680","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.15.0-canary.eca1a610.0.tgz","fileCount":20,"unpackedSize":263689,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeogvjCRA9TVsSAnZWagAAOIkP/1rS7n7psOZZUjN85p0T\nE5qWpcAuxm984E7088yxOJTxVwoDB0wsMradx6f832FUDk7K92og2wHkVWYU\n3Sz16tqIyi5pqmuJC7F0e6KTGVMW3mdP+lN1pX1WNEXT77DAB3/My8ZRre+n\nUUYPkci6pJAUeu+/CmeejJYl+QkEPoaUEezzke0lzhfemIbXEBGXF0UNgBB8\n0Df23F8n3SB6pRH+6rfPiEx0ST5fVi/hdEMsyH45kWgjkS1/zO54T3GsROsu\nZlH9l9wm+Ng+o157l7AncOmLkBpdI5eRaYyqkmVWLGZ2r907D7RVdKWSzqWU\n3CcVCO+5IxHHIb9jnuNSfcncvAhJNBgL42Z6BQdWddW7wV39RA9nx1KYlTlh\nYEl/1UNKg/owwyW6qfxbvfyqZ7ikv0PjK6+VMVuOeKsxxqsj/bJtZU6E/HcS\naAGNRr/uJA5PwMVb4lXDH/v3D9+UlyZgfMHHc+11lcLREez8kxoZhOXAQPwV\n88+3LvdIpi4BhLVx0JhOnXn4P9kNYBzbqj+xT8eBT76JKb8q8yKPImKhAQLz\nAs1wbVTkHroX9fTCroaScSKKalnNfjPqJD9Clofw8pQXUfTiPLEn65D5J0q3\nFeAjlwzJigPh9lu9LBUMIUWR9vD5PNyKBivJz+UVwJtTptC48ZPj2Ik62od+\n6mFF\r\n=CXgt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC9OTke72MMjR5m8ldOHRTOQ0uktZRC3KIyKroEcGUSawIhAL94H8ngnfD9GIV6mQpEEZxTxMJxu/u08wgKK6I06KBk"}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.15.0-canary.eca1a610.0_1587678178578_0.27431770928057353"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.15.0-canary.baaf529e.0":{"name":"@material/mwc-textfield","version":"0.15.0-canary.baaf529e.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.8540808be.0","@material/line-ripple":"=7.0.0-canary.8540808be.0","@material/mwc-base":"0.15.0-canary.baaf529e.0","@material/mwc-floating-label":"0.15.0-canary.baaf529e.0","@material/mwc-icon":"0.15.0-canary.baaf529e.0","@material/mwc-line-ripple":"0.15.0-canary.baaf529e.0","@material/mwc-notched-outline":"0.15.0-canary.baaf529e.0","@material/shape":"=7.0.0-canary.8540808be.0","@material/textfield":"=7.0.0-canary.8540808be.0","@material/theme":"=7.0.0-canary.8540808be.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"4f5e01f380a9f1e5d4d3b0294d5110692bcdaee6","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4f5e01f380a9f1e5d4d3b0294d5110692bcdaee6/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4f5e01f380a9f1e5d4d3b0294d5110692bcdaee6/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4f5e01f380a9f1e5d4d3b0294d5110692bcdaee6/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4f5e01f380a9f1e5d4d3b0294d5110692bcdaee6/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4f5e01f380a9f1e5d4d3b0294d5110692bcdaee6/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4f5e01f380a9f1e5d4d3b0294d5110692bcdaee6/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4f5e01f380a9f1e5d4d3b0294d5110692bcdaee6/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4f5e01f380a9f1e5d4d3b0294d5110692bcdaee6/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4f5e01f380a9f1e5d4d3b0294d5110692bcdaee6/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4f5e01f380a9f1e5d4d3b0294d5110692bcdaee6/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4f5e01f380a9f1e5d4d3b0294d5110692bcdaee6/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.15.0-canary.baaf529e.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-noTNYmMXxR4PhCjd+HSmdIgFwwIzt9r5zvoev/3CZH6r0f8M9HRtKt/2LNTt5lGITyZ2zkCNA+r8uPpLD3aX/Q==","shasum":"434c314cbd4ea745a6e49a7da029be686cf4a25e","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.15.0-canary.baaf529e.0.tgz","fileCount":20,"unpackedSize":263689,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeoho+CRA9TVsSAnZWagAA8AEP/RLqBdMcEFVjutQ9geEN\nMSdE9jlIrOC+8bie78mF4moF/RXTR93EDHIQm9TVLCzXYPFOw6uwymkKhcnn\nN/FfhYg0UZvZbySE2o8vnI0mQbmpP4hImIiVf04Ylp8IprlgGVoi6IpPykn6\nCQ/VzPKd5/+xDiFYcQJBPuUzFdfjvcmRZ+hDV+tnbbZuci98bC/KwVR6rPzs\nxq+u+SF2N5Gh5zOiNKoBvI8GlPqwbf1/Hyfv56lyfPGNlVe1GqgPS8eDUfKK\nK+aj6Z6GZDrmypozIm2OptGWWtu5E6B9xfuHDl9oYc759/B5YauIRk8/lG3R\nTn5u5sR8qrWp4y+kSLnopMy4MLqTXGjj+0gSGiCbq2Ri72jZlGyaCP17FVYF\nuNIsIhFnu+DhTYCtiznfKTZ7cPG3w/xhllYd4D/JbwVSCPTjON0m9nro0lu7\nCWOHf0YTKw6R8rya6IZb1tu7tUYQS+u91r32ZomIf1bsDGQ0LD304W2gjsml\nVJS39xD2H0wQwjnHrbfGSLqSoNa+08vMlkpsRAo9YNwF4xre2LKNzFdjizFh\nPcppVXCps0YdQyHQv3t+kNUHmEqRB8Aivv5yOKB85qwt7Zgj3xs3NCPnmB/Z\nRRiVDt+J/iCCspPnWsgEGE6btMPc5rkSpFJTgAAE9RZkYKJoa1A0bdhoZLhb\ns7Sn\r\n=F87v\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD7KZPGqn8HZyKW33eGqAoQAmL6D32KA6VngNn6iQ+0CAIgCWD4PFOPvmlurtZBFElmd7ZC+gzJAz8aWPuvgliKjHw="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.15.0-canary.baaf529e.0_1587681853582_0.6761701455959326"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.15.0-canary.7a7992a8.0":{"name":"@material/mwc-textfield","version":"0.15.0-canary.7a7992a8.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.8540808be.0","@material/line-ripple":"=7.0.0-canary.8540808be.0","@material/mwc-base":"0.15.0-canary.7a7992a8.0","@material/mwc-floating-label":"0.15.0-canary.7a7992a8.0","@material/mwc-icon":"0.15.0-canary.7a7992a8.0","@material/mwc-line-ripple":"0.15.0-canary.7a7992a8.0","@material/mwc-notched-outline":"0.15.0-canary.7a7992a8.0","@material/shape":"=7.0.0-canary.8540808be.0","@material/textfield":"=7.0.0-canary.8540808be.0","@material/theme":"=7.0.0-canary.8540808be.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"b9b74b473b6026badaf980339f4451efd1a9e8b7","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b9b74b473b6026badaf980339f4451efd1a9e8b7/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b9b74b473b6026badaf980339f4451efd1a9e8b7/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b9b74b473b6026badaf980339f4451efd1a9e8b7/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b9b74b473b6026badaf980339f4451efd1a9e8b7/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b9b74b473b6026badaf980339f4451efd1a9e8b7/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b9b74b473b6026badaf980339f4451efd1a9e8b7/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b9b74b473b6026badaf980339f4451efd1a9e8b7/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b9b74b473b6026badaf980339f4451efd1a9e8b7/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b9b74b473b6026badaf980339f4451efd1a9e8b7/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b9b74b473b6026badaf980339f4451efd1a9e8b7/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b9b74b473b6026badaf980339f4451efd1a9e8b7/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.15.0-canary.7a7992a8.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-baSO/CoBg5Jtaje8x69CIhgiQgAHPZG2e+PijbkI9QCxyK+vfQaYLsPtwZPet8LZR0g+aMBc2sO2g3Hyew5+cA==","shasum":"16e7ebec687af842d05e48fae9747d7551b5f12f","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.15.0-canary.7a7992a8.0.tgz","fileCount":20,"unpackedSize":263689,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeoiFBCRA9TVsSAnZWagAALBIP/iXFfrkxkboxyRNRqTHM\nKZu6W2RbaOZZ6fCMs8pu0OgQiuiI28X6aA2oSXggUyRvyQxYCoR3LQa82LwL\nF/vthk1sqfBVVYxb5rMzBMtAk0OugcnhIyYLI+YSA/NoA5IiDFBopUNdl9ae\nLMv/PRD+jMsG44KYAU+vgqMZJfdJzxDVKCFogJLKrsuac5NMZ2CvrcO0J1oF\n2lFlvwMszycTcxDBD5/efCvWaazJjpaGbfqc3IGKlE5oirqqy+9a0ksrgSZk\nS0chuLOtgPBNdWsPVwe4d47SMsbuA5Oz52ZBr6fx9ENWDZaBK499TgrVKRDA\nmDutgToxSZ+UO4/JEK/nBIhNfjfacsMR01cDOcGwJ0Miu8cntmP3My301iS1\nS89wEeC95tu0Jt7H0vujvaieZqrBApJwYrLYT2D/9jz2jE5p0mDU3ndyToR4\nxiFiy87Bx9Blga7BioP3In+YfmskdwWFvUFm5kBpHAuoBhVVHWeQZXwnoOj6\nzJ+yVL+GmMNcw3fz0hqMhUJFy8kaU75c20lzIR8iqjnDGto9HD4s1sWBw/0G\nzTpEljQsQwVDqo7ZXCdJvnBHu6yHN/Np4hxL/gxecyaNV06WPaV+WfesUhKR\nvzgexZh2Kmyay2YWDxZnGza9549l5nxQquy1CUV3skbEY2hDPpdtxbVhUU7m\n4pRc\r\n=zag/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDHp3yZ1/pubHLQMrFQ8itmynmnKpKQ7DcdBZ29qFU4dQIhAJd0gm9T10WBHXogX9CGtZzsJCBhIkkaUHNVX18DhGRw"}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.15.0-canary.7a7992a8.0_1587683648958_0.07935486519389734"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.15.0-canary.1150d64d.0":{"name":"@material/mwc-textfield","version":"0.15.0-canary.1150d64d.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.8540808be.0","@material/line-ripple":"=7.0.0-canary.8540808be.0","@material/mwc-base":"0.15.0-canary.1150d64d.0","@material/mwc-floating-label":"0.15.0-canary.1150d64d.0","@material/mwc-icon":"0.15.0-canary.1150d64d.0","@material/mwc-line-ripple":"0.15.0-canary.1150d64d.0","@material/mwc-notched-outline":"0.15.0-canary.1150d64d.0","@material/shape":"=7.0.0-canary.8540808be.0","@material/textfield":"=7.0.0-canary.8540808be.0","@material/theme":"=7.0.0-canary.8540808be.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"0b7cb5830938900ecd0b5201ad88746d308b91e8","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0b7cb5830938900ecd0b5201ad88746d308b91e8/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0b7cb5830938900ecd0b5201ad88746d308b91e8/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0b7cb5830938900ecd0b5201ad88746d308b91e8/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0b7cb5830938900ecd0b5201ad88746d308b91e8/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0b7cb5830938900ecd0b5201ad88746d308b91e8/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0b7cb5830938900ecd0b5201ad88746d308b91e8/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0b7cb5830938900ecd0b5201ad88746d308b91e8/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0b7cb5830938900ecd0b5201ad88746d308b91e8/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0b7cb5830938900ecd0b5201ad88746d308b91e8/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0b7cb5830938900ecd0b5201ad88746d308b91e8/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0b7cb5830938900ecd0b5201ad88746d308b91e8/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.15.0-canary.1150d64d.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-P19ZstSj3jzKd+G5cJQUwMtiP/NhkICJqthgFLSCKCnKdEFckC+OOFnRKAB6GzSfwpquK3qfmeR+FnFW/9971A==","shasum":"56322f376fb87af4a2adc33bfa6da1f42797ae26","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.15.0-canary.1150d64d.0.tgz","fileCount":20,"unpackedSize":263689,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeojBdCRA9TVsSAnZWagAA4uUP/iRqsXya6ci+lOmmEzxS\n7PmY8Vh4bIMmMt2AKCyCL6b8gyjiT7GELyDgl8YnKeieM73Ns62YS0TgDMUo\nTCqKjy8HpDBVavtVn1y1RwzoYySJKLAfOKMlQcvmBMJ8zJVC45kaoQbjMCpC\nvIJwZHn2GKSh56RFPf+IrOj9152b9hJRofFE9WIdpjqD5y+u6s0xtOAKc03v\npDLWQEcLz1TAYUXC0tAetDjUkFIT9kQi/Ph/F83tTOM+tRRQux4D5Kluappx\njEdjU1wy6wsdC908kyyJQSQg22d7+d4OG+9ZU3F5PICB6QBTKChJtBbXdyhG\nPISwZujQiIDZDSidXRuK8N/rF+u3fHbxXB1bddPkgCKu5lIcDlpHaOj2Nwr4\neTFM9oWGupAZMH7faC2OfRWuoXsZCbersCES415j4AMGXzut1ZoUJskqQ/7b\nlrfxT4rjSJVu+41cjTuV2ZTxoj+aEBiRvyMw/b2+WNjF+DdsWQY+LWiF5gjB\njouNr/Q7MP9LReYTNA5sqYhy92Cu9lpwrMaaNvJEVu7GFh6F0704LrI1YYF0\nK6iaQ+Urr4lTUZs70qhoOyzaddItnxz/zfDyORdyo8NU/5R38MnyJlCbF2xb\nI+SJF8SrM4w4f9kuD6hAlnAxXpJUXuWgwLTgNIHvxkYdE6bEEoQEEqwOFJU0\n0SOC\r\n=X4B9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB2Jc5PG4FnWIxdpKUVyibKz3sw/8KEHOlucoMhmRLi/AiEAwTw7Pw2mAPeZfysNu2G+hMBYVL0WI+LxMQ5H0efQfqM="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.15.0-canary.1150d64d.0_1587687517534_0.9209397728496145"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.15.0-canary.dad3f828.0":{"name":"@material/mwc-textfield","version":"0.15.0-canary.dad3f828.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.8540808be.0","@material/line-ripple":"=7.0.0-canary.8540808be.0","@material/mwc-base":"0.15.0-canary.dad3f828.0","@material/mwc-floating-label":"0.15.0-canary.dad3f828.0","@material/mwc-icon":"0.15.0-canary.dad3f828.0","@material/mwc-line-ripple":"0.15.0-canary.dad3f828.0","@material/mwc-notched-outline":"0.15.0-canary.dad3f828.0","@material/shape":"=7.0.0-canary.8540808be.0","@material/textfield":"=7.0.0-canary.8540808be.0","@material/theme":"=7.0.0-canary.8540808be.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"ba9b04a7b15588d7423d100bbf29fa317a1947ff","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ba9b04a7b15588d7423d100bbf29fa317a1947ff/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ba9b04a7b15588d7423d100bbf29fa317a1947ff/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ba9b04a7b15588d7423d100bbf29fa317a1947ff/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ba9b04a7b15588d7423d100bbf29fa317a1947ff/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ba9b04a7b15588d7423d100bbf29fa317a1947ff/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ba9b04a7b15588d7423d100bbf29fa317a1947ff/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ba9b04a7b15588d7423d100bbf29fa317a1947ff/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ba9b04a7b15588d7423d100bbf29fa317a1947ff/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ba9b04a7b15588d7423d100bbf29fa317a1947ff/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ba9b04a7b15588d7423d100bbf29fa317a1947ff/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ba9b04a7b15588d7423d100bbf29fa317a1947ff/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.15.0-canary.dad3f828.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-SRcwZrdLYxpeGuxPhHf69LhqwuRiOCOmQt6SzVMjKuc9agZnCzbzZt/cTxdJTyLYLaOAqJo4FUC35uiBcssjoA==","shasum":"d7038f22d242091edf3ff01ba825c22315f1aff1","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.15.0-canary.dad3f828.0.tgz","fileCount":20,"unpackedSize":263689,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeo4eFCRA9TVsSAnZWagAA6dcP/jiMI8hLfs6Eg2dIlV33\npfQIWgevUKw4cnTOZs8guI6H5bTcvV6FyU593ZeSU3L3aTrbpSH5HUvYayW9\nkO1WSOQ1jrN2V3mKxmXd356oi6tgXV9tP2NYiMiW/PD6mHHChpRyrBXmbM5D\n+0JM2WHT4l7WJP9B8S9HVe0z4QwU7gGfMEx0brzaQFlP+4BV7FANX2UAOfmf\ncpL5SJOrLlKCfzdAAjT2R+/0gXN5L9fiGSdM+LDwq7ttV13aedRT8ieMllqT\nSmBZE9gYJMvsTSJwl4CZhVfwYpnEpbLicQYM8DiV1/3ZnjF2806QY4roc8VM\njG47eqP40qS1C93bCl/OyzmvyPV2qBnEqjSwWSlmmGJrv7kozPubE+QAZE0L\ncPe80yJjAvnuYCDyRBPPX6WDASw2X05JnnAyAHLVE5C1h/IJ6yh+jwR6RbbR\nH4YM6Q6lwZxsxuGh2YfdV9vxRr1mjqHDwNj/D7wCh5ufVrPZQgIw2E28Oh/b\nHo/NvQfzlKyZfJJ4HKjvywQLe26MyFulRTyU6RqKLf17Iin1xN2742oKbeK+\nsdFvFPJBq00bKRrR3WyMYUR3F64PnxgFAcTul4H2PncGHebWFoNRI4T7sGQr\nJu1jkYvNN/YKfkYMP6wjSpsFknmnF8qGvix+IX2V2RqyRjEbc3hsFuMmyNDp\nEau/\r\n=hB0o\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDhcmN+veebjFclqQjQiSH66Qg561yqcPds+1jrqt3vaQIgaPlCmFooUHs0hUkPUY6c+Rl+5FKOxwJxJ3RvKe9fF8Y="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.15.0-canary.dad3f828.0_1587775364783_0.6444865092876408"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.15.0-canary.1bcdb47e.0":{"name":"@material/mwc-textfield","version":"0.15.0-canary.1bcdb47e.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.8540808be.0","@material/line-ripple":"=7.0.0-canary.8540808be.0","@material/mwc-base":"0.15.0-canary.1bcdb47e.0","@material/mwc-floating-label":"0.15.0-canary.1bcdb47e.0","@material/mwc-icon":"0.15.0-canary.1bcdb47e.0","@material/mwc-line-ripple":"0.15.0-canary.1bcdb47e.0","@material/mwc-notched-outline":"0.15.0-canary.1bcdb47e.0","@material/shape":"=7.0.0-canary.8540808be.0","@material/textfield":"=7.0.0-canary.8540808be.0","@material/theme":"=7.0.0-canary.8540808be.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"ed51e46ae11b69727c91d55f440b68af397ac10a","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ed51e46ae11b69727c91d55f440b68af397ac10a/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ed51e46ae11b69727c91d55f440b68af397ac10a/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ed51e46ae11b69727c91d55f440b68af397ac10a/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ed51e46ae11b69727c91d55f440b68af397ac10a/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ed51e46ae11b69727c91d55f440b68af397ac10a/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ed51e46ae11b69727c91d55f440b68af397ac10a/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ed51e46ae11b69727c91d55f440b68af397ac10a/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ed51e46ae11b69727c91d55f440b68af397ac10a/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ed51e46ae11b69727c91d55f440b68af397ac10a/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ed51e46ae11b69727c91d55f440b68af397ac10a/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ed51e46ae11b69727c91d55f440b68af397ac10a/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.15.0-canary.1bcdb47e.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-5zsLaJvqah1fQA0Kb8bR2TkTHyAsne5gLsCyZrwd8xfC4L8BEs0wwMMZMdjChJJ9IQrDUuawqZGx0+FX3TogyQ==","shasum":"e02927477612d8ec8b82aad0e75825bee9b6a9e0","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.15.0-canary.1bcdb47e.0.tgz","fileCount":20,"unpackedSize":263689,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJep4MVCRA9TVsSAnZWagAAKb8P/3a4tUoy2Fz1HzKoBsNd\nZ2ztK0DdxRpafeGcxIzSlIGpPKm6Go6U1flOABYnSxGp4CrrfpT14niLnKOf\nXsy3w3uusBAU8x5vfu/PvjPyvDYzsBc6jVX62fHQ+z0JYzykphNfkft3UVeV\nuAQszB1/Qp1sLBbUF5zVrt+IwtY5W7FTBCSWnzjB5nUdMn+/jYF3+MVJxJVW\nP9SiyK8gtIqaXPT45RdbkEJojk88wQEyT0TkKsAqP1qpgL645S1IGMTEBarD\nljlc3sbehQXXrDo4XS+pGZ5oFc9J1IPSoFzI84ouI7hG9VmGp8LllqGqdW+S\nTyaFpIM2PXw9aglbkffpM4tfZ81jeqQd0K6rB/Bxw/QZy5nuFmbURFk2UoYP\nBIP8cSdVJ6/lz83Pq2k25ujTaBKcfBxpdMVgL5x1BG1cdIdVJf6kO6hVVnQo\n8zMnR1RgKpt9mjkvyBMWviZ8SGifVbFPQVtrcoxZK/0ksF/2mGot9uIdhfOK\nP7ReLcbpXkmweFco1WK3rdbUAhnF7ranuXxh0sv5JJFAM7VuVbg5LaIUA6Y8\ngDzbdDXb7EmoGhvbKG8vBGLeSg6QSmXqYfER1q7palS303fxad5nbW2V5R73\nO0puajQltbNcSXYLcWS+LKDPaqsG7XdeMjr6yIGZjEOpfQwF0FZcvAC94GOt\ntJ0q\r\n=Y7OG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD6LdOBzPDPOsjnGLhS1PiDItnoi1UEQX7D/+md7aDBUwIgdS5I5n6z0VnvJ7fIbFbj4qwSPoivpeih7bCATmvwk80="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.15.0-canary.1bcdb47e.0_1588036373211_0.848349474336461"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.15.0-canary.86ff1b9f.0":{"name":"@material/mwc-textfield","version":"0.15.0-canary.86ff1b9f.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.8540808be.0","@material/line-ripple":"=7.0.0-canary.8540808be.0","@material/mwc-base":"0.15.0-canary.86ff1b9f.0","@material/mwc-floating-label":"0.15.0-canary.86ff1b9f.0","@material/mwc-icon":"0.15.0-canary.86ff1b9f.0","@material/mwc-line-ripple":"0.15.0-canary.86ff1b9f.0","@material/mwc-notched-outline":"0.15.0-canary.86ff1b9f.0","@material/shape":"=7.0.0-canary.8540808be.0","@material/textfield":"=7.0.0-canary.8540808be.0","@material/theme":"=7.0.0-canary.8540808be.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"61a98a59545d9e0b0fd96c928737677f2b981fb8","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/61a98a59545d9e0b0fd96c928737677f2b981fb8/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/61a98a59545d9e0b0fd96c928737677f2b981fb8/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/61a98a59545d9e0b0fd96c928737677f2b981fb8/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/61a98a59545d9e0b0fd96c928737677f2b981fb8/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/61a98a59545d9e0b0fd96c928737677f2b981fb8/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/61a98a59545d9e0b0fd96c928737677f2b981fb8/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/61a98a59545d9e0b0fd96c928737677f2b981fb8/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/61a98a59545d9e0b0fd96c928737677f2b981fb8/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/61a98a59545d9e0b0fd96c928737677f2b981fb8/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/61a98a59545d9e0b0fd96c928737677f2b981fb8/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/61a98a59545d9e0b0fd96c928737677f2b981fb8/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.15.0-canary.86ff1b9f.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-grrw2oc+j8tAYveQS470WRmZnmh0aLDR8l6ZHHUvkXyb1YlS/lbZN56JzYbEo4htiXidmJc1IEuUvxgLhHj6OQ==","shasum":"b75a3fc2a3f602dc4466a619101dde808cf513d6","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.15.0-canary.86ff1b9f.0.tgz","fileCount":16,"unpackedSize":251536,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJep5svCRA9TVsSAnZWagAA62gP/0txPypLZ75Hh3xJVPeY\nV0myPSlIRnKIo5sX+uufJtK2icwg6PLgKzGVitQegUmp01iBbNbqqGzduld/\nUfEqOq0XF3K3WRm52cuy7wuvDLAZ1T8gRCV1BW9iPYCaRxZl9Z71cSoWV+qN\nwARvptfA3iBc7caiXotx6LS4dWqnax9gvHRmU6t7/NxKdn0rjyd4zPLPukmJ\n7ihbFMlIlPb0gvn1bqHhp7ZkAEbvw9RnZbsbrIYzWfQxcNOp0YW/hlatMJk0\ngjp0ky1FQ76JHNmTRhZq5bNt36jFNq4JUCJfCodyWbacm96F3mpNWSm/k5MB\nJCXpHM0XEvh6znCN5MWRBnzutqAfyv6GFQazHdUXKmcKvHG5mnucUW4LNV4q\n22gHRMbB1yReUi7eWzZGyp4zgePu9A6FrFPCdjNY3ArBEZ7P8T297HvItd60\nmQ7744DUHovouhGSNVqv/X/HwH5CHDfNXvcxeKZ9B46gi+cMVHwIwlsTHtc7\ncfx2m0+CSHp1g2C902zNkvabpbyUMVCpyhtcXx3YwAeDWOHw9QAUeGsiac3S\n4W3B40MXYi+JAZF6gRZDN34rSzwzUpklL7AttufE5NYcNK3mjInlA9FzIEtA\nPYEH8sFkKemmekKBywWZcAiLPM6h4+i2HwtDXcO3F496q+GxPyUV8BffIDqM\n/HqU\r\n=RHtm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCLFGw/QFqnG+Km7bvnSaL4K3Vw60RiLwOWzPbBirKMtAIhANbW7cEyRwPg0QJapw0l3JDgEFn0vasH5H+vJrAOLnXm"}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.15.0-canary.86ff1b9f.0_1588042543058_0.7296385057034274"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.15.0-canary.54a86b20.0":{"name":"@material/mwc-textfield","version":"0.15.0-canary.54a86b20.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.28d32f8e0.0","@material/line-ripple":"=7.0.0-canary.28d32f8e0.0","@material/mwc-base":"0.15.0-canary.54a86b20.0","@material/mwc-floating-label":"0.15.0-canary.54a86b20.0","@material/mwc-icon":"0.15.0-canary.54a86b20.0","@material/mwc-line-ripple":"0.15.0-canary.54a86b20.0","@material/mwc-notched-outline":"0.15.0-canary.54a86b20.0","@material/shape":"=7.0.0-canary.28d32f8e0.0","@material/textfield":"=7.0.0-canary.28d32f8e0.0","@material/theme":"=7.0.0-canary.28d32f8e0.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"8cfd732e72200c6982fa6d6fbdd6cb5496660a6d","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8cfd732e72200c6982fa6d6fbdd6cb5496660a6d/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8cfd732e72200c6982fa6d6fbdd6cb5496660a6d/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8cfd732e72200c6982fa6d6fbdd6cb5496660a6d/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8cfd732e72200c6982fa6d6fbdd6cb5496660a6d/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8cfd732e72200c6982fa6d6fbdd6cb5496660a6d/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8cfd732e72200c6982fa6d6fbdd6cb5496660a6d/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8cfd732e72200c6982fa6d6fbdd6cb5496660a6d/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8cfd732e72200c6982fa6d6fbdd6cb5496660a6d/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8cfd732e72200c6982fa6d6fbdd6cb5496660a6d/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8cfd732e72200c6982fa6d6fbdd6cb5496660a6d/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8cfd732e72200c6982fa6d6fbdd6cb5496660a6d/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.15.0-canary.54a86b20.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-1UL7seMy0+XXEXbOGDmgf3EdRZSMp+xlA/8kTOnEnoQb3qvrvoe3BvW/ZLwAogmooG02yTGuxkdzKAho5cWrNQ==","shasum":"c73baf4ae2fb7ce53334478e76c52a1d47f87afc","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.15.0-canary.54a86b20.0.tgz","fileCount":16,"unpackedSize":246253,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJep6BoCRA9TVsSAnZWagAATf4P/2d9OvJfVYyZ32k+Pqkc\nmcqINjxDhxFZsfED9/9SkDzxee7ythyDR/oC0YnOqkwNtT4l7nd+n8y+q+3K\nyAVLeVwztCHEBE9Kb+R9adaVWe+ChanEZB67QcKSdfNuLXesRHBr9/pVisMW\ngEIDh9zBDuCGtOyVc1WJq5ELLFl953sPZTAR/FP795n6rwjVnB6gq6BdXRyZ\nZ7/+Y028BS4SsIx9BqzME9eolbwlQ/GmpI9obfMEv2LDNf06Tns7qebvOMpR\nBge0oj3aP35u6KSlpuFzbodLQkVURdRo5KglirmAPwPL5V5OlLN10zWWCyf2\n0nz5F64PhSE/PsTm0i9w08y/lhhfHj19ra6o4hv0ftNFWHZflCiKUDDkyKkk\nyw8lff5U1EeLvV2hrg5ForaQPAPZwXRUsrRq0ByqNfwwhWafO11oZBfUHgD7\n/R0+L9FyTy99NIMb6lZ4Vp1C/NlAbpa5fMTu9pLOv0L+CLL2gBiientwjDNl\nK84VsBn9l3XImoQSATaeMzE3cAunnherrTfEcZpMRjFGcEXobBA3bFiW0GnQ\nueVKF+fIYtNtW9CKqX3HtPFknhoxDWxN8SRD2NnH/jpHEMo0NN2tzdyG4dE2\nIF0KeqZs2oO+ZuBAMXz/xMo4DNSFU7npkq/LfL9LsMM6IB07IyJo5F5zR/9x\n7hjp\r\n=87Q0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDKeDQz0C1ZZdrE59VRrY9/ILBoSB473HC6KtUVLAI0fQIhALSNJsngQ6ehPsED5uIjVaU/kIUR5KqF7eTHsrzExR0X"}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.15.0-canary.54a86b20.0_1588043880336_0.40373948911916524"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.15.0-canary.938fd24b.0":{"name":"@material/mwc-textfield","version":"0.15.0-canary.938fd24b.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.28d32f8e0.0","@material/line-ripple":"=7.0.0-canary.28d32f8e0.0","@material/mwc-base":"0.15.0-canary.938fd24b.0","@material/mwc-floating-label":"0.15.0-canary.938fd24b.0","@material/mwc-icon":"0.15.0-canary.938fd24b.0","@material/mwc-line-ripple":"0.15.0-canary.938fd24b.0","@material/mwc-notched-outline":"0.15.0-canary.938fd24b.0","@material/shape":"=7.0.0-canary.28d32f8e0.0","@material/textfield":"=7.0.0-canary.28d32f8e0.0","@material/theme":"=7.0.0-canary.28d32f8e0.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"1b731aa2e74a3ad03e8d40736e169d0bebc8d8ac","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1b731aa2e74a3ad03e8d40736e169d0bebc8d8ac/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1b731aa2e74a3ad03e8d40736e169d0bebc8d8ac/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1b731aa2e74a3ad03e8d40736e169d0bebc8d8ac/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1b731aa2e74a3ad03e8d40736e169d0bebc8d8ac/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1b731aa2e74a3ad03e8d40736e169d0bebc8d8ac/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1b731aa2e74a3ad03e8d40736e169d0bebc8d8ac/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1b731aa2e74a3ad03e8d40736e169d0bebc8d8ac/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1b731aa2e74a3ad03e8d40736e169d0bebc8d8ac/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1b731aa2e74a3ad03e8d40736e169d0bebc8d8ac/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1b731aa2e74a3ad03e8d40736e169d0bebc8d8ac/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1b731aa2e74a3ad03e8d40736e169d0bebc8d8ac/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.15.0-canary.938fd24b.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-AsAAfSflAwQGu6pVCkcchuGu0Jw2uQRJf5pfCkKR1WcWcqG0Lgs804Qcf9POO9nAQoHDa2/kO5zg2KhrEGSPjg==","shasum":"4aa96789e1fb0393afabfbe6859d9d41e531bd6c","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.15.0-canary.938fd24b.0.tgz","fileCount":16,"unpackedSize":246253,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqilvCRA9TVsSAnZWagAAw9YQAIt+Ahe5PSWfZD9uJlRV\n/xfuS6ID5Waw/vtdikm10bH4ImKbxB/Mtvd0aaPupiCc0cYsK+MTusoyYG0z\n0YV6Ryr5dItw97dIdFGMF6eW/yXaPcrX/hkBKZb5s8buKb1Gm+MnSgX40TDF\nOhyoDqBOgkb6PoTHgKPzajQzsy1IgbN7fKq6uVENfhsjIZLAQOZ0zbjVZCEc\nzNJp7gRjYcZOo3LPT+aoAVLDyXgIY6VeSP2UzfiefGCmozoO1Q5hESePFUkX\neY7h4GknwbubZ+uWqLFyitEj5SprBRnLSleQCOiABSSVjvad7In08vU2Sr4k\nm86A7ee4ryfLv4FfNiC0SEbUurw5qBYaHTMX+23CbqcK7mE6hQJEIeXfTZRN\nHFAoshN5wheeu/UxVC5+4l1wo0hlxWY5p4eGABuePATqgASzB7R4QaNiQbrD\noC4d68kZ8rBEpQtmy60qKe+RySqumKxa7RgQy08IlCOxUrqztcZ8EOduGv7e\nfj5qspKK4/hWTv4uAsz0N0uoLSFEEIXs0lsR4DR8yMCGRV9AJrDt5eBZp06b\nSkWcbPQO/JEionOyWBZ1KV6smGngKBwEjsbc3CMB52jbJP2wNcDDwiDQpaHO\nobCPL0piRLUAv3E0OeWbkhqKGKi7tCQBIPF66D1x1mIrp7h5omCVpQ6jlnhg\nFS83\r\n=g8wF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICtccYEZw7srB7IPJJ4aXANhJBWzsjAEQOlCs4DxYOG8AiEAgG8wSaukAQlFR+qMbEs7iAc+sBAa/xszJYMsrl+SWVQ="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.15.0-canary.938fd24b.0_1588210030947_0.24912198969360588"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.15.0-canary.39e9a008.0":{"name":"@material/mwc-textfield","version":"0.15.0-canary.39e9a008.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.28d32f8e0.0","@material/line-ripple":"=7.0.0-canary.28d32f8e0.0","@material/mwc-base":"0.15.0-canary.39e9a008.0","@material/mwc-floating-label":"0.15.0-canary.39e9a008.0","@material/mwc-icon":"0.15.0-canary.39e9a008.0","@material/mwc-line-ripple":"0.15.0-canary.39e9a008.0","@material/mwc-notched-outline":"0.15.0-canary.39e9a008.0","@material/shape":"=7.0.0-canary.28d32f8e0.0","@material/textfield":"=7.0.0-canary.28d32f8e0.0","@material/theme":"=7.0.0-canary.28d32f8e0.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"2777862aa4cbec00918605f0726651658a2c66a8","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2777862aa4cbec00918605f0726651658a2c66a8/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2777862aa4cbec00918605f0726651658a2c66a8/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2777862aa4cbec00918605f0726651658a2c66a8/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2777862aa4cbec00918605f0726651658a2c66a8/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2777862aa4cbec00918605f0726651658a2c66a8/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2777862aa4cbec00918605f0726651658a2c66a8/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2777862aa4cbec00918605f0726651658a2c66a8/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2777862aa4cbec00918605f0726651658a2c66a8/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2777862aa4cbec00918605f0726651658a2c66a8/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2777862aa4cbec00918605f0726651658a2c66a8/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2777862aa4cbec00918605f0726651658a2c66a8/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.15.0-canary.39e9a008.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-ybl/Ip6sof60/kbF4C0fCpTGgfXeFTxcP+tpn7U44G6qnbjA1iutotOB2d+Qn4t69wt5HAX7Pe5Sp40SagJRHQ==","shasum":"5e3c455f584c0bdd8dcd36b63cc2694dade0645e","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.15.0-canary.39e9a008.0.tgz","fileCount":16,"unpackedSize":246253,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqjRUCRA9TVsSAnZWagAAQnkQAKN/7mLAPJjirzB2H98n\nOT5oLiYgXnbIYSZJcdk7pCEXe1PVhxks5jKl0SW1pFWTGmX/N99NaEpNt723\nyDBnww9Hy0wyLFNeovkrO8dQx1DyP++5gW6mc6UzThM/LrbZ+WZPgxLsYOyc\n2jTW4K90sVOrITkQ+R1Ih8xYaywWkabEtBpcgZ5ZvqNQOnYg0OYGHPjyJgfX\nadZ4b6Ky1Jr3qJfpKMziVdmMTS1AoJjHniJC44RAH+G9ectIDAO9YiImH3RP\nvWmf+gBf4CqipxZUUMx/Mzi+KxaO2bYUJ+a3xH+VYd+5DVIUIZiFS90Gh0JB\nL/r18lpFjkw/FcE5MgPMzQMquGfcotPPl8hNc+DZL1gpQixAXTxrftM4jYCR\nT+k7Tsx/+K9Fmom7cGjCdFgnT7KGz40XnteAqHiSJmG/iEWqgY35rK86J0RB\nlqzPE//8NwmyiuiwARgpCCHmv43EjbAwyMgIl2xIz2NzjmIGwaDQeSzd7aWi\nO0/yClgOYZJcgmwMw5DdTbc7pd9rEtQbIHT/AGDimoW/Ru3srpoS/qHQGJJV\n6ZoyxrD+2A2NQQsyiieMfbuO8joYua+5CoGPbuIX9fAtiFtJq8sldhbKjORO\nbQU+Opc1uIcQ6sfOs3umzErTckrqnWhOIzBSVPi9vDxyh4lHjUFlcBKCme0G\ngt7O\r\n=ZRHr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDjONNU/xpxdmqJ4hgWHxUkxBNfGJnz+2jyFCckvLmZhgIhAPLvgPYiZkjyt9g4G3wmQlhdlTMRBpKCkk8R+KIF+zSl"}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.15.0-canary.39e9a008.0_1588212820594_0.6765971395831458"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.15.0-canary.f3b365de.0":{"name":"@material/mwc-textfield","version":"0.15.0-canary.f3b365de.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.28d32f8e0.0","@material/line-ripple":"=7.0.0-canary.28d32f8e0.0","@material/mwc-base":"0.15.0-canary.f3b365de.0","@material/mwc-floating-label":"0.15.0-canary.f3b365de.0","@material/mwc-icon":"0.15.0-canary.f3b365de.0","@material/mwc-line-ripple":"0.15.0-canary.f3b365de.0","@material/mwc-notched-outline":"0.15.0-canary.f3b365de.0","@material/shape":"=7.0.0-canary.28d32f8e0.0","@material/textfield":"=7.0.0-canary.28d32f8e0.0","@material/theme":"=7.0.0-canary.28d32f8e0.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"b6d6f6d4a289f46197727279f5e776b79264ae07","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b6d6f6d4a289f46197727279f5e776b79264ae07/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b6d6f6d4a289f46197727279f5e776b79264ae07/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b6d6f6d4a289f46197727279f5e776b79264ae07/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b6d6f6d4a289f46197727279f5e776b79264ae07/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b6d6f6d4a289f46197727279f5e776b79264ae07/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b6d6f6d4a289f46197727279f5e776b79264ae07/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b6d6f6d4a289f46197727279f5e776b79264ae07/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b6d6f6d4a289f46197727279f5e776b79264ae07/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b6d6f6d4a289f46197727279f5e776b79264ae07/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b6d6f6d4a289f46197727279f5e776b79264ae07/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b6d6f6d4a289f46197727279f5e776b79264ae07/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.15.0-canary.f3b365de.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-9Ic+z9ZK2BLjBlxorIgCIvKG7SUxVWvC8G0k31DGcT22JRYGCsT/O3AKvULw6KK9HrEIY2oYqimlMgDqp8PSPA==","shasum":"61de825e7c3424844a06f390b8776ad317e13f19","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.15.0-canary.f3b365de.0.tgz","fileCount":16,"unpackedSize":246253,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqovgCRA9TVsSAnZWagAANmMQAJPDmPNNBHc4AV3h0IPm\niJ4048wb1p43dJGgrjOA6iF0jmIHV/Rs/RYoubcYiMTDMFdmGWvIlIHKdILh\nRSyrjO5Ccjjfmm9AMg9YqVXSKZdpfVyKu71N0jkhAqtWGasWX+XSLMwMaf2z\nCVW0vu2/00KKhPgzpm8Tm+Y9g6b9zT/woJZCqk05Ei6ZkdcZ7IAHNWjTzcCI\nmK1khR9kxhund5IADAOcJiBz1hVzX010rHJ+n7GNVV+xbO/FZBahFl/HfR/8\nqV9nQiWgW1vRavIcicFPFFcS55PHpuLsI759/vu0EROgj1UcEbyiEbt6n0RI\nwwpijviS3Pq6oqBC+JDITzKHPITeD4m1HfEQJdt7hDyuW704lheLhwBS0eDr\n029yPK3sTKttVCB0ZYeQQpQ6SIJ5BbBayQf9HG0cQeteKn7ehEOR/DjychVf\nbMdx/nk2g4K9pr4QtdOHdap4XjjTmW8t3N9kaECMAgX/qBzxyIOSWqr78MA2\n/HsR8uz73bQHCbYaKwXwXdQwk4eGgSs4QbXzHfX6uPsok5RdXoNRDLfGVDhF\nd4S6CFM0nXjyo3b6M3Q/1Ru6pSbOpvhWpAcCyHZEKeuqrJO1eF5htbfz3Qow\ndKzXVFmzlnb6yJGlikMX48iqDe7hGEwrorgAu94QSTS8eQfc9i51ubT543kC\nH0zU\r\n=05Yk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBWkyDdkS/BYsP977DWvm0b4j3i2VdS77zREoJo3U1w9AiBOaCzxCE/4idrh78znjOR+X8jYOLPllPSDInnsMmstuA=="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.15.0-canary.f3b365de.0_1588235232029_0.16584402005601429"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.15.0-canary.cdbdf807.0":{"name":"@material/mwc-textfield","version":"0.15.0-canary.cdbdf807.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.b0f83d2fd.0","@material/line-ripple":"=7.0.0-canary.b0f83d2fd.0","@material/mwc-base":"0.15.0-canary.cdbdf807.0","@material/mwc-floating-label":"0.15.0-canary.cdbdf807.0","@material/mwc-icon":"0.15.0-canary.cdbdf807.0","@material/mwc-line-ripple":"0.15.0-canary.cdbdf807.0","@material/mwc-notched-outline":"0.15.0-canary.cdbdf807.0","@material/shape":"=7.0.0-canary.b0f83d2fd.0","@material/textfield":"=7.0.0-canary.b0f83d2fd.0","@material/theme":"=7.0.0-canary.b0f83d2fd.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"c46702178e5c5a1096937d4bd70ad6f4ac4d1dab","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c46702178e5c5a1096937d4bd70ad6f4ac4d1dab/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c46702178e5c5a1096937d4bd70ad6f4ac4d1dab/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c46702178e5c5a1096937d4bd70ad6f4ac4d1dab/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c46702178e5c5a1096937d4bd70ad6f4ac4d1dab/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c46702178e5c5a1096937d4bd70ad6f4ac4d1dab/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c46702178e5c5a1096937d4bd70ad6f4ac4d1dab/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c46702178e5c5a1096937d4bd70ad6f4ac4d1dab/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c46702178e5c5a1096937d4bd70ad6f4ac4d1dab/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c46702178e5c5a1096937d4bd70ad6f4ac4d1dab/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c46702178e5c5a1096937d4bd70ad6f4ac4d1dab/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c46702178e5c5a1096937d4bd70ad6f4ac4d1dab/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.15.0-canary.cdbdf807.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-0G1hFGDj3R17dl/6a0/gXEZts4NV41j63Rrtp1n5gmbiDQMMk3loCAukI13Rqe5hfWnMuQkVJVq3tPJJxYjtfQ==","shasum":"b553ab4a1ce42081c1d34d9ae45402d1b4b3285d","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.15.0-canary.cdbdf807.0.tgz","fileCount":16,"unpackedSize":246253,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeq2nzCRA9TVsSAnZWagAAJ78QAKAtQ03IAfZsHwOETkj+\ng/QYuG4WAqsW1W4GUsVpIqTOYndBzLz6njJHWY1GU88HzWms/Fw2eBEZgi4u\ndfDzSu8lCxyO7NC8zZzP2K8bC3Z9XdnsNIDjMHIBj7kFyI3OK6Z5F3D24IcN\nkZ+hE5mzZuj23WFVedTb/vqLqDG5unF85mfyFz5f5DhjH2pnq8PTnrjrLhF3\naLOUHYS4QAsRmpm/60V9RWoWOxZQL0czZ09UxszFFs2qSo5KYb0Lp4cDD5jh\nXtEk0h467muNbGjeh5zwlhfCHIoQ6VqrxWRpZLppugGsUzQ0f20NA+FkXqiM\nTDGQNwMB3el0hP3Amh9JayGgLWKxPPPWxbjs2VZJueJ16uZ0PJwDj07Xx9ou\n9puJyo+vDhOv2jvseX1A8dVee776QfJ9+GIX30g6cBpam3MPB1jq9zwI5+sw\nGsj6/dlp2u8zSsRfgp2BEMQalJbD+DsAQJN2n7EWvrZIpFwpPjUXARy7aAUb\n6CwIfASeg7n7GA29S/0nvQn0XTZkYhdULt2yVrc7Yix8M+g/Vb+FTApbV77c\nWEN6QEZgl0ivePWQh7N4EGUzlJG63uSmmOGb0WbMJFQf2f0zJgq5mi2+qpF1\nRy034H3FDlLB8N+Kn7d33W+TwVBP6A7nDYlTTYEGmjy02L3lYOclGPoiepcu\n1sit\r\n=stGN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHGbU7tOSI+MvZfhm+nTf0gP/ob9KXhrksEIa8+bsGMdAiEAixWqA6FaH8yAQP8e14I0DgRFHOIi6bxOsqShCauH0c4="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.15.0-canary.cdbdf807.0_1588292083417_0.23336351751320206"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.15.0-canary.9995ae17.0":{"name":"@material/mwc-textfield","version":"0.15.0-canary.9995ae17.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.e59906a57.0","@material/line-ripple":"=7.0.0-canary.e59906a57.0","@material/mwc-base":"0.15.0-canary.9995ae17.0","@material/mwc-floating-label":"0.15.0-canary.9995ae17.0","@material/mwc-icon":"0.15.0-canary.9995ae17.0","@material/mwc-line-ripple":"0.15.0-canary.9995ae17.0","@material/mwc-notched-outline":"0.15.0-canary.9995ae17.0","@material/shape":"=7.0.0-canary.e59906a57.0","@material/textfield":"=7.0.0-canary.e59906a57.0","@material/theme":"=7.0.0-canary.e59906a57.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"4d5bd8b757cc94e00dda1cdb19761b283a15eeea","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4d5bd8b757cc94e00dda1cdb19761b283a15eeea/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4d5bd8b757cc94e00dda1cdb19761b283a15eeea/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4d5bd8b757cc94e00dda1cdb19761b283a15eeea/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4d5bd8b757cc94e00dda1cdb19761b283a15eeea/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4d5bd8b757cc94e00dda1cdb19761b283a15eeea/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4d5bd8b757cc94e00dda1cdb19761b283a15eeea/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4d5bd8b757cc94e00dda1cdb19761b283a15eeea/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4d5bd8b757cc94e00dda1cdb19761b283a15eeea/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4d5bd8b757cc94e00dda1cdb19761b283a15eeea/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4d5bd8b757cc94e00dda1cdb19761b283a15eeea/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4d5bd8b757cc94e00dda1cdb19761b283a15eeea/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.15.0-canary.9995ae17.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-ZPpTl08Lls1N553Jf3F0fN1MhQ2V4wr17v6i8cbBAurEObXznB6LtZTjUeDKFrtCjCBYzUSiH8ShzCSr8B6zZg==","shasum":"74d96cb080cf3830356871194aed818e9ecad9bc","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.15.0-canary.9995ae17.0.tgz","fileCount":16,"unpackedSize":246253,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJerG49CRA9TVsSAnZWagAAu0QQAItSKK6Zlpjcpd2mksqO\nnd76ikT6y+3hW9HdLQ/NAmtRL4cH7a7PiTogGqQZwkknOYJyBYaUJ5mcOejk\nUN/L+zWIO7DZ9MQYJJcxHKFf9dusYGQWehgPyGJOCweQMW5NrcueHA5zDI0x\n2DlbFk/Z1u6Z/e8mwZj7pwPZl0C8MEV4tjx321nffs39D8t1NfBMZbuZSVsx\nEsqYc/Q3Jj9voliEVKOsAWl0KG7SBV/dyGhApdulTOKHLdt/79EJdsxuwnTZ\nzkKUcArJU0jaRg6bc391SNZ1hkxBuUDDWud7wZCIZe0y8BTlIhj8jQDz4Bvv\neQ9tje2c6nKzie0cx+0ML21KtW4MKCklpCacCgQtLSn5cKoXq/uZZ2xvFBoh\njmbqSU4u0iCWRu91IzJUuReZPK/4NsVcdueMo1/zwfJc2nVKfwJLFrDgkdnr\nV71+SO/HK/59BxLMkV1B9xFffR6t/17f9iQ6uNd+oieANwb87W+r8lvopjYT\nLhADbIRRLjBOl3o3Axot7iRQgHiRubH/fX2KQNfP76ydFw5O4A+wCGkg3ePE\nRTqJN0TMM/CNSNFy3zLsJwpqcl0sUN4BJgLwCD4SgOAAyHFxGcSZyUfqa5hR\n7N9Qd+hz/RrBLs4tOtlBUFwLm3/KalLGx5DuxVnAYAjyPf453sLGN5j67Fm6\nkPpH\r\n=f6PC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCdJqIOpv24z8LG5xy2KPkUz+AeIYKdnquugRRzkEimAgIgSssIIFF4lpQCIYiOhnVbOuPYFHhfSiaS1W0S3r4DGe0="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.15.0-canary.9995ae17.0_1588358716889_0.7557364613111763"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.15.0-canary.457bf035.0":{"name":"@material/mwc-textfield","version":"0.15.0-canary.457bf035.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.15d65448e.0","@material/line-ripple":"=7.0.0-canary.15d65448e.0","@material/mwc-base":"0.15.0-canary.457bf035.0","@material/mwc-floating-label":"0.15.0-canary.457bf035.0","@material/mwc-icon":"0.15.0-canary.457bf035.0","@material/mwc-line-ripple":"0.15.0-canary.457bf035.0","@material/mwc-notched-outline":"0.15.0-canary.457bf035.0","@material/shape":"=7.0.0-canary.15d65448e.0","@material/textfield":"=7.0.0-canary.15d65448e.0","@material/theme":"=7.0.0-canary.15d65448e.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"4174fcf7d0ec013419d2f97c6a615216cacd4687","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4174fcf7d0ec013419d2f97c6a615216cacd4687/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4174fcf7d0ec013419d2f97c6a615216cacd4687/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4174fcf7d0ec013419d2f97c6a615216cacd4687/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4174fcf7d0ec013419d2f97c6a615216cacd4687/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4174fcf7d0ec013419d2f97c6a615216cacd4687/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4174fcf7d0ec013419d2f97c6a615216cacd4687/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4174fcf7d0ec013419d2f97c6a615216cacd4687/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4174fcf7d0ec013419d2f97c6a615216cacd4687/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4174fcf7d0ec013419d2f97c6a615216cacd4687/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4174fcf7d0ec013419d2f97c6a615216cacd4687/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4174fcf7d0ec013419d2f97c6a615216cacd4687/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.15.0-canary.457bf035.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-81OzNtiJecMtLIc9mMizTQXGaHKH7Lh9Nlr8HuegiD/bI/hN3jgBW9VlBE1c6joRAopqOagZe2fSEUYaJDSECQ==","shasum":"0fbb44b4fb81a20a568240932e3c5d23cb097c83","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.15.0-canary.457bf035.0.tgz","fileCount":16,"unpackedSize":246253,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJerIuqCRA9TVsSAnZWagAAdfEP/Rs2ETMGGMwKE51dtQf/\neldt+jyNsm+ERtIjlS8hBCeg631XomeN7Ls3GPYSi6XI0tAh6zmKontTLVkn\nmCpnkY63FxtUwUue+3hsFu3NllZ/8B9dRG7raavLDuTEr76wrYfauFUmIJhJ\nsK9V/VDwjsR9smV85sWiFa52isNBwnCDKpBRyolkKYDqziJz/09ozRJw3K9v\nifHf+lOVIdavaJrLWFTfC02UpBuSVLKtIHcT5AybJC1/AsMN2qAJm1mKBjSy\nDGKsvUteUcS1FIDqJ8IeTCfTeNjij4m1SpBijIqV8oQeHbpNI2HuWgM6Qz9r\nrfFA/1LVfONcJJFENLTenqa3u1vgEqv17YSNpeNn5T8ylsUO+X7seBwSAqoq\n8//02gLfIy+tHwNDVt04h0nhNqJHuj7NJRwFr4ySbTEtL2Z+21RMt2H0FgJ5\n4GRrsIsTCs5sDgQXuLlHFkcpE6IwlBcBEjxOsubnm3Pf4l9fLOaIzJ5GNbHv\noIoq0cK5DPlkVFpxAmHvryEz0IiB0iTMKdrJcPFhMQ3aWzM52+lmxV0KT15D\nULMqAFRA+0Ciorhhe/xb4IUkvYlTMvEdIw+Ya9dRMOHNnEtim+ae2TZp725q\nG2+QR2cNcW8E+TWWSz/lteHRYGly0lvdBksr/CERyry02N2MbkmTYqyMzrDL\nD24W\r\n=Eb0+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICMYYFvqHw71bE7LWw80vqRpV42eNIvo/YFg9wwuXTo7AiEAiWB51cjqIXyP0HXZcSPqBQm9DN2Lb6quhfq3vkcyqKY="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.15.0-canary.457bf035.0_1588366249817_0.507729525234736"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.15.0-canary.2381fd02.0":{"name":"@material/mwc-textfield","version":"0.15.0-canary.2381fd02.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.15d65448e.0","@material/line-ripple":"=7.0.0-canary.15d65448e.0","@material/mwc-base":"0.15.0-canary.2381fd02.0","@material/mwc-floating-label":"0.15.0-canary.2381fd02.0","@material/mwc-icon":"0.15.0-canary.2381fd02.0","@material/mwc-line-ripple":"0.15.0-canary.2381fd02.0","@material/mwc-notched-outline":"0.15.0-canary.2381fd02.0","@material/shape":"=7.0.0-canary.15d65448e.0","@material/textfield":"=7.0.0-canary.15d65448e.0","@material/theme":"=7.0.0-canary.15d65448e.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"4e8207837776c4f108fb86133541c49689664446","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4e8207837776c4f108fb86133541c49689664446/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4e8207837776c4f108fb86133541c49689664446/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4e8207837776c4f108fb86133541c49689664446/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4e8207837776c4f108fb86133541c49689664446/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4e8207837776c4f108fb86133541c49689664446/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4e8207837776c4f108fb86133541c49689664446/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4e8207837776c4f108fb86133541c49689664446/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4e8207837776c4f108fb86133541c49689664446/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4e8207837776c4f108fb86133541c49689664446/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4e8207837776c4f108fb86133541c49689664446/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4e8207837776c4f108fb86133541c49689664446/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.15.0-canary.2381fd02.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-hs4aIWYFIRREhykXh+93ZQse9PdcUseHhz1RAqrKNhNB35WcWKoaluEJJITkws6tj6AbRD+m32rEq0xxM3Fbbg==","shasum":"99c3122a6ee56141ffaf7c9a17bc8b476da21e2c","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.15.0-canary.2381fd02.0.tgz","fileCount":16,"unpackedSize":246253,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJerJPJCRA9TVsSAnZWagAAPtAP/0sRV03UdnXsDB0GwEiD\noQcIh48MQ/rqYXWDM6hltsIdkwEA0blh4HXcRjnSEZOlEDuKUO0nYpxhuywv\nFtFsXNJufTFlIlX18f70pEsLAJUH/aEdtNlsAtv8eZkL2zeC99uxyxnor6Xc\nTF6IMgKwFydvdJQgNAbiSJOW61/Dqu9mabumGvmaxgXU7k19hTidjjDWurtZ\nlxiHXe5pRL5B7IRZOipqwQdom5uTLc6UV0HFtsT3EKIoSC50AiRPFA7V+HFQ\nv4p4d4Q5ws8Z98j4zMgeJiq3UkN/soexTq/4Eik0TbXnb4YNPsOjtMWdPxSu\nMavy4+pshsLtSsbMvvBA+cJ804zpoNm/D+4Gi2o1edqT2LKX/dU6fIW+8UGq\nnaNVzrPSYH0cvjDkR0C5Fr5XC2s7SHM46DQ9k22POAarl+T4c6KaB7qSlq11\n1cV5JXlEk00IJY5o998fhLLbRq2HyeAElTqhS0gjsTJLhG/Wul1ReSsM/r9A\np7ibg2JwlnB2nLOq6Q1bv4oBognb1qm5AHpqMz1zHeLRjZnIuKLC/LTPDq9/\nco9w8bWjvPMmj8isETZX4JFNF4K1a1O9a42v6LeD2vuKF7t2Fz4hF6AvaGfi\nkQxBF2K/dUJF0NXf98YTFy0ggy5VTmwXibkyB+zWDOMLueAd6n13VtAtI9Q9\nTW5C\r\n=EB6X\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCYjDXh/jqo+IMdhGaKIg1/t1G6sClmrOn1hOplguWbOwIgbBgpn7V3VV9gbxYzAOlfvNAIlnUT57QkIAF8gVlHRmc="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.15.0-canary.2381fd02.0_1588368328923_0.762040486606286"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.15.0-canary.b2ca9b57.0":{"name":"@material/mwc-textfield","version":"0.15.0-canary.b2ca9b57.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.15d65448e.0","@material/line-ripple":"=7.0.0-canary.15d65448e.0","@material/mwc-base":"0.15.0-canary.b2ca9b57.0","@material/mwc-floating-label":"0.15.0-canary.b2ca9b57.0","@material/mwc-icon":"0.15.0-canary.b2ca9b57.0","@material/mwc-line-ripple":"0.15.0-canary.b2ca9b57.0","@material/mwc-notched-outline":"0.15.0-canary.b2ca9b57.0","@material/shape":"=7.0.0-canary.15d65448e.0","@material/textfield":"=7.0.0-canary.15d65448e.0","@material/theme":"=7.0.0-canary.15d65448e.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"98f8c3a13f6577a5e1ccca480ffe483c91183a7c","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/98f8c3a13f6577a5e1ccca480ffe483c91183a7c/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/98f8c3a13f6577a5e1ccca480ffe483c91183a7c/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/98f8c3a13f6577a5e1ccca480ffe483c91183a7c/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/98f8c3a13f6577a5e1ccca480ffe483c91183a7c/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/98f8c3a13f6577a5e1ccca480ffe483c91183a7c/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/98f8c3a13f6577a5e1ccca480ffe483c91183a7c/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/98f8c3a13f6577a5e1ccca480ffe483c91183a7c/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/98f8c3a13f6577a5e1ccca480ffe483c91183a7c/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/98f8c3a13f6577a5e1ccca480ffe483c91183a7c/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/98f8c3a13f6577a5e1ccca480ffe483c91183a7c/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/98f8c3a13f6577a5e1ccca480ffe483c91183a7c/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.15.0-canary.b2ca9b57.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-ahjRpZxnXPGUetppL5asQzE8lgeccm/QnaLBdmg/4Y+gi9urLqsRejwasCRop+llqOs2VZ3cXq1GqSLoTaASJQ==","shasum":"3f1c1478216f8e2432547d495f2987f9dd0e9120","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.15.0-canary.b2ca9b57.0.tgz","fileCount":16,"unpackedSize":246253,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJerJZUCRA9TVsSAnZWagAAMZEP/0qBC+Dub5lda9+vzDzj\n2mRpLRGWuz3Li/J5Pf46NC7QPoayfcWBw3Z6NAqrUWZ1OTb97gR+Q7mOA+j7\n9SI/ec38CEmtskWuHAsj9G0XBSAe8pzONvXEqpORfondkOG1pE0kFwQGkNau\nEIgWnrMP2TtG/L6UUOSZiyC932cjfFyGSRUi5pAu8V1dQBcFqF7KFHCdBsKw\nW70RjeDFlPgBMlqi69TLG5wF5pIOFU5oD3iK6bDc7txrwQ2jklJUplv1NzTU\nT2n/nJPB2Mirdvr2aaMthUIMRn2C4UIeNgrsyLAxIMEucm92ANx858MyWueF\nNe0/Jl5OTonctajTqnWLc6IoJD2RAOnyP1yuwByel6Qh9A/Vby+oNSo8E6cR\nmjCD56C/b33YvNDYTVEsrPKEgXPtzhUGKWEBsIXXKaGo9xzb2rf0IvSMfBT5\nlb6ICGJwWwMm5k284PxEwnYXMFHg1/bk/GPwb49yNs/qsPnjhg1obVYAoVqw\nZI0YWAnYlqski1p3UsxoebtnaqfzYlJ1JsS/pCDLR7lHhbFytry45oJk5Au8\n+x5fOL+G57ViGTzsNqPfPrCrpAWXH6jkzuEMziubvbUlybE56bwdGXL7JBJR\ntOVhFgas+tgsRt+i4TRXXCajXCivV84u0xRnScSX4H0La2TEgZRqp6JijCC5\nd1tF\r\n=zeoO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBaL9PyS7aqIoZPRgDVgK/bSqvMwFhoH1z5jYQe8sV+dAiEA4cDhVeOdNlT6b7tmsdRAVcaf+Ut8tp3+8D0vWnLoNL0="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.15.0-canary.b2ca9b57.0_1588368980417_0.41499272833511514"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.15.0-canary.b2b088e7.0":{"name":"@material/mwc-textfield","version":"0.15.0-canary.b2b088e7.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.15d65448e.0","@material/line-ripple":"=7.0.0-canary.15d65448e.0","@material/mwc-base":"0.15.0-canary.b2b088e7.0","@material/mwc-floating-label":"0.15.0-canary.b2b088e7.0","@material/mwc-icon":"0.15.0-canary.b2b088e7.0","@material/mwc-line-ripple":"0.15.0-canary.b2b088e7.0","@material/mwc-notched-outline":"0.15.0-canary.b2b088e7.0","@material/shape":"=7.0.0-canary.15d65448e.0","@material/textfield":"=7.0.0-canary.15d65448e.0","@material/theme":"=7.0.0-canary.15d65448e.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"c524f04088895074106127ef3584a2aeac09b189","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c524f04088895074106127ef3584a2aeac09b189/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c524f04088895074106127ef3584a2aeac09b189/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c524f04088895074106127ef3584a2aeac09b189/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c524f04088895074106127ef3584a2aeac09b189/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c524f04088895074106127ef3584a2aeac09b189/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c524f04088895074106127ef3584a2aeac09b189/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c524f04088895074106127ef3584a2aeac09b189/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c524f04088895074106127ef3584a2aeac09b189/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c524f04088895074106127ef3584a2aeac09b189/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c524f04088895074106127ef3584a2aeac09b189/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c524f04088895074106127ef3584a2aeac09b189/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.15.0-canary.b2b088e7.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-qPoR0AJAoAASH1/5KLDI8/N8rJIo0oEMm3PglgDLuqk/gXJBVMyNr52LSO5rOw8mW8EJivr6ut1OJinwmlWZqQ==","shasum":"c039cde29fe42b550925291351350d70e48d6962","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.15.0-canary.b2b088e7.0.tgz","fileCount":16,"unpackedSize":246253,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJerKPBCRA9TVsSAnZWagAAurMP/0rZTk4ZLVHdvgo78jlG\nwStYZ+KIFLxcBEOUDaB6rqo2DNz52VgNeYU7MxXidIIAMlTyfAijgB2M/Lqb\nYUxwGMUXTB2M+jusQjMmRygtIEYw8vR+OBgX9NApgr7GSOUMfF4gkM7+vBaU\nEak97ohCRBdKWTlYfgllgQreelXiyxhktuW+Rtj4NxbP4vXw5mZauHTzlHyc\nrfeGl20m0gmXkOY6SSihk78n3PVCfN2VJA6Wd9E9TI59zwfHBeBglt0ETcvv\nQoFfia/K8M2qED/SULMQsA8tSYqcRcO/3fmPCsx9V8WW5J+OcQGCYQzq36XT\nYWoQx0c1QzXJGA0l3gZe6enYJFcAeUMDqM1UbV/1AfuPWumphbkZJ/rF/qJg\nJipOkQblDzfcJnG9Qvl0+3DNBc5Z9LQCY6ZbBLyXb7Gg9vr5Y4nNFWDe5YOJ\njCta8Y5E13HjEZWR+VOO7384LnEC68j5sNd0xq5SzIxZPlkDrrjk/bTb9F0V\nPwT+BZtEnqBFUk/fZp+5aNJqyzCLEzFHuFsbbGY86Ow/DsyGlKQe4j6S1IwU\nw2+WKie4PFiM5xveptGjhqKO5FozsG6PKp8Lv2ZogEd31Yo4AQcBTyAJSj/z\n1HkzdHwyScS7FyxzZ/YKbnqYJnfEyoLcfTLUvW7I0z5sZLA6ts5uMWPivd7b\nvxX6\r\n=VD9j\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCXQiqel3TlQNSAapzY6JjxH4CJUiI6OPiDRfkCWhI6bQIhALEFfJlwVuLNro867ebt+f8laCwk+yfcHx+wt+vuL13R"}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.15.0-canary.b2b088e7.0_1588372416654_0.549068858246818"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.15.0-canary.fdd8f69e.0":{"name":"@material/mwc-textfield","version":"0.15.0-canary.fdd8f69e.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.142b1549e.0","@material/line-ripple":"=7.0.0-canary.142b1549e.0","@material/mwc-base":"0.15.0-canary.fdd8f69e.0","@material/mwc-floating-label":"0.15.0-canary.fdd8f69e.0","@material/mwc-icon":"0.15.0-canary.fdd8f69e.0","@material/mwc-line-ripple":"0.15.0-canary.fdd8f69e.0","@material/mwc-notched-outline":"0.15.0-canary.fdd8f69e.0","@material/shape":"=7.0.0-canary.142b1549e.0","@material/textfield":"=7.0.0-canary.142b1549e.0","@material/theme":"=7.0.0-canary.142b1549e.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"3888dcd836699affb59b98e4306c2ac03971ac4c","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3888dcd836699affb59b98e4306c2ac03971ac4c/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3888dcd836699affb59b98e4306c2ac03971ac4c/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3888dcd836699affb59b98e4306c2ac03971ac4c/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3888dcd836699affb59b98e4306c2ac03971ac4c/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3888dcd836699affb59b98e4306c2ac03971ac4c/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3888dcd836699affb59b98e4306c2ac03971ac4c/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3888dcd836699affb59b98e4306c2ac03971ac4c/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3888dcd836699affb59b98e4306c2ac03971ac4c/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3888dcd836699affb59b98e4306c2ac03971ac4c/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3888dcd836699affb59b98e4306c2ac03971ac4c/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3888dcd836699affb59b98e4306c2ac03971ac4c/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.15.0-canary.fdd8f69e.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-UAf0/vUgGW72cb39ikyJdjpHMn4vfpzpiuyreI8Ee2ezCAXTBbrnSNQYpAqNRRoG8/BroQB3QL14k5GBi/mBXA==","shasum":"63d126e5e6d766e72c762769067e21f61203e05e","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.15.0-canary.fdd8f69e.0.tgz","fileCount":16,"unpackedSize":246253,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJerLvdCRA9TVsSAnZWagAAw6MP/2wsHjCWYMH72scNU2Fk\nIsqEVmyqZLaXZjwGRTO1RrJcobwkzsa7ltyElhc8AKzE1ZIPff9IWhfGsDGb\n56VmTmp9X2HD1c+5zsaWRlOtGWkewY03A5/rSVNksBLQLM18FYlM9IKDBE1g\nNexXY8PV7loyUy7sgwqc0cvirLhc0jscS2a6hWmJkoklARRTDbKKPmL0Se2V\nAxYxv/P6d1WkI/96bKuXreUqzjC/ZRO7D++jHGYaFqfrnSK2nHLQ14TSd/YJ\noQ+5ri/qiZMxJcixCCveC+4dyBTeTiWAZ61YT7AYcXK43anUnPmapmIhfQbd\n4wz2tkOUB+adodVBOCsD8bqXzrd3Cch0u+nnFCiBOEQFSGUArccN4GOXpSPw\nT1Q6h20ycWpUOZPpzv4zV8nkjJBWdo4P1k8yr3kVG/52SagTpyYrgd+Np12e\nVc8BNXgrloeP70yVqJdi2ihE956GWt3ARdRHsXpKygKY2yQefjIrVNBblhQd\nlp81gLfzLW/Ghy9SatUmvrVXnN4Rua4kDFxmf/3VndCgVFeugUQ7aKUthrBt\nMrSK+CRlT6JasvrUBRzmtXQGRhLTyQc/tBULAqMeHzbGZn33VF2o1geR1Zt6\nnR5MXsZLtc1RBLnAkqIA8V8oe9/JOjWLG3b+rNsW2oKx+RLfyrDjcBQaM0Vu\nA31i\r\n=d5zQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD84XFAFR0WHqyrLmVZTfhKdhXfb4T3cQ7ImOD7MEegBQIhAMjJGpW9Z0innv807psn7G+/WwDUcCmJSeGx+q1+8Uns"}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.15.0-canary.fdd8f69e.0_1588378589502_0.13587225798270297"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.15.0-canary.730f45a8.0":{"name":"@material/mwc-textfield","version":"0.15.0-canary.730f45a8.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.142b1549e.0","@material/line-ripple":"=7.0.0-canary.142b1549e.0","@material/mwc-base":"0.15.0-canary.730f45a8.0","@material/mwc-floating-label":"0.15.0-canary.730f45a8.0","@material/mwc-icon":"0.15.0-canary.730f45a8.0","@material/mwc-line-ripple":"0.15.0-canary.730f45a8.0","@material/mwc-notched-outline":"0.15.0-canary.730f45a8.0","@material/shape":"=7.0.0-canary.142b1549e.0","@material/textfield":"=7.0.0-canary.142b1549e.0","@material/theme":"=7.0.0-canary.142b1549e.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"e4604a16ebeca9fd76a4f742d3f936e83aaad680","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e4604a16ebeca9fd76a4f742d3f936e83aaad680/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e4604a16ebeca9fd76a4f742d3f936e83aaad680/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e4604a16ebeca9fd76a4f742d3f936e83aaad680/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e4604a16ebeca9fd76a4f742d3f936e83aaad680/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e4604a16ebeca9fd76a4f742d3f936e83aaad680/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e4604a16ebeca9fd76a4f742d3f936e83aaad680/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e4604a16ebeca9fd76a4f742d3f936e83aaad680/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e4604a16ebeca9fd76a4f742d3f936e83aaad680/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e4604a16ebeca9fd76a4f742d3f936e83aaad680/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e4604a16ebeca9fd76a4f742d3f936e83aaad680/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e4604a16ebeca9fd76a4f742d3f936e83aaad680/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.15.0-canary.730f45a8.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-c/Yc6+3lLjey9pQx5a16i35kngw92kcDP7EW6GC+OyUOQonaXA2sWsaurvx+MDgoTX/ebAigItCeK3toQdFdjg==","shasum":"9d5e3ab02acea68ac0f48baa5cf1ab87dea4d309","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.15.0-canary.730f45a8.0.tgz","fileCount":16,"unpackedSize":246253,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJery1DCRA9TVsSAnZWagAAkncP/3h2+WKEgNZvF/+jJ/QY\nKMYuTqPi3GaQg98jVp9+4NhuySQkxQeJnrl/TwnO+BhZyAi2+u3v9TAAJR0F\nP7gCOWd3WGdwP4uvu+piDdhtE1XYy8LSr6Ohs/Z+mFN2tHnXG1vXz8eGtGlB\nrg/1yS78TSbpex80OuB0JvrAKthp8OK9C6bgJ2qs50za6WBv4wNmO+xj0bIU\nwFCV2+XJY9K/sBfxis+PBeDsfPHoYLSIz3osQLitiiq7PY7JAR9cw5H52q7G\ntVP68cc+9nrv+yYPzhDkaguT3m8aQIMRrQh11dVb2eZ+LZ2WTsQL/DW9c+sp\no4d1zmAd2GxUIZnO3kZyTB92YXATzy4Vjt7dJcxUb1GouQG0FpnR9GHPqdX2\nmBQHTyFuzn/BaYf9QJ8x2WUW4FS1uRrT6jiUU2HctgN4W+zxbxi8zVnkLqfL\nk9Jfe4MwROqb9/ff7Sf3h3jAX50/HKbcqVo2EBwdp/Tx2XWmBSjJgMEe4oTh\n43kuDGLjlfmsy1mCZd07avf5uuWlHPO1e2CkUu4BK04XpJ8MaTqo6lEhrPy5\nkkmlul2exseyCyokepb5tOiwTrnWtbSow6Ajxxu4ErZJm3C0tJmSMkvivwNx\nMZeBGNv0ZgNSVW0mLxUorwmxWhR9hdWLKEeMs+PONR33tKeM7ZZ3INpXEUWN\nN+VP\r\n=hUUl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCQ11TITcnoMIYNi38HOCYa7Jy7ge7ZfKSK2M0HgL2BowIhAOqon/8sJ555unmrGolQo8NhBvmon7WohxzUiMoNX2PG"}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.15.0-canary.730f45a8.0_1588538690778_0.6817766328768464"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.15.0-canary.4219bd20.0":{"name":"@material/mwc-textfield","version":"0.15.0-canary.4219bd20.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.142b1549e.0","@material/line-ripple":"=7.0.0-canary.142b1549e.0","@material/mwc-base":"0.15.0-canary.4219bd20.0","@material/mwc-floating-label":"0.15.0-canary.4219bd20.0","@material/mwc-icon":"0.15.0-canary.4219bd20.0","@material/mwc-line-ripple":"0.15.0-canary.4219bd20.0","@material/mwc-notched-outline":"0.15.0-canary.4219bd20.0","@material/shape":"=7.0.0-canary.142b1549e.0","@material/textfield":"=7.0.0-canary.142b1549e.0","@material/theme":"=7.0.0-canary.142b1549e.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"b0ea0642a3b7fcfd78e46e68022be39ccf7b5e68","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b0ea0642a3b7fcfd78e46e68022be39ccf7b5e68/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b0ea0642a3b7fcfd78e46e68022be39ccf7b5e68/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b0ea0642a3b7fcfd78e46e68022be39ccf7b5e68/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b0ea0642a3b7fcfd78e46e68022be39ccf7b5e68/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b0ea0642a3b7fcfd78e46e68022be39ccf7b5e68/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b0ea0642a3b7fcfd78e46e68022be39ccf7b5e68/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b0ea0642a3b7fcfd78e46e68022be39ccf7b5e68/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b0ea0642a3b7fcfd78e46e68022be39ccf7b5e68/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b0ea0642a3b7fcfd78e46e68022be39ccf7b5e68/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b0ea0642a3b7fcfd78e46e68022be39ccf7b5e68/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b0ea0642a3b7fcfd78e46e68022be39ccf7b5e68/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.15.0-canary.4219bd20.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-pCFtPaWk9cOnlOlK6LkqBWbkM7esWw2wQxJ02LjAPtGnftSP/l1E+pNGDmvI57VJJpoadDONm6zb+e+hTvKhZw==","shasum":"41f971fc6d15c0cc76c3195505d02b4946de5039","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.15.0-canary.4219bd20.0.tgz","fileCount":16,"unpackedSize":246253,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesKXuCRA9TVsSAnZWagAABj4P/1oUtADsvSgU7bfvOAsO\n0qaER0qNmkac5NhgYlUPe6wfd9ywvdAKlBvF2wZHNEG9HMlMfpUoxyRLYRqJ\nYqZltmjLy658kR/hnyo/CB53HXzE/ZGU6UfK7R58tEokmVCwbda8h+/DWXR9\nUmU8dYAUtzm/zUdydxW/5U9usEQXLKTSt+C/8dUvPOheBs7NcmBaoLLEvEX6\n914eZA2R3MSbHNusJb12eMudFMD8tJpCYf5swB/23GPaYIwkaxn28CQhda5O\nPPKYoEsvxStcpCj/hZBvoq6dqTm9f8AV9oHTz8ooPcDezTAzU89+7fxgUbVa\nGNLbba9SEXaVcltOKsjrRLViAQJcS0K65DMETZLp234UVxzxbSMU8EwVZW4Z\nPlOJjsTpdcqv5PkgpXT06lTTMxJHqs+LZmGl3jaXZZw4jiv35wbWIRsf4ws9\n+axyIDa6p5w5dOvnYyXGbojYG9M5MiOCTUznWbge8g5Jq7fWbzPjEOdBYn3d\nqYhkaaAy0jR6O2V4pQneBP4DSAsM8Jaoss/db0JzcubVZ1wRn1pTR2JIgNFZ\nIwCatHLDlOfvNIXF1/f8oYUbP4Opfw8y1v9RnO8+Ky0D405sKKXnXof9sGqF\nq58lB1NRfioqVS3xjuWk5H+AFJn8PiEA3AvzS9FqLxK5AHtka4c1j9raH7nk\nQIHk\r\n=5O4t\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBfQSPdM1v7umicCu/rjiDKvKGRBKiTzQst1GmOOjaKmAiAZcIWq0RY2Wa0KkJ5DkcESlnac6wl1q7iXpLcxiibrLQ=="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.15.0-canary.4219bd20.0_1588635118362_0.5937398911822767"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.15.0-canary.1d83cf6d.0":{"name":"@material/mwc-textfield","version":"0.15.0-canary.1d83cf6d.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.03dec929e.0","@material/line-ripple":"=7.0.0-canary.03dec929e.0","@material/mwc-base":"0.15.0-canary.1d83cf6d.0","@material/mwc-floating-label":"0.15.0-canary.1d83cf6d.0","@material/mwc-icon":"0.15.0-canary.1d83cf6d.0","@material/mwc-line-ripple":"0.15.0-canary.1d83cf6d.0","@material/mwc-notched-outline":"0.15.0-canary.1d83cf6d.0","@material/shape":"=7.0.0-canary.03dec929e.0","@material/textfield":"=7.0.0-canary.03dec929e.0","@material/theme":"=7.0.0-canary.03dec929e.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"72586b3b03638e183dfd5440f006b405468a37d1","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/72586b3b03638e183dfd5440f006b405468a37d1/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/72586b3b03638e183dfd5440f006b405468a37d1/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/72586b3b03638e183dfd5440f006b405468a37d1/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/72586b3b03638e183dfd5440f006b405468a37d1/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/72586b3b03638e183dfd5440f006b405468a37d1/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/72586b3b03638e183dfd5440f006b405468a37d1/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/72586b3b03638e183dfd5440f006b405468a37d1/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/72586b3b03638e183dfd5440f006b405468a37d1/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/72586b3b03638e183dfd5440f006b405468a37d1/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/72586b3b03638e183dfd5440f006b405468a37d1/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/72586b3b03638e183dfd5440f006b405468a37d1/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.15.0-canary.1d83cf6d.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-X3hpSzyysaYqj4Ibw8Xgl6b503YjSJu3u+QaZxNenNgUM3Lsr7Vo+Vet8N0V16Gp9Emj8XFdeYq4ODmg0rVdpQ==","shasum":"f065500119b6d969121359c9a5b4a07cade477da","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.15.0-canary.1d83cf6d.0.tgz","fileCount":16,"unpackedSize":247023,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesZ5lCRA9TVsSAnZWagAAOUwP/3FPe1ZlGn4kG9ULloMM\nLdn1Rk1WQ6gHxbo4P9Ok+NvBC1irhtjpa0BC4WLiF7p2xlQTXHBdvL1vDdjZ\nxszRLU8yxVgeow0/A0U/rQLYv4tlvOSc+WVYP1rokm7FCLBiwrfX5yr4ZTdD\nj25KxN+DIOQrZXVaU7RnkDfoZwkhDDsQKMFHVSzadnGHxIeFn1M62pOs6U7t\n3Xrt1pnXCZUp0IxWVipoN4TpX4pneSosI3lc2iVtNCDrtQV4vuOvZ4SFBEKw\nnAC1lu8KCpEopfQufUwaIpOkePC1la7x4vHFaEh/iS/a3Eq8vY1n3kIIj9GF\n3yZJVm3crpAX2OSRAj+9biKXjxmdTTvgLcJFypOt6LU7uXLDBVWKLjfezkY2\npDh9QSi9Vz559jd5TP75S396nWGqaYRTUYCTJeiA+qYY44vGzUonkOEYtmwg\nLM7KXN4XkWm4PegRdwOAIpWCGzzB0NbMJAihZigD93w/ta2OPVBDXKYl+FxE\nlSOOtmkTzuq0w8juw5Jmh1VJ9z4oMPoAXhQqBCo53ZY2aOTYRiwOPL1g+Oo8\nMNXGZ9/WXEn873cCvJFlrWD9sE/+xFVsnnPei2/xHkBeb5E0KGVhoTPWumYX\nmCGxwBVSYQ15SZknJ1mtYCC0n9l0wfZ1bVIf9dHQq1kuPkBjfQemHX66F8ma\nsw2I\r\n=148H\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCoqt2QQ7EWooY6OtFPcB57wBPcYhd05F0116FfWSRtFwIhAMPOpFBi2oVcJoF0toJHvvOsoF/3vsYppb0wa/9cXa3W"}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.15.0-canary.1d83cf6d.0_1588698725122_0.44921425448385954"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.15.0-canary.3bfc63aa.0":{"name":"@material/mwc-textfield","version":"0.15.0-canary.3bfc63aa.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.d92d8c93e.0","@material/line-ripple":"=7.0.0-canary.d92d8c93e.0","@material/mwc-base":"0.15.0-canary.3bfc63aa.0","@material/mwc-floating-label":"0.15.0-canary.3bfc63aa.0","@material/mwc-icon":"0.15.0-canary.3bfc63aa.0","@material/mwc-line-ripple":"0.15.0-canary.3bfc63aa.0","@material/mwc-notched-outline":"0.15.0-canary.3bfc63aa.0","@material/shape":"=7.0.0-canary.d92d8c93e.0","@material/textfield":"=7.0.0-canary.d92d8c93e.0","@material/theme":"=7.0.0-canary.d92d8c93e.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"00c84910ddd746dddbb2d651a4fe51c784dc78b1","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/00c84910ddd746dddbb2d651a4fe51c784dc78b1/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/00c84910ddd746dddbb2d651a4fe51c784dc78b1/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/00c84910ddd746dddbb2d651a4fe51c784dc78b1/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/00c84910ddd746dddbb2d651a4fe51c784dc78b1/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/00c84910ddd746dddbb2d651a4fe51c784dc78b1/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/00c84910ddd746dddbb2d651a4fe51c784dc78b1/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/00c84910ddd746dddbb2d651a4fe51c784dc78b1/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/00c84910ddd746dddbb2d651a4fe51c784dc78b1/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/00c84910ddd746dddbb2d651a4fe51c784dc78b1/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/00c84910ddd746dddbb2d651a4fe51c784dc78b1/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/00c84910ddd746dddbb2d651a4fe51c784dc78b1/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.15.0-canary.3bfc63aa.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-BJWE+H2mdBGd+T+I4pJN0zsN09mJCOoIHHTtZvzf3aXNg3aecM3SWmDJ2n0FCxIywIzvhJjqTs2BkWgmA2dRlg==","shasum":"5e1c255b87b7c6a9c437cf3b30ccdfdbb73f058e","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.15.0-canary.3bfc63aa.0.tgz","fileCount":16,"unpackedSize":247023,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesazYCRA9TVsSAnZWagAAoCIQAKF5mRJkZsENCicdzfSv\njijlKOZFbBn8rFBQdtC7jVjL00h0G+SYtMUFxnfZbiM2Zb74ZabPPmoTn8XO\nupONwKAOJXyKBkG28L+mBwQ/lYLjVe/wKb9wem3y7di1pSRyxAZHIoLfna2u\nYwviayqQqf8zOq+337vWgX/9hLsYk3+dihSCgcUbP4vFWhfOVI3WZKkmqXxI\nzH7htXBhF+whwCbLncfzPqNN2sPOP32/b1Cw0Zz5fRfbBX10YFXVuDjvJuwY\nzO/8h/9VH2A3/pobnGFOLagUkbstEKcX1p1S3SVq3iqzBnjSCOmcUGqI7LOb\nSHO5Y7STSc/hECa/q8LPMKXv/UTDaSbp0j5OZZK0L+uxre8rrqiZy3onQSTX\nEwXsIIRFnpSpaAm7IBsZjOtL9Qr0UAQ0x2LViwt3H0ZG04SPfTePGDjWf+7Q\nOG+m8aHdrsG8BqbYOmGW2jWn3iej1swpqo5N4LD9clzq4Qi3Dwn4fAt+uPfn\nr5lSv3Sl3SjWjOJfiaX/zuiRoyLpNheEMwGde6b3bqR0Z+3m01w/8i2d9/Td\nv0puDmqNGuWUUtZW8X0s1tm0Jj8XS0zGRl8/8AgmSi/RS7j7xaHfc2TvZPyR\nPv/1xszGeVVPItLjfdaTB0BI5cNOPGnLtpf5AOB0y4r6PQcB95AXTieVserc\nCSFV\r\n=Etb/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCOyV3HenMulk8P6NUrbpvFe4kARHsZyVNi6BR++oUOVAIgLuCdXKerKU4wH9NK80RzHo7Tf6L6rGTU3JKGbWsYqX8="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.15.0-canary.3bfc63aa.0_1588702423922_0.4115904411630604"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.15.0":{"name":"@material/mwc-textfield","version":"0.15.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.d92d8c93e.0","@material/line-ripple":"=7.0.0-canary.d92d8c93e.0","@material/mwc-base":"^0.15.0","@material/mwc-floating-label":"^0.15.0","@material/mwc-icon":"^0.15.0","@material/mwc-line-ripple":"^0.15.0","@material/mwc-notched-outline":"^0.15.0","@material/shape":"=7.0.0-canary.d92d8c93e.0","@material/textfield":"=7.0.0-canary.d92d8c93e.0","@material/theme":"=7.0.0-canary.d92d8c93e.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"749d0b52cf7911d260027fba833a8a291177ad32","_id":"@material/mwc-textfield@0.15.0","_nodeVersion":"10.17.0","_npmVersion":"lerna/3.20.2/node@v10.17.0+x64 (darwin)","dist":{"integrity":"sha512-g3ncA1LQSPIVykllm/57Pyvuz1gUZj/BAKi8ia5T0wZWdvU96x4jCLK/2bUB9WDt2QWaQNap+1GI1MJ/mFekvA==","shasum":"9fa77419eb843bf249d065886bc9774b81ecce65","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.15.0.tgz","fileCount":19,"unpackedSize":250953,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesepcCRA9TVsSAnZWagAAZr4P/RRYX1bFwrzi9BIa1mx2\nScJwlNLbAmgy1HefSRhFuzDkbUnlcAqtKsc3huo7ezmoRLGIqOTJshGRXJND\nkG57QkwA7TZrRxdgYJn0dbOQuNeSaBj0TkGGfDj7tVKL4c49SLjGVoGkC0bG\nh2SY/Qp6eMmNHwhQsmOjd8+z9Kus2W53p5eOQqdDYnsli3Vz7WY3PCLLAynI\n7tzFQmEEPn7yRaxpQqW9jgD4bBNq/LEpu0EpJjI83rSECWFiKF196VN5UPo+\nACCdtk9HEqwBhy6FC6fJDFOKZlu7nbEIV6uUx03FF33sZIMhCX9mLEb06PTG\nvRcSYB34WzNRZi0Lw/aHmG37zNV4ThUFH036TuXJeJ+Spou0Qfuetzj95j+o\n8nD/RwHYHYwJOOTy26S4aZ5092GktDMFeJvgS7JNuB+IY5Asgu7iqEhlYhOp\nbaBhlb0R/a0qn7m4/wKe9PArS02CsyY8SoNztQ51Qp4TBVW7mrRgdQg+EsF6\nUUCPTC39Fynz+mNTmiifBQN2j3VZKzbreipEuD3iUYnwOJMKUreA0tkKe7NE\nkWzFIRKrJaHeWzmi+3lc/Q7G0q6XUdmuQ/ni7FAzdWOC/qd0EqkE5L2vvSC8\nzGbw0Gv4H3jXi6pdiIxbEgvEWGyVo8UxjOjmYNS5pLc1rnOoc3B/pNSYb7YO\nCkU0\r\n=t25O\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG8a8wDtcfcYcj6MZ2UZ4M5WXQD741WelT/C5ziPiF9BAiEA39aFQ/ove9kTt1snA0V3GX/nxkBOhBSxOYW/y3hBZBc="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"asyncliz","email":"asyncliz@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.15.0_1588718172195_0.08400517900682858"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.16.0-canary.1f4e3d1c.0":{"name":"@material/mwc-textfield","version":"0.16.0-canary.1f4e3d1c.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.8135cc085.0","@material/line-ripple":"=7.0.0-canary.8135cc085.0","@material/mwc-base":"0.16.0-canary.1f4e3d1c.0","@material/mwc-floating-label":"0.16.0-canary.1f4e3d1c.0","@material/mwc-icon":"0.16.0-canary.1f4e3d1c.0","@material/mwc-line-ripple":"0.16.0-canary.1f4e3d1c.0","@material/mwc-notched-outline":"0.16.0-canary.1f4e3d1c.0","@material/shape":"=7.0.0-canary.8135cc085.0","@material/textfield":"=7.0.0-canary.8135cc085.0","@material/theme":"=7.0.0-canary.8135cc085.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"cddafa9ea64276d2774eca727578ad51fda9c366","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cddafa9ea64276d2774eca727578ad51fda9c366/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cddafa9ea64276d2774eca727578ad51fda9c366/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cddafa9ea64276d2774eca727578ad51fda9c366/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cddafa9ea64276d2774eca727578ad51fda9c366/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cddafa9ea64276d2774eca727578ad51fda9c366/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cddafa9ea64276d2774eca727578ad51fda9c366/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cddafa9ea64276d2774eca727578ad51fda9c366/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cddafa9ea64276d2774eca727578ad51fda9c366/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cddafa9ea64276d2774eca727578ad51fda9c366/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cddafa9ea64276d2774eca727578ad51fda9c366/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cddafa9ea64276d2774eca727578ad51fda9c366/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.16.0-canary.1f4e3d1c.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-Ix8ogDqBbTi2smh84HTNwc+YvqOYGHaCG8HgkjoEWgupPy32dka950NWwat22n6KsJCpHYASMaP9/0/4sqdZIA==","shasum":"b951badfb17a90fea048161fcd602b1cab622cb2","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.16.0-canary.1f4e3d1c.0.tgz","fileCount":16,"unpackedSize":247023,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeszRsCRA9TVsSAnZWagAAOAEP/2J3zYKU+Zile3SxH4oW\nuFh6pdXqNLc8yURwuqcyIEggLVg9TgYFSKeh2LzC2lzcbNNULuFcxQ+LhOUq\n6lEZ25C6JRW3Z47F5o5twPdmq47jHPuokys2n1WlIl0bVI6gBn/zda6faDfO\nkHU3Z3hzpFg6ljHU/IAo09l7neaQua9hq1ZAEExb8tuhf+pY1uCiVWLztqii\nnZlg4WDtm8HSAFd7x4U83fCu7gyUn8NXz1addw1qrXcNBoYNQVhZa1tcRapw\n5t4gNXzl1M46PtYE9eocG1tFYPCeQHYWiit2faYF8LUuIuUFSAR8k7/4eDzZ\nu9pJG6R9d4ihSrOHxp4Bbf729b7wRLlw6LDAbzOvEJp6XyakZ2RVwCK2/T6w\n86iU51nOkiTetcctVPKv42+MnWouTbfDJEbV2oDk6HziBfsbD1FM3d7vYnX/\nnvMOUHK15927gpAxBP9XwOEKhIoA7U8a6bWBFwI3XzegLCXQG+DOUryQDzAz\n5Aa2muTMo9sF6NthfPOTmmUZHqJ5NWx1FUQBIPkR/R0N7srqfxbBa1w7DYhG\nVWT9ykw6UsjJWUbt2uox37CORjwshcLhrsvc9LEqzJEHW7y3KNWzr0XSYgKU\nHOppktWZaaxUODd9KlV4FBIXHmN0uCG0Nlpjf1BQMaH2ROS02x1MsWkW1aAD\njV7T\r\n=yuud\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCfhIsmG3aR6f6N0Elxy5pqJjLIZSP01evaIxB2VXLNcQIgPsXnpZaFuitpDP1QnHuTDHWzaf8HrxPZmU8eL3N3IHw="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.16.0-canary.1f4e3d1c.0_1588802668472_0.29165839535325033"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.16.0-canary.bc8759d5.0":{"name":"@material/mwc-textfield","version":"0.16.0-canary.bc8759d5.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.f83e00898.0","@material/line-ripple":"=7.0.0-canary.f83e00898.0","@material/mwc-base":"0.16.0-canary.bc8759d5.0","@material/mwc-floating-label":"0.16.0-canary.bc8759d5.0","@material/mwc-icon":"0.16.0-canary.bc8759d5.0","@material/mwc-line-ripple":"0.16.0-canary.bc8759d5.0","@material/mwc-notched-outline":"0.16.0-canary.bc8759d5.0","@material/shape":"=7.0.0-canary.f83e00898.0","@material/textfield":"=7.0.0-canary.f83e00898.0","@material/theme":"=7.0.0-canary.f83e00898.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"bd62828e2f7b66a127bc0ab165f32bf39b79fb0b","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bd62828e2f7b66a127bc0ab165f32bf39b79fb0b/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bd62828e2f7b66a127bc0ab165f32bf39b79fb0b/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bd62828e2f7b66a127bc0ab165f32bf39b79fb0b/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bd62828e2f7b66a127bc0ab165f32bf39b79fb0b/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bd62828e2f7b66a127bc0ab165f32bf39b79fb0b/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bd62828e2f7b66a127bc0ab165f32bf39b79fb0b/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bd62828e2f7b66a127bc0ab165f32bf39b79fb0b/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bd62828e2f7b66a127bc0ab165f32bf39b79fb0b/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bd62828e2f7b66a127bc0ab165f32bf39b79fb0b/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bd62828e2f7b66a127bc0ab165f32bf39b79fb0b/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bd62828e2f7b66a127bc0ab165f32bf39b79fb0b/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.16.0-canary.bc8759d5.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-p34nCpqIoPiXunaA6s6nV2AERFh6xf36CljwZAeUm4NGrAg9iu2zo5f08IsQHIHAZp7+TOHn/8ONNm151Uj35w==","shasum":"4365938978acf1971f8cc0374a075f7bd6016b37","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.16.0-canary.bc8759d5.0.tgz","fileCount":16,"unpackedSize":247023,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJetJZiCRA9TVsSAnZWagAANxkQAIukh5mNxWeDM9SUJEYM\nHgCwbYHU6I2IiOTQPBXG9GrKlil7xfNEpK/LqNdhaJpYLdaeBcD3j7cTx9tr\nyHKeK/8IFt5a9ZPAfZfYAf2c25DgjQtm2oZIJsNHSuTjE4nhTqw/+BuS/eLP\nh3ELLTXtf/d+K14ELN/H3Ur7D9G6E55YdYUiGLuaL7lj/mMUZWaA6cRmuoA3\nszNwstf7zHiBdGb+5C8WveHSpnFhsLE+E6knIBgQ7x0uNtBhL+6cm8k6mLPG\ngf3fzJsAIG2SJ9rFl9V/bMAJGbajm2TOvgxVmNcAZQtSBT8vhSay0+rM1taC\nTUU2pAbOBCOvPZhqzcae8jgIjXuVC1dMqrjtVuCAq4dGi8CkMhPVdqkJLq/x\nV3P+LHaiKcFWTmWpPYngH4dVzH4nr/xYHNK2M9lTD//bRK+JtSXQJjy4b267\nyAiCrv1eGtBGRZR9pv09vTS0bSDE2TEG+lQnvO2/K3y/hL4JmJU6cWBYXEgT\nCUblHcA3L3D9zJ/gQYVwhbmqmPNI0GD7qprFeqk+/FVveF7CnJ4kYELPl0Bo\nJcF1ElDPjX/z+sXDYz/v8HDySQc94okSkAlLmtMK6JZRCZZln+B7qssl8t3+\nvgcLnhIhjfPn4mNl9DxrAdmtWCo1AEqR0f5++ihaXjR877ph+PmLr7Zb1w1J\nhlKH\r\n=iZ1Y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC30wA7dcYp4TMly+7nw1LLWxZUvapb6+joa+m6c/SjxgIhAI4+yGj5EY+nj9zLgDZO3zPK3R+6lRYa+td2gZzUSbtS"}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.16.0-canary.bc8759d5.0_1588893282264_0.9501159152195511"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.16.0-canary.d1379acf.0":{"name":"@material/mwc-textfield","version":"0.16.0-canary.d1379acf.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.f83e00898.0","@material/line-ripple":"=7.0.0-canary.f83e00898.0","@material/mwc-base":"0.16.0-canary.d1379acf.0","@material/mwc-floating-label":"0.16.0-canary.d1379acf.0","@material/mwc-icon":"0.16.0-canary.d1379acf.0","@material/mwc-line-ripple":"0.16.0-canary.d1379acf.0","@material/mwc-notched-outline":"0.16.0-canary.d1379acf.0","@material/shape":"=7.0.0-canary.f83e00898.0","@material/textfield":"=7.0.0-canary.f83e00898.0","@material/theme":"=7.0.0-canary.f83e00898.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"7b322d565d0668b9f1c4054abde8984cdba4ee4d","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7b322d565d0668b9f1c4054abde8984cdba4ee4d/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7b322d565d0668b9f1c4054abde8984cdba4ee4d/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7b322d565d0668b9f1c4054abde8984cdba4ee4d/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7b322d565d0668b9f1c4054abde8984cdba4ee4d/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7b322d565d0668b9f1c4054abde8984cdba4ee4d/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7b322d565d0668b9f1c4054abde8984cdba4ee4d/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7b322d565d0668b9f1c4054abde8984cdba4ee4d/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7b322d565d0668b9f1c4054abde8984cdba4ee4d/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7b322d565d0668b9f1c4054abde8984cdba4ee4d/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7b322d565d0668b9f1c4054abde8984cdba4ee4d/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7b322d565d0668b9f1c4054abde8984cdba4ee4d/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.16.0-canary.d1379acf.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-bsHoC9YQLKgoZNSIxCj2ZLv4yNMv+ZXv+FHCDDtFMCMWlM5E0xPsK/8Jan4SnkRK/DVbJr25ciD3Q1S3wxhazA==","shasum":"3243e0267426d785b24df403260bbffe49d29630","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.16.0-canary.d1379acf.0.tgz","fileCount":16,"unpackedSize":247122,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJetZnFCRA9TVsSAnZWagAAb8sP/1mNZkj9sqHbToQoKEqI\nECyDlTD3t6CmPvfYlmZZa1hOUYh3BwWS9d8qBy52C9P7fgjVCeYSRJmpQHUK\numvx2GetYsFMi6orv8ApiGxKOy9pZf2QalMK0ITZtuihzy1j1bLy/izpy/it\nn97Skv9KqPqy8EduntKIXMqBjvsoeXS4Mxz4XnQLmZE5wg7TlsUab+4D0e6s\nqSEySQpaSkbZEWUmosN37RpiiY8xXRulOz+Do/cTwVcAgakN6XFTM0MGhUgS\nqV+Y2metUXG0SYYEFaABSPslQxcvjN/81latOM/nSD66EMYG2OH3Ccb3EK1c\nv50vnNZMUkUIF8l6blSRZN5i1oTHKEZGLuFD+J0PiczLOsEhZ/Ac1I4ByuNG\nebSqOSSG6PfM83I1vTg5xqoxmGSE+pkEC8SXgWWxfdgOCcs/8S+3vO+KVqSc\nSlr74PhY+HGQonRz9c9dYIdkaEPEDaqq8yJej92PVLyFftEKPdBuHhyTC3St\nj5QDHmfCE3uZlYhw92VS5HfrDMzNgu/8hFtqYm+A8SVfOk9UIjwyfyZtsjDM\n2+0MBmbdd+x8Hi7i8+34FNm+7JhX9W6mDzCIBBYA4jAa1/qqT9xG9/sBQmM1\n4oL4BzdIFZSp1ScFZhpFSX814EjkjXjU2dtmSMRVBM8t7ixIUUQSSeCiQIFl\nbwFa\r\n=5hpW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG6aTC+o2RudfZMFvCIB3wrtpOnIHEKE53n3TEpfPP6lAiEA3UHpKjnVF4HzMt4ONOhmspZ72DP5USsMlpffG2TzwQ8="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.16.0-canary.d1379acf.0_1588959685267_0.1915169087836357"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.16.0-canary.58d51fc0.0":{"name":"@material/mwc-textfield","version":"0.16.0-canary.58d51fc0.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.047e6b337.0","@material/line-ripple":"=7.0.0-canary.047e6b337.0","@material/mwc-base":"0.16.0-canary.58d51fc0.0","@material/mwc-floating-label":"0.16.0-canary.58d51fc0.0","@material/mwc-icon":"0.16.0-canary.58d51fc0.0","@material/mwc-line-ripple":"0.16.0-canary.58d51fc0.0","@material/mwc-notched-outline":"0.16.0-canary.58d51fc0.0","@material/shape":"=7.0.0-canary.047e6b337.0","@material/textfield":"=7.0.0-canary.047e6b337.0","@material/theme":"=7.0.0-canary.047e6b337.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"095d9f72ab7ca9994ffd376ac6b1b0daa4c99011","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/095d9f72ab7ca9994ffd376ac6b1b0daa4c99011/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/095d9f72ab7ca9994ffd376ac6b1b0daa4c99011/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/095d9f72ab7ca9994ffd376ac6b1b0daa4c99011/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/095d9f72ab7ca9994ffd376ac6b1b0daa4c99011/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/095d9f72ab7ca9994ffd376ac6b1b0daa4c99011/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/095d9f72ab7ca9994ffd376ac6b1b0daa4c99011/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/095d9f72ab7ca9994ffd376ac6b1b0daa4c99011/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/095d9f72ab7ca9994ffd376ac6b1b0daa4c99011/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/095d9f72ab7ca9994ffd376ac6b1b0daa4c99011/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/095d9f72ab7ca9994ffd376ac6b1b0daa4c99011/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/095d9f72ab7ca9994ffd376ac6b1b0daa4c99011/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.16.0-canary.58d51fc0.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-esLjoD2rqehPKyN1b16ETW3NXp4n3H64RoFM0QlNrL4i8hMZ3TjWM7i0gELk1u3rkhTe8D+88cGGX6rWBa9fWQ==","shasum":"124537c414ed25c6e0a1ab99b55bc023f8101b5f","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.16.0-canary.58d51fc0.0.tgz","fileCount":16,"unpackedSize":246705,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJetbBLCRA9TVsSAnZWagAAYJ4QAIFrBHfcemPfL+++Bat5\nU1hQ06puNkA3SHMpNJ6e5rvmKX7k2J+Fu6oy05fD9G1l6nmkm7ypyKvlbieY\nJODrDYCQE/0nY729/1Lxil7IV7z3isiB8Ff88AacyymevNrv8+Jfy2UQUHjH\nv3g9EbCSUIJB6aiBeObpwkYCy9pQ0r6nwkHHMtNIEflrjcXPDb4iA49BdvWV\nwNJVpPOVEGouSW+yDTugADSBVxMX3ExSZ+4tOlbsLkejCPUfLNRUevSQdFZA\nyaZ2bU88LsH78OnpoQI+VR1IDZaUDvoY/yMAUR0/LGbE7VfH+Xk8H532ia05\nP7OA5r9/MKEwxl3mF3k41j2tQLnQYcWTjqpdyOP2NrMjsC1WrWudS0Dyytnt\nR9ilEGv9tX7q7apzT+WLXBcf7QB1AKD5jlC3bNpSobVOm2LRPKQQYxuNG9d5\nHA8UGvwNTzi5fL2hbArzeVp0B2Vv7vppt+XBC9M4I22qzIkF5H9p36TUwdAP\nVh/FCqk8hVMZHySBjQ4/VdRVhN5Mgeqo7n7p764I+Kpw1jdV/xW37rcaaMl5\nluQMVD1yh3T+3jx4HTDt5E7nUD3F3IYm+jHd0/EC+ex7nu+zfJ+dZ47oxu8t\nZOAaHJuT1HegCXfnXRrH5fLYdlzUNdj2RaqyqqxM9NkPFlg6NBGt+wIfaHUW\n/2/C\r\n=Zh6A\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCnH30X4A69al78Yl0kYwsnKnIBeDVds7P9SjNEVaVMkAIhAP+e6PWRuLJ7kMNmgUcsHMUxHZd60u+7qLwY+AlKz5EV"}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.16.0-canary.58d51fc0.0_1588965450641_0.6198437760596966"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.16.0-canary.588062d7.0":{"name":"@material/mwc-textfield","version":"0.16.0-canary.588062d7.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.119e21426.0","@material/line-ripple":"=7.0.0-canary.119e21426.0","@material/mwc-base":"0.16.0-canary.588062d7.0","@material/mwc-floating-label":"0.16.0-canary.588062d7.0","@material/mwc-icon":"0.16.0-canary.588062d7.0","@material/mwc-line-ripple":"0.16.0-canary.588062d7.0","@material/mwc-notched-outline":"0.16.0-canary.588062d7.0","@material/shape":"=7.0.0-canary.119e21426.0","@material/textfield":"=7.0.0-canary.119e21426.0","@material/theme":"=7.0.0-canary.119e21426.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"1b66fe2af3ce7c18a07562e7ad2469074135eec3","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1b66fe2af3ce7c18a07562e7ad2469074135eec3/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1b66fe2af3ce7c18a07562e7ad2469074135eec3/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1b66fe2af3ce7c18a07562e7ad2469074135eec3/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1b66fe2af3ce7c18a07562e7ad2469074135eec3/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1b66fe2af3ce7c18a07562e7ad2469074135eec3/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1b66fe2af3ce7c18a07562e7ad2469074135eec3/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1b66fe2af3ce7c18a07562e7ad2469074135eec3/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1b66fe2af3ce7c18a07562e7ad2469074135eec3/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1b66fe2af3ce7c18a07562e7ad2469074135eec3/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1b66fe2af3ce7c18a07562e7ad2469074135eec3/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1b66fe2af3ce7c18a07562e7ad2469074135eec3/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.16.0-canary.588062d7.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-LE/s81WpqpBDbsJyHgkQtGWQYE5cKzzeN20Sk0gbRhJ1Zj8FjKtxzK5kcG8Z1K9ZWMpf9Myfh0MFmnyFdq1LAA==","shasum":"d7512ed3621819833f281ef10ff6643eff4dd20f","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.16.0-canary.588062d7.0.tgz","fileCount":16,"unpackedSize":246705,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJetc3fCRA9TVsSAnZWagAAZuMQAIaKDOg2fbiEG61YXPT2\nRDXayRV978/AFYf0OLpaMAD6/RPXB+4IC4XCokhE4eaxJvMZlDHuoHvVYvdQ\nGQJUeNsBgXQEtLJ97EYKyBwIRSKHy4mNmQbsvP9U5fllZViEDRr2Or3FfyM2\nvOnGBWGZKP0Tte0je5ZDz/rAIlvvpr1E34wpN1zYnos1KhITxz8f54kGyExQ\njBNLfJfMs73pQ/7A9bOvmpChx6AKYrk3m7dMsCkeJJ3vXgedCuKqqV+2116u\nR0ftWm37AH/2Ne1L8xr5sr3mpIv6ghkyNkV3WE9SuQQQJPjIbyOzZ6sYTqsz\nZFOxsukseel9m7a191AGLsxU+9TShy/SN8up7i2HNWCxaFc8d1rjtUI8IW5/\nE5BmYiQ8Qf8NaDlkOo9CvAScUPlVeGFBnju6DmrQ2AxtV+6QfgG0GI9n4YN3\nBPjMoP2Hy2It9jQXUNCbOps0RGxzLyalo1bJoeMrZptlzSDIzfGO5cb4MazA\neidbbVbGNnRJvQS+Ilm6b7p6YV8aeti0BNHOK/T+IGNEqOXAAGUbLonGpIDu\nfJOAbMN0/XmRV9rkECngbVvfa6FphGn5WkaWWSuY103LAFxSHIo6OzdJlln0\nWrCemtgPgybQEPef8OyFkGv0bWZqZTZa7wEPTxmbvsCv6fmaa5lK569Xz0Yo\n2lbb\r\n=OGXB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDfrGsIpb7NKLBDI86+Em4gLWPaattbiRxyV+vcrNRj/wIgB87RSIVPXNaBN+Pve0ny/sQ09gnSFNF6g1LDyPdfAI4="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.16.0-canary.588062d7.0_1588973023182_0.17795291069493757"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.16.0-canary.fa21f639.0":{"name":"@material/mwc-textfield","version":"0.16.0-canary.fa21f639.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.a5aeb3001.0","@material/line-ripple":"=7.0.0-canary.a5aeb3001.0","@material/mwc-base":"0.16.0-canary.fa21f639.0","@material/mwc-floating-label":"0.16.0-canary.fa21f639.0","@material/mwc-icon":"0.16.0-canary.fa21f639.0","@material/mwc-line-ripple":"0.16.0-canary.fa21f639.0","@material/mwc-notched-outline":"0.16.0-canary.fa21f639.0","@material/shape":"=7.0.0-canary.a5aeb3001.0","@material/textfield":"=7.0.0-canary.a5aeb3001.0","@material/theme":"=7.0.0-canary.a5aeb3001.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"e20cc975825eb5a02be956c28db1cebc2f8908c0","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e20cc975825eb5a02be956c28db1cebc2f8908c0/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e20cc975825eb5a02be956c28db1cebc2f8908c0/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e20cc975825eb5a02be956c28db1cebc2f8908c0/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e20cc975825eb5a02be956c28db1cebc2f8908c0/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e20cc975825eb5a02be956c28db1cebc2f8908c0/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e20cc975825eb5a02be956c28db1cebc2f8908c0/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e20cc975825eb5a02be956c28db1cebc2f8908c0/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e20cc975825eb5a02be956c28db1cebc2f8908c0/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e20cc975825eb5a02be956c28db1cebc2f8908c0/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e20cc975825eb5a02be956c28db1cebc2f8908c0/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e20cc975825eb5a02be956c28db1cebc2f8908c0/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.16.0-canary.fa21f639.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-jnKYdFf/tPT/3WyRhMDUJ47YXPgAQ7YnNDh4XGhpSelV57LO7N+wwPP7PMY1h0V7Ew85Ei/MVmfrVCT0RqOSmg==","shasum":"6c3161f8be2db530d167341a371e4920cbd851b7","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.16.0-canary.fa21f639.0.tgz","fileCount":16,"unpackedSize":246705,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeuYuYCRA9TVsSAnZWagAAipoP/ifbB4QVbtT377+0DmY8\n4z3p7ixrlx/5KFc5SSerrUSwf4ugMHZpdc9prmYOwK6GBU0Q+bh7opIkY6iX\n7PM/XZwkxvdS3kpieiy2lN3cGuoH/GcgKyNusmQWhCm+iFQ4UHhIL4Nuzlhr\nw33Qo4iy6oCNDRitIQraXLwSLk9m2KHcmYyms4e2+6eqAqr8cJOq2O35QEer\ne0etjg6ToqihSoensGqhNidgxw6AAK4BJKUrr5onb6L3z/d8ycVBEz6mJNbJ\nAfcyidLazhDCzAT8R83b3mTih0OCyj/JjZem1H3ulQbfC0y+Wk6dCHo0nTlL\nvEm8rpsoViC3Yi1dmvldSUyz/FByTtEWIP5hrlQgq6anwKOruNRzOf7sLf1L\n4Nbp9YNOGxMfaoEBwJ3tF/aUmqz+CuABKStT35Vsy6QxeaY/qHq7irlxclBZ\nkm6x0qfgOh/eS+atiyQq+mgoQn7tji2e3xion5wIt2hepCTZyizKgwiDzIpx\n0LvgWuoEcqHG/SmJ9bTIdGYlta7TyubYnkkayKHyAF8v7srJkhe8qrrhng2R\niiIe93lhsDeP0RFTOR3iT7gH9QO9Y5XzlagrtKMaHMHe3JvfojkYtUkvOjQ2\nb6XvKUuK/IgsvFnbksYiih+/GuHMkTq+0Ge/qm+jw53ekv39s5Oe4LlUDH/c\nAkE6\r\n=l8oM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHjrCP64/JjmbxDCLhZ1aZjmvNWKZa2HSdYYbbHt41u6AiEAvJG2OIgxPlRnOEZZVS0O4+JRIKZyELJkAnYXBaScf/w="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.16.0-canary.fa21f639.0_1589218199606_0.8120482526462596"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.16.0-canary.2772c509.0":{"name":"@material/mwc-textfield","version":"0.16.0-canary.2772c509.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.a5aeb3001.0","@material/line-ripple":"=7.0.0-canary.a5aeb3001.0","@material/mwc-base":"0.16.0-canary.2772c509.0","@material/mwc-floating-label":"0.16.0-canary.2772c509.0","@material/mwc-icon":"0.16.0-canary.2772c509.0","@material/mwc-line-ripple":"0.16.0-canary.2772c509.0","@material/mwc-notched-outline":"0.16.0-canary.2772c509.0","@material/shape":"=7.0.0-canary.a5aeb3001.0","@material/textfield":"=7.0.0-canary.a5aeb3001.0","@material/theme":"=7.0.0-canary.a5aeb3001.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"757bcaf3dfdfbcc62a5b2990c87cd91f80fbdd1b","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/757bcaf3dfdfbcc62a5b2990c87cd91f80fbdd1b/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/757bcaf3dfdfbcc62a5b2990c87cd91f80fbdd1b/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/757bcaf3dfdfbcc62a5b2990c87cd91f80fbdd1b/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/757bcaf3dfdfbcc62a5b2990c87cd91f80fbdd1b/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/757bcaf3dfdfbcc62a5b2990c87cd91f80fbdd1b/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/757bcaf3dfdfbcc62a5b2990c87cd91f80fbdd1b/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/757bcaf3dfdfbcc62a5b2990c87cd91f80fbdd1b/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/757bcaf3dfdfbcc62a5b2990c87cd91f80fbdd1b/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/757bcaf3dfdfbcc62a5b2990c87cd91f80fbdd1b/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/757bcaf3dfdfbcc62a5b2990c87cd91f80fbdd1b/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/757bcaf3dfdfbcc62a5b2990c87cd91f80fbdd1b/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.16.0-canary.2772c509.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-l4hrMWXvSMLAP+hYrSQpeufsYj0S6aBzrrHy4DCAe4p/83BDiEkX4zJyUUUNF1pDVLWz7kajDZk8r77Pf4wWoA==","shasum":"9ee1c865da09774c536560562f3e08c30fd7a3b0","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.16.0-canary.2772c509.0.tgz","fileCount":16,"unpackedSize":246705,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeuZs0CRA9TVsSAnZWagAAoMgP/1AFBvkdigvS/NGJ2s/H\nppYntIuqk7N6UF05o1IvgnIrYgASMNu7KedZczWQghm6aAbIrS3yOaE69SFt\n4MN1JtA51egPB5G7d8LGCGDsFHa8uE0d1SRU6rPhmy70ooQF/lZZkpCu9Q4c\nGUqe8wbQvg3RaWS66qwk9ilJkSzKtsJeKGCV8K5DsT3dGhEm1H1sHUvLcLD1\nl1zoi79aphWXQve4x5vql4lxh4bfwFCc2cXOxKSLGOOKAgMrgzbQc2Y627pc\n92vvQMfNFyWK80wt6Fgy1lAaalk2RRLpE8+DWmk7M/5LuDYCRhc0254Ba04H\nGORywkGrJWm1YgESncxOLAr7JKsiPKp5c2Ul7ekZShz8tfiMIt62XhLioIyP\nvC1WtilashofXuy2ddxKLHimCzykWCps5aT8g9zlggDA+jQQiR4fcV1hI3DN\nS4mCp0w+YmaemfzdvdIyXyZubGrt3ZOXoyrJGZEY47osE2UDSyhVOz1qEJYb\nER8VTU6JfDIgRvNSHHaz0SFdZgaD5rucK2MZd6UqxYAAJjlmxjvvM27IDqAJ\n5ZwKa5TgKQAPXz0YummQtXtOdlzMFUK0AlShSoN8YnD+x9LtymvIfDBxutFI\nFWnnM08iRgJZx1U621slZjgDYUalASgMIvHz9jDdusb3s8DdWzDrkPVuXiQi\nlpg8\r\n=x7mP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDJ5ZNbsHFa6xKxqPyHy9EECaKvIUanxpd8+7fL2wT9CwIhAMlfqx1nL4TsXs4YxIF7sh42PYCs0QNY64JhJ5QEW6Qn"}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.16.0-canary.2772c509.0_1589222195779_0.04339492537679557"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.16.0-canary.fc4796d5.0":{"name":"@material/mwc-textfield","version":"0.16.0-canary.fc4796d5.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.a5aeb3001.0","@material/line-ripple":"=7.0.0-canary.a5aeb3001.0","@material/mwc-base":"0.16.0-canary.fc4796d5.0","@material/mwc-floating-label":"0.16.0-canary.fc4796d5.0","@material/mwc-icon":"0.16.0-canary.fc4796d5.0","@material/mwc-line-ripple":"0.16.0-canary.fc4796d5.0","@material/mwc-notched-outline":"0.16.0-canary.fc4796d5.0","@material/shape":"=7.0.0-canary.a5aeb3001.0","@material/textfield":"=7.0.0-canary.a5aeb3001.0","@material/theme":"=7.0.0-canary.a5aeb3001.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"ddd82bfd80666625c1dcd7c92fe79f5de6f84657","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ddd82bfd80666625c1dcd7c92fe79f5de6f84657/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ddd82bfd80666625c1dcd7c92fe79f5de6f84657/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ddd82bfd80666625c1dcd7c92fe79f5de6f84657/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ddd82bfd80666625c1dcd7c92fe79f5de6f84657/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ddd82bfd80666625c1dcd7c92fe79f5de6f84657/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ddd82bfd80666625c1dcd7c92fe79f5de6f84657/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ddd82bfd80666625c1dcd7c92fe79f5de6f84657/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ddd82bfd80666625c1dcd7c92fe79f5de6f84657/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ddd82bfd80666625c1dcd7c92fe79f5de6f84657/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ddd82bfd80666625c1dcd7c92fe79f5de6f84657/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ddd82bfd80666625c1dcd7c92fe79f5de6f84657/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.16.0-canary.fc4796d5.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-eEoy4hQVoYdyQHphDixMNLcZWYo+sZgwJgiWDtyHidwsFLY/bvGkCAaHjd9KacGfnCb2xRuAWlbH5zBJCYsKJw==","shasum":"eb172daf26eef5ed5a0ad8c21ef51d61c06316d0","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.16.0-canary.fc4796d5.0.tgz","fileCount":16,"unpackedSize":246705,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeua/yCRA9TVsSAnZWagAAZ3UP/iiCibFgUAVVEloihXP/\nnK9p8R+L4fxFgp0UcsbSgCn3kT8Z2t9fjXsCrLWnpy6P/3xKjvt0sem7/AYw\na8aCvqRmaBBHszPclXXA47vIM2HCBQLCOoKixhp23brFuKr4H8ry9xI1YOM+\n1s05JpjLLLWHuhNiIe725ZyjIHDI3CQplt50hknV4k4RwLSA9mtXzwrfUMQv\nJUHnUIYNUnhZuD7rPBf5LeuD7djr2X29WUCsEomAZOnWnLPDVc95jQs1JQAk\nj9p0KZnJ/TyTfLyX44qwcaWkxDgd5ECYgWt+sgQVj8DJDgLjaflnBG1u+VjE\nd7XB+++fqmheuLMMBufBeBCMPII36ud5Q6fGrRS3diZwEPLHJiHMutPbf9s4\nrMho8EnXw5wQp5tCTCk81r2pp37bpuxgRpX8leM3G6L0/lvCwA+dYV5BEpEf\nx1M+aOG8Zdji9MGPnSKz5ZS8lULNElc7UjgFWEVymWr9kn/k/2ni8SHrHA71\nlCsTadwdrtj3mHzFmjwoGojfxFKrkFlWwvlXTr6ZPFkANgkLnqDSCoA/TIh2\nTG+WLBQLft6ecjXp6G4mcMrTSntD/Ery4jHZxJ0gVVx8W9vNLKDj5sveQhtY\ncRgqGCkxKwiqROnztWCXZcI4lrS6uUmExDO9WDueQz6/5HdXjv6xzE2h1Ljb\nQdQo\r\n=/V9z\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGbqCT4KOkrcYisCX0RpxWABEL1yx3Jhw9kK+mlRcOp5AiBbPAPBSCxgaXMw5a2B0ElzZh7lp5ekKfgFA2ecZ7atsg=="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.16.0-canary.fc4796d5.0_1589227506011_0.9177732478550777"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.16.0-canary.0d1c5f2c.0":{"name":"@material/mwc-textfield","version":"0.16.0-canary.0d1c5f2c.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.ed52af767.0","@material/line-ripple":"=7.0.0-canary.ed52af767.0","@material/mwc-base":"0.16.0-canary.0d1c5f2c.0","@material/mwc-floating-label":"0.16.0-canary.0d1c5f2c.0","@material/mwc-icon":"0.16.0-canary.0d1c5f2c.0","@material/mwc-line-ripple":"0.16.0-canary.0d1c5f2c.0","@material/mwc-notched-outline":"0.16.0-canary.0d1c5f2c.0","@material/shape":"=7.0.0-canary.ed52af767.0","@material/textfield":"=7.0.0-canary.ed52af767.0","@material/theme":"=7.0.0-canary.ed52af767.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"56733523245d57fa1e6ebe3caa22ef89bc95e8d2","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/56733523245d57fa1e6ebe3caa22ef89bc95e8d2/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/56733523245d57fa1e6ebe3caa22ef89bc95e8d2/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/56733523245d57fa1e6ebe3caa22ef89bc95e8d2/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/56733523245d57fa1e6ebe3caa22ef89bc95e8d2/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/56733523245d57fa1e6ebe3caa22ef89bc95e8d2/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/56733523245d57fa1e6ebe3caa22ef89bc95e8d2/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/56733523245d57fa1e6ebe3caa22ef89bc95e8d2/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/56733523245d57fa1e6ebe3caa22ef89bc95e8d2/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/56733523245d57fa1e6ebe3caa22ef89bc95e8d2/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/56733523245d57fa1e6ebe3caa22ef89bc95e8d2/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/56733523245d57fa1e6ebe3caa22ef89bc95e8d2/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.16.0-canary.0d1c5f2c.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-/rUVLEYK81lIz6txl7HsWqY6jYOqkMz5/Acy6pK/Ot/GQ9ftVCZ6xM2Ecw0sOHC3d0PE9wjeTAiGGJqLizaavQ==","shasum":"f487baa2b921146d47114b5dab118fdf2c4de5e5","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.16.0-canary.0d1c5f2c.0.tgz","fileCount":16,"unpackedSize":249603,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeucFzCRA9TVsSAnZWagAA6JoP/iJiqfU44KS/BCwBQuLF\nNyoMc/po5hLXHpAlYByLOQqWWcdZyyB203RKm9EuAj0RWwkiQRXZJjUrCsIa\n9M4mMS6UGQw++Bh10breyztQw/4dz+hFTRg1amIFd7pWGuZ0oCBs5qIAN7Wq\nyARz2bwKDCNC3zTwhhcSrpLcCBGmrbqTSeEwH4ioscZewBM32Ts/QNSKgPNi\na4+SpZDZ1YvyspT0XKpK0iB3oAUS8351jUfHEg6Wp6H9nqJMeMajsExgaI+V\nVzzpUJigLtL3zv154/n6icpIGBEJ9m1V35phPpiETdykHHtmrpT//SLBt2XV\nkdHrtY3oExIUnkbahT7I/dL4NUDRLRFZjwWRObfgevKoTnCIWympZfDMA+w3\nGFeN0KLGohQHRkS9CVJUHdd4u5QgjSBUKE4jKAIprlSA1bWohWR/HAzRhZhj\nHnp5DqVp5EY+gFYwmYNZZgv+g64dgkRzOK8KT10tOwbBxNlSH8nCVa7eq/Ee\n4LoQfjew6BPha/UpK52fbfiYRToTiERon1zvAlKmqBJGux7Rsu/vHNKCaaB7\n5M6com7ly9daVVSASx0Ox7VD4Iv6JDZonCsqeaEo5WLx60ICQCncJLQr2NvC\nSFEv8M5jR2KJc11Pt20SoQRIUE3QRg9+4KHnWHcfW+6pFB38GjTldXsbTWm2\nmfd1\r\n=kSON\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICAyLsknUq5RXqikBeiuBLONPozm182//gLUa4hnzWiGAiEAx424hVrCQdkyCA5ic2AUr+bPDLLjNzBOzsBnxRkyw8M="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.16.0-canary.0d1c5f2c.0_1589231987060_0.4779455012433125"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.16.0-canary.d083d93a.0":{"name":"@material/mwc-textfield","version":"0.16.0-canary.d083d93a.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.058cfd23c.0","@material/line-ripple":"=7.0.0-canary.058cfd23c.0","@material/mwc-base":"0.16.0-canary.d083d93a.0","@material/mwc-floating-label":"0.16.0-canary.d083d93a.0","@material/mwc-icon":"0.16.0-canary.d083d93a.0","@material/mwc-line-ripple":"0.16.0-canary.d083d93a.0","@material/mwc-notched-outline":"0.16.0-canary.d083d93a.0","@material/shape":"=7.0.0-canary.058cfd23c.0","@material/textfield":"=7.0.0-canary.058cfd23c.0","@material/theme":"=7.0.0-canary.058cfd23c.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"740c7f6a0f292b586689cce49e46a93876251b93","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/740c7f6a0f292b586689cce49e46a93876251b93/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/740c7f6a0f292b586689cce49e46a93876251b93/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/740c7f6a0f292b586689cce49e46a93876251b93/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/740c7f6a0f292b586689cce49e46a93876251b93/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/740c7f6a0f292b586689cce49e46a93876251b93/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/740c7f6a0f292b586689cce49e46a93876251b93/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/740c7f6a0f292b586689cce49e46a93876251b93/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/740c7f6a0f292b586689cce49e46a93876251b93/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/740c7f6a0f292b586689cce49e46a93876251b93/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/740c7f6a0f292b586689cce49e46a93876251b93/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/740c7f6a0f292b586689cce49e46a93876251b93/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.16.0-canary.d083d93a.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-eaHrn+g5BcB/XdlcYQYpo8+E1yzcZCeZyb2misjrvINDq2SRB3bE1RQoVNBxwszcn5BGEiOZsgATOuKLqzQYfQ==","shasum":"bfe8bbe26e209dc56b0155237bcd48c9dec13ec2","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.16.0-canary.d083d93a.0.tgz","fileCount":16,"unpackedSize":249603,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeuetICRA9TVsSAnZWagAAH24P/25SxvOftyNd7QZuz2XQ\nSh9c/vzmIfacZhTaFCt0cfZAtfN5w/DyseND29zGvNgwHVOycHD7H8R8al0f\nAphZ+GjLmtODUf/Ifp7brmV132iMIutCOKp74YqnDQVMJaULWXE24jXvzW+h\nL0rlvmbk6rQfu+zfLIYUeJJVQfKhZ7MeA4wRykXxuTp92On4U5r1KI5DZxCz\nfeGvSR1a334LxCG1pz+Awkwg+bvOm6gQBihK1PC0MtS3ZZCIZPhREdY3NkD9\nMX7qrjMAmiyqevf563IXshozwMvGuRpjaPMPnDHGv8h1DjYANDW1biK8Csdq\nh53q67snMElUjSkWBt2P8G4ssqE6mSTFY8QVnhfBsFaNx8ULh9QG/cVqLXkq\n9K0q+skg3roHV7SSoHffkLO5t6ai+kn2B28VuMcfjXUrce/qqbrTAFvrMF8g\nkNpZEPLKsXZsKfj5KWBchQ2G94gq85Rt8yRxqqTzUSTt3IFTAyEdYPk/6MFj\nAeH4eJoi9BYAvk3bFstWdalcVV3Feyk/iNxf3Fgjl76TVmJ+MaYPLhkDnFC5\nShHFxUIqtDGwqiaDAkWmEDNtt/XMVNrXlqiPCbj3DOKT8LPfpnrdKmw9NYla\nbLcgc4AK25S82Fh3oaSw1mnifokAMqt3KuEQhITKMMmq57XBoWBFiYcTdjAh\no0LR\r\n=BaA5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC/8dccfmsyNY51sGQLZavEURAOl18Pd7Be8n5vkiq0wQIhAKWYrkVMQcgmYhJ9FzivvRnje8aIrtVdu6oqJCY9vEzH"}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.16.0-canary.d083d93a.0_1589242696159_0.8054663255829724"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.16.0-canary.c95d429c.0":{"name":"@material/mwc-textfield","version":"0.16.0-canary.c95d429c.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.058cfd23c.0","@material/line-ripple":"=7.0.0-canary.058cfd23c.0","@material/mwc-base":"0.16.0-canary.c95d429c.0","@material/mwc-floating-label":"0.16.0-canary.c95d429c.0","@material/mwc-icon":"0.16.0-canary.c95d429c.0","@material/mwc-line-ripple":"0.16.0-canary.c95d429c.0","@material/mwc-notched-outline":"0.16.0-canary.c95d429c.0","@material/shape":"=7.0.0-canary.058cfd23c.0","@material/textfield":"=7.0.0-canary.058cfd23c.0","@material/theme":"=7.0.0-canary.058cfd23c.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"cb13fcbdf906f1aa91a8a2ab889def17ec03e1ac","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cb13fcbdf906f1aa91a8a2ab889def17ec03e1ac/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cb13fcbdf906f1aa91a8a2ab889def17ec03e1ac/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cb13fcbdf906f1aa91a8a2ab889def17ec03e1ac/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cb13fcbdf906f1aa91a8a2ab889def17ec03e1ac/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cb13fcbdf906f1aa91a8a2ab889def17ec03e1ac/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cb13fcbdf906f1aa91a8a2ab889def17ec03e1ac/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cb13fcbdf906f1aa91a8a2ab889def17ec03e1ac/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cb13fcbdf906f1aa91a8a2ab889def17ec03e1ac/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cb13fcbdf906f1aa91a8a2ab889def17ec03e1ac/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cb13fcbdf906f1aa91a8a2ab889def17ec03e1ac/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cb13fcbdf906f1aa91a8a2ab889def17ec03e1ac/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.16.0-canary.c95d429c.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-WAqiA84QAslPRD917P8/mru6KBjI03fzbjzE1Q/d0XieRZGhITr+3fiefH65mPgvzNUBf7MS8D9IhyxYr29DEw==","shasum":"9bfc7556a06736bb4de478a1d0b3aef0ec1b6b2a","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.16.0-canary.c95d429c.0.tgz","fileCount":16,"unpackedSize":249603,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeuxb1CRA9TVsSAnZWagAAWs8P/jhjppQfj6ubbD8RD6bL\noKURs9oUMte1C8xUYT9gn+I1ej/IFfpTrKa+4l3xn2A9i/OnmivapNHfHTia\nsorDsrk4pEN3dVXdDhxkCsuCNSVDpf4Fq25Z0BQ9JKxWRynM6UzeM4WGv2Dl\nD0eVuvrysuV09O5Oonn6WAA4EkrHzxs9EE5DTKKxnhcTi3hmVeX/3q6Rt71v\ntZUBHKJ9GWHQVSU7NyVOx8Shy3RbFsxSXsaFlZvqaeW5HCCJGG+DIx1J7H5U\n8GCO7GwJL13KUzs2D8Brl6xznNH20wl9mDfO6Maiy5MCuZ6cpFGM/rlGmVWB\nhR3Paqr8wvwfUNXHzi65qnZlBuwQBcKm5xIq3q5d+zuXXVt+vkaooJU96VfU\nLmhy9ALGXT0uzRNtGWwKZh3f5q5D6FsfueG6bnx/Ualzt0svhH0DqQ8lvq33\nLU+Ln+Fp+vHCdsuN0YJKLrD4bdvIuiP+/SMOvy3/7gTyB5LuL6rP87wrHXdB\nb9u/WrnQgI4tarE0rzC6A+QMssr/rxbDyXqHhDy6ZxP2FcrsbP6e1EcnWHL9\nvDkUGUbD8SSrWMcfTqWcH8jjq1YIu+6N2jx1KKNPiNsJMcVUkP/IL9YaEgrp\nCUSfOvVoRoN3EeHn++0ajMd/aX4x076JNoDPkJIpyCVqHXk6WiPZPARcNVMO\neKeU\r\n=atTZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDQ0h7b35aADmGhskwf5QhGTWSYXBCh9czQtYzNEmAWDQIhAN7Z4qSgD2ksFLjbyvsJBSEGAZmko8sKCwvskH/X4Ey0"}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.16.0-canary.c95d429c.0_1589319413316_0.5972822018954977"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.16.0-canary.0c1ad726.0":{"name":"@material/mwc-textfield","version":"0.16.0-canary.0c1ad726.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.0a371b4fe.0","@material/line-ripple":"=7.0.0-canary.0a371b4fe.0","@material/mwc-base":"0.16.0-canary.0c1ad726.0","@material/mwc-floating-label":"0.16.0-canary.0c1ad726.0","@material/mwc-icon":"0.16.0-canary.0c1ad726.0","@material/mwc-line-ripple":"0.16.0-canary.0c1ad726.0","@material/mwc-notched-outline":"0.16.0-canary.0c1ad726.0","@material/shape":"=7.0.0-canary.0a371b4fe.0","@material/textfield":"=7.0.0-canary.0a371b4fe.0","@material/theme":"=7.0.0-canary.0a371b4fe.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"9c86cc2738d0075eee9b892c5c2fec842ae62e41","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9c86cc2738d0075eee9b892c5c2fec842ae62e41/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9c86cc2738d0075eee9b892c5c2fec842ae62e41/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9c86cc2738d0075eee9b892c5c2fec842ae62e41/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9c86cc2738d0075eee9b892c5c2fec842ae62e41/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9c86cc2738d0075eee9b892c5c2fec842ae62e41/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9c86cc2738d0075eee9b892c5c2fec842ae62e41/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9c86cc2738d0075eee9b892c5c2fec842ae62e41/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9c86cc2738d0075eee9b892c5c2fec842ae62e41/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9c86cc2738d0075eee9b892c5c2fec842ae62e41/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9c86cc2738d0075eee9b892c5c2fec842ae62e41/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9c86cc2738d0075eee9b892c5c2fec842ae62e41/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.16.0-canary.0c1ad726.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-87WnqS/AmjBvquHiN5P2vEuo2CZD5uirZ8zuXRKG9/rm0Du4qZU6u3AzWPNcVTrupdqqYG3DpiyYODH2V7lMtg==","shasum":"32ca3f96edbb78a7390b75ba8661a555d2ea2321","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.16.0-canary.0c1ad726.0.tgz","fileCount":16,"unpackedSize":249903,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeu0CDCRA9TVsSAnZWagAAxoMP/2Sn8A+KCb3hk+RGTf/I\nAe0HFTJKX9ugY4rqtVUPZwkHWySspGkxYniMXQ4Pr2tYAegtJvi42VtDXI6p\nROouBdqiohQgWhDeWnDt7GlPN5xtJuml5bowY4aVUoU9fiAkpzJXk1qpLKPl\nYhqoh7cvaeRBqIupAwW/Sh8cF9gmLN18/Ud0TiFNhp9qyCX1YYx+P8ABiM24\n800wkV5DwbAY2P4fjllCJ1MyRcmK63LWHz18iCV0HOTnlmM13ID+tpNT0lK/\n3DxAfCICwwfYZMmhT0RMWjnDxiVGkXTYuuUfRLjLnsoKo1JskEM6TNykVn32\n/Mg9xzJFQUpLKWgNaDY1zx1cIiWYmx0V7sCbsgoswIwadf0b7fdt1EufM4UN\nau3OTXBXbauB3Lv/I6WNLz/UDCJnqQd+QeyG8igYW7diNXQ3VYqCu0sr7rmv\nVXxJTG12JIJJh1TLSY6jscOUAoWJ9vCX3/5TbohpmYVJQU0GafeLKuPBU1G8\nmzfX0o3P8H8lfmGAoCdbAbz31wAKLMv1sac2TkMYsO3qxUmh7g5gL6WU3jFb\nsdgD5faqb6i14mWsSByL8H0ErDjjrw4CcMnZ3AYkNN4SeRsOYi1pPk8mMvWa\n5AvRmSf4yFNUsf94JCsLEtLs3byjUiUumOC6Ve59V7sRNcALqynNnz+wC31H\n+Rpb\r\n=r8+w\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCxNVRO0KwT37AtZzAgaEz6difOdghq2pD1fh3u6KZEjAIhAM7QkfW7a+vp3MP9kQ9qbTtJDtOXa4Q+9doGUAWTCClL"}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.16.0-canary.0c1ad726.0_1589330051128_0.7034208406899387"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.16.0-canary.8b6a4700.0":{"name":"@material/mwc-textfield","version":"0.16.0-canary.8b6a4700.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.2139200b3.0","@material/line-ripple":"=7.0.0-canary.2139200b3.0","@material/mwc-base":"0.16.0-canary.8b6a4700.0","@material/mwc-floating-label":"0.16.0-canary.8b6a4700.0","@material/mwc-icon":"0.16.0-canary.8b6a4700.0","@material/mwc-line-ripple":"0.16.0-canary.8b6a4700.0","@material/mwc-notched-outline":"0.16.0-canary.8b6a4700.0","@material/shape":"=7.0.0-canary.2139200b3.0","@material/textfield":"=7.0.0-canary.2139200b3.0","@material/theme":"=7.0.0-canary.2139200b3.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"268d44b68432688e310671d956cf5005633aef47","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/268d44b68432688e310671d956cf5005633aef47/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/268d44b68432688e310671d956cf5005633aef47/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/268d44b68432688e310671d956cf5005633aef47/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/268d44b68432688e310671d956cf5005633aef47/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/268d44b68432688e310671d956cf5005633aef47/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/268d44b68432688e310671d956cf5005633aef47/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/268d44b68432688e310671d956cf5005633aef47/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/268d44b68432688e310671d956cf5005633aef47/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/268d44b68432688e310671d956cf5005633aef47/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/268d44b68432688e310671d956cf5005633aef47/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/268d44b68432688e310671d956cf5005633aef47/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.16.0-canary.8b6a4700.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-jkrN39BmNduQuwEwk+ne0Ly41R9kWFnwqWRTvVvKNKzBsjrLSb1LtdRBdWSd66wzeTi3fbybDMZ5AgpWrbWvNg==","shasum":"3d2787bd44b6881daa875c8b8e62bd5df17b4c2d","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.16.0-canary.8b6a4700.0.tgz","fileCount":16,"unpackedSize":249903,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJevCwYCRA9TVsSAnZWagAAHOUQAJ66pafJk/m8VmoPCehi\n7ySw1Mku/WKDrnuuDJ6W8XNo57WEox1gVDn6gIxchHWDAvexcdnSeRa3iuaK\nYy5KXsUndsuRd2+sFbahR5e4guuik2Rz6ihv3RCJnKiANQIt3WJU4zXV/yoj\n/nPupLNbAV8Kl+KG2IxIT51R4pw+HGp1r7S+Lacf1I+oOGmoHabE/Fvvji9P\njAOmQLJEn/L1n6xLRo6r9ppfXGkOeLTdgSaryfVcN5AB1QwfVuzJmd0HeaPa\nI8CJMxWSYhENuEKkx/KQVMhoYMe+BvTpSkpsotQXK86LvaGNhR6/j7nhxTUr\naVOQdMp8/mpSKibAPUmY6d540TZ7R8M012cdDEOGmndh1IDZQBZe42xBNZUO\n+oQxdilLhL/k45PVSBM2zMz8E84Q+3nJeoZ9RS76uKTkq6LOA+ilIOmiDa1z\nCber98slZDwW9iV7CjpDvOGK0EuQhv5InzMpNfQM1lYq2wBoVhkWHi6g6LEN\nH1FI4x8uQfN2NlUJIJQwhyWoPhQxrL3A8R73y4828nG2sPbCzAJ7CH+8jbnP\ni6O3wy5VP8UHSz+eYsevtGaQii1aHXpPQst3CnrAF8CWURZlqDjA4dfRNJk+\nZGcdDzrwOpYZZyum4Ky7nFocHietgNz1m8msVBVGFEGKBLMzchDsIB1nvpXQ\n0p8h\r\n=ojG9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAmYXu45OvQS917oFnXL+0IJQmcHHP+YfKIfWzcT99lbAiEAwZLIowzBOeBvyuS3KOX/SHRMV9x7JjsaXtrOnJbbmKI="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.16.0-canary.8b6a4700.0_1589390360008_0.9704548190402791"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.16.0-canary.3270effb.0":{"name":"@material/mwc-textfield","version":"0.16.0-canary.3270effb.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.2139200b3.0","@material/line-ripple":"=7.0.0-canary.2139200b3.0","@material/mwc-base":"0.16.0-canary.3270effb.0","@material/mwc-floating-label":"0.16.0-canary.3270effb.0","@material/mwc-icon":"0.16.0-canary.3270effb.0","@material/mwc-line-ripple":"0.16.0-canary.3270effb.0","@material/mwc-notched-outline":"0.16.0-canary.3270effb.0","@material/shape":"=7.0.0-canary.2139200b3.0","@material/textfield":"=7.0.0-canary.2139200b3.0","@material/theme":"=7.0.0-canary.2139200b3.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"5c72bc76b8ddfb71726f9139d6105a4b108b7174","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5c72bc76b8ddfb71726f9139d6105a4b108b7174/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5c72bc76b8ddfb71726f9139d6105a4b108b7174/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5c72bc76b8ddfb71726f9139d6105a4b108b7174/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5c72bc76b8ddfb71726f9139d6105a4b108b7174/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5c72bc76b8ddfb71726f9139d6105a4b108b7174/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5c72bc76b8ddfb71726f9139d6105a4b108b7174/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5c72bc76b8ddfb71726f9139d6105a4b108b7174/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5c72bc76b8ddfb71726f9139d6105a4b108b7174/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5c72bc76b8ddfb71726f9139d6105a4b108b7174/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5c72bc76b8ddfb71726f9139d6105a4b108b7174/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5c72bc76b8ddfb71726f9139d6105a4b108b7174/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.16.0-canary.3270effb.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-m3s8KJC8RQoAJXG9NxJhKyng5uoafSxI4Nf2ChmqhEVC0hmtI5s5cfrCuWNMB5oa9KQdSIMea1v/lBVj5zGiGQ==","shasum":"83561b81cfce1b3abc9efed801d7eec8f9c89dd1","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.16.0-canary.3270effb.0.tgz","fileCount":16,"unpackedSize":249903,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJevGWTCRA9TVsSAnZWagAAhxwP/3DRGk59edK4tcEVd4C1\nRqWEHTkfo03ZzlUvRBJt967hD5sAi5vGb3hsLUuW2DLisniq6SYwuCKgMgks\ngqos7v28wq4ouN0+FGzJTT7rdpAiR9wvHJG0WpLOmjyKKdiN7a6UZD/nnsCL\nrvxtqRbwvCu35bmJLob+YmHoF41KCYcQ4vOWLJrnC+yXyaINhuz3zdxPUww6\nXw3alBcNe2FRm+B71UOxZQ3gVPO/PDUFn+6OBQjvMNl0kHarWMTKhr89KtAS\naWc/BW8HFmSbyOVwWzYuAjcxRLqsNmbwmmV8a45CUGfXgxOuzbPHJuJAmRDb\nsJ3UsK7WPGAwpbhoZKsCLovgX9LiL0rCUZx7z+GiCHl1rHDruTpcKzvLLZKg\nhGhDoDsNnKykqgUlvCU0ceCJxKuDD+N0R6cZVO2vFVCpgP4DLM5zExRe4sXX\nA3IY82ZHTnc9owbMxAS2cNL4IIJBBWoJABa+sn80VGYe5nZDy5RJpFLODHls\n9qxeKgw3OfyKFZRU7fxktz4OIyIQysQwIg67GMgjcGSAhU4S8ZqNKo3Umznq\nbrIbLNYdRhul+fmUpm/VKdgSe3LYgw0apkxjuyQFxG2mMkHywjrRMC4/s+ls\nbwSZc8aQ7UH2WUC/KHJf4gCPyHt1KO/LLTWQx4nG+cz0W38OY0z8wSM/ajVJ\nTwrl\r\n=tHoL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFYUy+rKRMKiQAB8onWbVoLtRaws4fePI7F9oAKz58qSAiEAyeJ4MJKpJvytooC5/67pa+HvajhmtIgqUiuIlmk7S4k="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.16.0-canary.3270effb.0_1589405075108_0.6417172270785063"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.16.0-canary.832e64f7.0":{"name":"@material/mwc-textfield","version":"0.16.0-canary.832e64f7.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.2139200b3.0","@material/line-ripple":"=7.0.0-canary.2139200b3.0","@material/mwc-base":"0.16.0-canary.832e64f7.0","@material/mwc-floating-label":"0.16.0-canary.832e64f7.0","@material/mwc-icon":"0.16.0-canary.832e64f7.0","@material/mwc-line-ripple":"0.16.0-canary.832e64f7.0","@material/mwc-notched-outline":"0.16.0-canary.832e64f7.0","@material/shape":"=7.0.0-canary.2139200b3.0","@material/textfield":"=7.0.0-canary.2139200b3.0","@material/theme":"=7.0.0-canary.2139200b3.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"27f7d1ac979b6af26982de92c2f2bb7fad00ccd1","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/27f7d1ac979b6af26982de92c2f2bb7fad00ccd1/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/27f7d1ac979b6af26982de92c2f2bb7fad00ccd1/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/27f7d1ac979b6af26982de92c2f2bb7fad00ccd1/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/27f7d1ac979b6af26982de92c2f2bb7fad00ccd1/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/27f7d1ac979b6af26982de92c2f2bb7fad00ccd1/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/27f7d1ac979b6af26982de92c2f2bb7fad00ccd1/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/27f7d1ac979b6af26982de92c2f2bb7fad00ccd1/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/27f7d1ac979b6af26982de92c2f2bb7fad00ccd1/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/27f7d1ac979b6af26982de92c2f2bb7fad00ccd1/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/27f7d1ac979b6af26982de92c2f2bb7fad00ccd1/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/27f7d1ac979b6af26982de92c2f2bb7fad00ccd1/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.16.0-canary.832e64f7.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-jm7I3f+YD8GsP9zFrt5AKnhfGevItTZe9clniFVV/z/Uc5PYRntGRXhztKii/DNg1cw9OQ6SzyhDV+AAro31VQ==","shasum":"906b8471f65dd9a32b9a8da50a7accdaa4b9d6a8","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.16.0-canary.832e64f7.0.tgz","fileCount":16,"unpackedSize":250809,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJevJY4CRA9TVsSAnZWagAAqQMQAKN8wMs7b+5QpfVSEFUV\n24Cpt1lrFJwwgVBqkpaAwllF28PqsYnyo9sBDkpk/8s0yJtPgpPWdLsfgGw/\nZs7rgfdbNUnmbCheT2B8ahfyn5n50EpXg7WKi4plU4m48dtN90uI3K2S1F4F\n90SQ+PRWfF0fdCNxFpqT8UUfUwGe7ogNHOltBxr5LZ7qwHwZv18yvTUMHGIX\n24zHIFz4zrfs+Dta2578MrYsszLd5rY/OHkj9Hd4qbQEPCZIrF9l0ByyLpIy\nme+Vqs+WyZMG0/zG9p5K9PhJMW178TyqSiYYfog0OZTD2IWED0tsMIX8QU/6\nRuPH+GNLRzzy/FRbcwEmXgC6/UCbeoFT1Y54R5h1GwKjgkeq1bb7VA/WtNgH\nGIMGrYGoQW3LGODDnKbBJk2PB5ijh2L1rMQqEkhCxaKDpuVUtz+Ism8mHykf\nkkYhsSiWpdODOCDmC5hbMnxynSXWwnO3u0A0+VFcJH2nfY2RAKSQ4RExmroj\nr8awD5mQttnC4V3pQ6FB5MFwIqgg5dn6hKs47iKnSYjWW0SF5+f6vOmy3ii7\nS++JszMeEnSgOjBWG7UhQD9UtOKQJrBZBMzxZtL/85qFZbwCZ0O+O1eUu400\nqLzM66AlFu77zw9Y7K0kcCwo4F+l25zj5h+Zw/lkoaRPLdGNzFREz2g4SVKi\nzg4S\r\n=y/lO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBpOUxfKMf4ztxg79b1Cy2Mv8rMi6vfxP0Mpius5JKLdAiA+YgeVVj9h/XwZTTxy+8EU+zmxWHyTJ862DuAxoY9Jpw=="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.16.0-canary.832e64f7.0_1589417527729_0.9550483083278687"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.16.0-canary.472fc4fc.0":{"name":"@material/mwc-textfield","version":"0.16.0-canary.472fc4fc.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.2139200b3.0","@material/line-ripple":"=7.0.0-canary.2139200b3.0","@material/mwc-base":"0.16.0-canary.472fc4fc.0","@material/mwc-floating-label":"0.16.0-canary.472fc4fc.0","@material/mwc-icon":"0.16.0-canary.472fc4fc.0","@material/mwc-line-ripple":"0.16.0-canary.472fc4fc.0","@material/mwc-notched-outline":"0.16.0-canary.472fc4fc.0","@material/shape":"=7.0.0-canary.2139200b3.0","@material/textfield":"=7.0.0-canary.2139200b3.0","@material/theme":"=7.0.0-canary.2139200b3.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"0eb6479ea05a7af0418b4fb939f915e39af03923","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0eb6479ea05a7af0418b4fb939f915e39af03923/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0eb6479ea05a7af0418b4fb939f915e39af03923/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0eb6479ea05a7af0418b4fb939f915e39af03923/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0eb6479ea05a7af0418b4fb939f915e39af03923/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0eb6479ea05a7af0418b4fb939f915e39af03923/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0eb6479ea05a7af0418b4fb939f915e39af03923/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0eb6479ea05a7af0418b4fb939f915e39af03923/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0eb6479ea05a7af0418b4fb939f915e39af03923/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0eb6479ea05a7af0418b4fb939f915e39af03923/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0eb6479ea05a7af0418b4fb939f915e39af03923/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0eb6479ea05a7af0418b4fb939f915e39af03923/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.16.0-canary.472fc4fc.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-QD5di5Ol/aQ+V4Ms8Gfv9JDneWNfn1LKHvQX0IaYlrWMZqFHF+eapl/VqGDAHfk3Si2RDE34ZJz+1ZG0xUnopw==","shasum":"0656e3755e42ea3fe33cf315fa7840ed784b0088","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.16.0-canary.472fc4fc.0.tgz","fileCount":16,"unpackedSize":250809,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJevLyzCRA9TVsSAnZWagAAB9cQAJoeZan/4DAJ9Q5VY+PL\nD3VuVXi6pFEPIpKeq2e4iSJ0KXbtUndH1JvddIHWrOYcywEFY4F/fo/9BUN9\n4Il5NU1jM7PVTNQiozoc9H0b8JYffyJEQNdyQ/vtfTDKK96Eev4c8Xoq2ctq\nhGkbvO14dqNf257Do9G1QtlRCOpolXWr3TiaT5TF29Y2RNYr+5TA9v9PH/6Y\ntrWu1vRz3heoDGEI/RO99bzZRfkkl/IRcVt4LnHY1rp/FQ2XQLMLRJT7djVg\ndoYupK1OSj8qeWDguwoU8ErgEWbKoUVDJJO0ABoHHIjJvwsrc1DgbJi2enUR\nH1qMjt4BJaQQ/Ik7I8vXezJhoK/9DR2iJUhn6RhqhocY9/FnTLwE3aUiifIz\n0eGz7nUayUtajIeBmjXgg076qozXVMWF7GEUU5p1mRYCatMo3d9DPdaa9AmL\ncAwi7qWbKxHcFGMMd+U8Pm/gw00ppwCAk/4FKvAfGnh7svRkvnGRuXatemCV\ngt8P9j3RVY99rb+ow4RZimVElNXY7TYB+SccQvyFKa+UI2YiFFARUj3Rq+aJ\nneqNoo/EkSk6TXJMduyaliWLuWXpm28rNdNtY9O9dK9Z7hZuG7hPAYDCDdHj\nFi3gXHy9hrsBE1Qn47LoBcnZMjIOQW7VYYqPsvVVRF/TPkjnlrWiJHqtx+Dt\nyIN2\r\n=kv7S\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEL1KlRDAHWf4Qr9EjDOGFMe99AsyHWx0qbUfqOBqUmpAiAkVVSGSZAUuDht7bC4I3sKyoGVJ5Wozfj7ZqwwaxnXZA=="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.16.0-canary.472fc4fc.0_1589427379273_0.23020628477687888"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.16.0-canary.4dcd7dd5.0":{"name":"@material/mwc-textfield","version":"0.16.0-canary.4dcd7dd5.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.ad0c0c103.0","@material/line-ripple":"=7.0.0-canary.ad0c0c103.0","@material/mwc-base":"0.16.0-canary.4dcd7dd5.0","@material/mwc-floating-label":"0.16.0-canary.4dcd7dd5.0","@material/mwc-icon":"0.16.0-canary.4dcd7dd5.0","@material/mwc-line-ripple":"0.16.0-canary.4dcd7dd5.0","@material/mwc-notched-outline":"0.16.0-canary.4dcd7dd5.0","@material/shape":"=7.0.0-canary.ad0c0c103.0","@material/textfield":"=7.0.0-canary.ad0c0c103.0","@material/theme":"=7.0.0-canary.ad0c0c103.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"a2b512eab44e739c09fa66cee4f0a65698e697f2","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a2b512eab44e739c09fa66cee4f0a65698e697f2/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a2b512eab44e739c09fa66cee4f0a65698e697f2/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a2b512eab44e739c09fa66cee4f0a65698e697f2/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a2b512eab44e739c09fa66cee4f0a65698e697f2/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a2b512eab44e739c09fa66cee4f0a65698e697f2/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a2b512eab44e739c09fa66cee4f0a65698e697f2/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a2b512eab44e739c09fa66cee4f0a65698e697f2/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a2b512eab44e739c09fa66cee4f0a65698e697f2/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a2b512eab44e739c09fa66cee4f0a65698e697f2/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a2b512eab44e739c09fa66cee4f0a65698e697f2/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a2b512eab44e739c09fa66cee4f0a65698e697f2/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.16.0-canary.4dcd7dd5.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-+N0A+J21aLQEX4tM89KHCNSY4hNKW4yjaiN8qZ3xDNNdljKj5EKuoWhQOChDca5D0dCr4lo8D80WlGc6+YjJew==","shasum":"889d9e4b6c612e34e4bec0c865e7a75fc4c518e7","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.16.0-canary.4dcd7dd5.0.tgz","fileCount":16,"unpackedSize":250809,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJevXDMCRA9TVsSAnZWagAACRIQAJLkLqjcYdqvBE+TMYcH\ngXEnk0R9IQNynw6oPebfmf4+TIfBWdLlu2srMeXBRhb2UYATQLz20GK9RNFh\ntclEy73EJyRtrmsp4PITeFJNy3SU3+YJR39c4rMQXS6M7FdKOBUYs7ZY+p+l\nvlTJlxkq4/h8Sw50V/IIwsTMLNfP7Y5nshjOM9jCcz2E3Ml4VdgSOsZm4V2P\nyn/JjwShox9ToXTGWSGIbmxnbAyOkU8PSBwDIwKl7wnMZSp1gzlC/XLZ9NZU\noAA4XY2xHD/2oqjY0GSx11Zuy5Dv3GnU7GtjBx6elxBrnb5eD76b1EJASGLg\nSED/lrl1ya6T0jX3KIS23WVQ7pXZFLU+Rw2u+Yv/KZjIey7/KD/Si1uNqMBm\n17z6p8RcLzI8D89uEECa3ZQztUGHocNW2E3N+5xPk9vqRs5SsFwAri73r9Tl\nmb9DVrSW3Na2GBki+j/7dW2C1iqMWPzZjg8Yq/X5istlzpJcXqeRnXgyzchl\nY+kRdmjJUrkuX/MQ8nk+TgPYVr8q38pBFYgjs6j2Lhmxmr5nTIulrVtPFg8G\nkxrW+loPgluYyH1XOGu8gZmA2bQr2Lm/p6u1pbWYnPmaiPvSyFZtv1IKfaFS\nLfSZH14DgmyOmsyi6/pRp53NJXBwgTWqV5sRhQ+pxV8L2y7PIiGPh8IqmnCs\niGaY\r\n=3By8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBQLWhIzY5eKLQ2H5beIrZOiE6fN+cbf49+iOl6xqZDfAiB5PK06w6XVPuD57jTP/JGW81eJuJ7n9qRHvQn5v3dr7Q=="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.16.0-canary.4dcd7dd5.0_1589473483767_0.38539817087840245"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.16.0-canary.bcd3400d.0":{"name":"@material/mwc-textfield","version":"0.16.0-canary.bcd3400d.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.ad0c0c103.0","@material/line-ripple":"=7.0.0-canary.ad0c0c103.0","@material/mwc-base":"0.16.0-canary.bcd3400d.0","@material/mwc-floating-label":"0.16.0-canary.bcd3400d.0","@material/mwc-icon":"0.16.0-canary.bcd3400d.0","@material/mwc-line-ripple":"0.16.0-canary.bcd3400d.0","@material/mwc-notched-outline":"0.16.0-canary.bcd3400d.0","@material/shape":"=7.0.0-canary.ad0c0c103.0","@material/textfield":"=7.0.0-canary.ad0c0c103.0","@material/theme":"=7.0.0-canary.ad0c0c103.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"dad5f0740d5be7e0efe9c5037afabbec57771668","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/dad5f0740d5be7e0efe9c5037afabbec57771668/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/dad5f0740d5be7e0efe9c5037afabbec57771668/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/dad5f0740d5be7e0efe9c5037afabbec57771668/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/dad5f0740d5be7e0efe9c5037afabbec57771668/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/dad5f0740d5be7e0efe9c5037afabbec57771668/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/dad5f0740d5be7e0efe9c5037afabbec57771668/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/dad5f0740d5be7e0efe9c5037afabbec57771668/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/dad5f0740d5be7e0efe9c5037afabbec57771668/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/dad5f0740d5be7e0efe9c5037afabbec57771668/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/dad5f0740d5be7e0efe9c5037afabbec57771668/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/dad5f0740d5be7e0efe9c5037afabbec57771668/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.16.0-canary.bcd3400d.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-YqY1I3yHNQhCpDqNou4gyQMHHLn1oCZpFhJ8gncZxma2Fv/hoqWr0JZ3UPAuYUI2VT0CbDREzlzdKb9YcdPDEw==","shasum":"42e0778145d599b32adcef99a62bac98fb4f88e2","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.16.0-canary.bcd3400d.0.tgz","fileCount":16,"unpackedSize":251787,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJevxyMCRA9TVsSAnZWagAAI3gP/1lXN/pEO0ZbgsZ5y152\nu/dfiVNZYZT3NglU/afvELdFd3rGUTcpcBZB0w/9BO2jmUeM68D/KEX0Qyc6\n2vnolrHDovbCohJ2ak7aAw8Lpiev2XuRr9L7QJ73Gxfv4MgQFM/Vv1Ac1cMM\nAghfbmFh2DlGp2hzngTmQW4RLwT+K62nanScu6XbCniEB77NO+Ppo85Ufc5p\nqNWj8oiRB2K0G9fq26+xlQ3/q/cx04eYzrjdpPtOg2h1gE2bDcM5mh4Ro6lL\nl88L+wI1WYGIyEUTvxEzSnJUJOs92V3miNDNhep3P4IjliNi1atu9sAh1H1g\n2lceZN2iKtnzf3l3PM4T4O0UDT+7uZ50WryNW72D1Du8/CEp7X9g8y2JHcPp\nTa5SpuBTUgsguHKu+tC3wgtLTfySO5LX42SgTl8QfpdWwUjUGOns4O5tZoRE\nRpI4Xy5F0vAnCI94+kiN4VPBjGcZaXOvlw1ERbzhw4zaOfN3ZX4hVmXXnJU6\ncxI6N3GHIYZ0TppuJcqUh+HXwjdgApoS6afp690Mef1xmn1Ea+kqKuWlD0QI\nKWIxY+1osALUy2bsN2PndcHajmwZGXCXmj8zuPFPRWk/PO3HdY1pA+5VC8Tq\nGbkgVHKCpPxgFrmOI2NPm4JtT0MRstKjKJHiejzX5hcSXMg+HPJ700zMQCGv\ncrx0\r\n=gqGJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC5WVoenzP9TPbMN3BsMV55uGWvdpfJxjLrrnwAHjXi+AiEAlM1DH6s10AYpqvvMLvvtiEHhLxBPucmVtYO2Aoc2wrY="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.16.0-canary.bcd3400d.0_1589582988403_0.5373890988483763"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.16.0-canary.91f63179.0":{"name":"@material/mwc-textfield","version":"0.16.0-canary.91f63179.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.ad0c0c103.0","@material/line-ripple":"=7.0.0-canary.ad0c0c103.0","@material/mwc-base":"0.16.0-canary.91f63179.0","@material/mwc-floating-label":"0.16.0-canary.91f63179.0","@material/mwc-icon":"0.16.0-canary.91f63179.0","@material/mwc-line-ripple":"0.16.0-canary.91f63179.0","@material/mwc-notched-outline":"0.16.0-canary.91f63179.0","@material/shape":"=7.0.0-canary.ad0c0c103.0","@material/textfield":"=7.0.0-canary.ad0c0c103.0","@material/theme":"=7.0.0-canary.ad0c0c103.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"0e5622d76bebf9f0f121549fb3dfc9bce15378d5","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0e5622d76bebf9f0f121549fb3dfc9bce15378d5/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0e5622d76bebf9f0f121549fb3dfc9bce15378d5/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0e5622d76bebf9f0f121549fb3dfc9bce15378d5/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0e5622d76bebf9f0f121549fb3dfc9bce15378d5/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0e5622d76bebf9f0f121549fb3dfc9bce15378d5/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0e5622d76bebf9f0f121549fb3dfc9bce15378d5/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0e5622d76bebf9f0f121549fb3dfc9bce15378d5/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0e5622d76bebf9f0f121549fb3dfc9bce15378d5/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0e5622d76bebf9f0f121549fb3dfc9bce15378d5/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0e5622d76bebf9f0f121549fb3dfc9bce15378d5/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0e5622d76bebf9f0f121549fb3dfc9bce15378d5/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.16.0-canary.91f63179.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-3uB+Pc6MLxsPfTSWbEdY56sYekL5+XW34RaZlkpQQGglt8t92FiltUoukboVpFLoln2dj1NbGZr0Unq8Nhc9/w==","shasum":"66c24baae68c55e205239b62b242be31e1b99f11","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.16.0-canary.91f63179.0.tgz","fileCount":16,"unpackedSize":251787,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJevzUVCRA9TVsSAnZWagAAoy0QAIOLp+XXu7iynBqnYlcT\nnFbcWe22ko2HB8YZw+TX+ZUQLEWad9061d+fLdo1fdOkiTCGlWZ/rbxXQzsK\n+Y4c4AvBqmgMqCHskpcUcO2Fldb2TwLRPeR1Wqd7pgaQYnFf5Or2cEM/blLK\nYFc/rfudRnX7mGVSJJTgRF1njjhxK9Em7VlqkBlCVpc0YloLNu3UocRDWx4S\nQc39dj6ScKiNFUesnT1kwoi/TOe81v5wH6aO2W47NyhlfaPcxng1EbCCx76s\n483HtixhpOQr+fq0wf24o+t24lDVedP896TcKWfNC0gNIQ61CnhE5tYZk9EO\nTnmyTaoUXagPECXOHtxWsAXKXA5i7thgC23iO5lc+kqccQ/ab+Jkgk2GPvCj\nkYgNO/E/g/QJ2cdwLCWGWWfc50umYrim9jsN+z8s1pY3mTuuVc1p24VvS44o\nLbxfVXbIdA2Hkk4ja0HVxgaFH/qRbkUTW4dMUY/8HEq2HHnAsQ14n/w8mzwb\na+HOdpowA5nmXDGJgh641QLylxQqvxRe0213Vf7ZVqoX3E23fWVmlsiSzZf8\nrzw68/nLfWpEZsLMOrcV4N54l4A1bWOlCli912I8p35Dj8g0SzmewGu8kuu9\nscaGuZuFuoHCHIWbdjCWQ5K1zfeecztSB9E7RG2Pf4XuD0Sa6RAfuGwDUGNh\ntQ/g\r\n=bAJE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCPNHxjmAoheNUZK41yxTerUAv2WXKkYe7mBuTsRb4nUwIhAIgQcSmF8uxrBSmbL/+FFfVfqiDM4BP9n8bvK2ejYsRp"}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.16.0-canary.91f63179.0_1589589269265_0.3580665070801561"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.16.0-canary.b8aafb56.0":{"name":"@material/mwc-textfield","version":"0.16.0-canary.b8aafb56.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.fd8f8f2b7.0","@material/line-ripple":"=7.0.0-canary.fd8f8f2b7.0","@material/mwc-base":"0.16.0-canary.b8aafb56.0","@material/mwc-floating-label":"0.16.0-canary.b8aafb56.0","@material/mwc-icon":"0.16.0-canary.b8aafb56.0","@material/mwc-line-ripple":"0.16.0-canary.b8aafb56.0","@material/mwc-notched-outline":"0.16.0-canary.b8aafb56.0","@material/shape":"=7.0.0-canary.fd8f8f2b7.0","@material/textfield":"=7.0.0-canary.fd8f8f2b7.0","@material/theme":"=7.0.0-canary.fd8f8f2b7.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"cb4a37dbb03476df8ec3422cb9bff794468ad220","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cb4a37dbb03476df8ec3422cb9bff794468ad220/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cb4a37dbb03476df8ec3422cb9bff794468ad220/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cb4a37dbb03476df8ec3422cb9bff794468ad220/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cb4a37dbb03476df8ec3422cb9bff794468ad220/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cb4a37dbb03476df8ec3422cb9bff794468ad220/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cb4a37dbb03476df8ec3422cb9bff794468ad220/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cb4a37dbb03476df8ec3422cb9bff794468ad220/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cb4a37dbb03476df8ec3422cb9bff794468ad220/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cb4a37dbb03476df8ec3422cb9bff794468ad220/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cb4a37dbb03476df8ec3422cb9bff794468ad220/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cb4a37dbb03476df8ec3422cb9bff794468ad220/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.16.0-canary.b8aafb56.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-6pKP3W8AHRdFcJlMQU0YWQ6k7Qb9Qcrew94C9FFyo/ZZYgDPeTETxB01UNbNVYaaaEvDzCpgbTvN5U+9njYxbQ==","shasum":"5c9c393533b151b600bafb2b3b97b907d9e92353","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.16.0-canary.b8aafb56.0.tgz","fileCount":16,"unpackedSize":251787,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJewtSHCRA9TVsSAnZWagAAUBwP/2fovSySbrIT88QqkJPP\n6Lh13K0VrieMu7haMRQsd6ppcfuHOahdFlNXloAfWt6b+6FCx2ZLpLHKNM3U\nO9gqhWoW+ziEpGChIeADYOk2IbDN5fKxRn47yyiOUyr8W7NhHll3IaHQCMBG\nYWxBu/5nr1zNmDwGYedUaYO3jMb0Nqej8XTFNHJkuxC006UTqemjoFUKMjv/\nit2Cg3E2KVStK2Ryr4DPm3fOhLJM42nvLNiobbXjsfdfISP0tLC9IA0oYyxa\nvW8WRb4TB10YYddwSyynxOA6mAQivhHPvThbWUv18tsNcBw5ezRwPcYOqZ7L\nGgOoNZdnQU8vkuNyWWakGoXP14CdzoFUfgqm3MtedCfgNapiKur4ERTZm04d\nlUi6uFcnWFjMw+8ir6U1RVVYxoX80Dafj4Ml9i4RoFmDDKaWjPogbxqbMB5B\n+7Tzz0okWjw1GnF3mw/H1ezH94Kkw+P7s4H2ZE+b2LOFDVOyHVF8tC8RcFKx\nek+w5GU+vr5hquLY6sWTatDPbWOTHN+DL71dEHaIIMgXsMKU4bFa0zTbBBsG\nTci0ojInmAgB+qLsjK0KTTudJc+Wusqw4rWy2uUG5I+dyZ1SSkCOBV6En/cF\nr5cL8JUdQdwCHsJHOFVMvJvT0WWwXIeg8Ph2rELie/U8O7kXmOcA2zBPpHkB\nxML4\r\n=z18a\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDPvp+GGNlDq8e8oVARAFwkD77PlZG0TnW21hx5dH0lhQIgSDpxYJ3I/7Y/VIVLpDWFvuNRMNVwHR0Ukn7oSgiAzAU="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.16.0-canary.b8aafb56.0_1589826694470_0.9203753338098233"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.16.0-canary.a564b194.0":{"name":"@material/mwc-textfield","version":"0.16.0-canary.a564b194.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.730920fbb.0","@material/line-ripple":"=7.0.0-canary.730920fbb.0","@material/mwc-base":"0.16.0-canary.a564b194.0","@material/mwc-floating-label":"0.16.0-canary.a564b194.0","@material/mwc-icon":"0.16.0-canary.a564b194.0","@material/mwc-line-ripple":"0.16.0-canary.a564b194.0","@material/mwc-notched-outline":"0.16.0-canary.a564b194.0","@material/shape":"=7.0.0-canary.730920fbb.0","@material/textfield":"=7.0.0-canary.730920fbb.0","@material/theme":"=7.0.0-canary.730920fbb.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"88e988925ffe167fc3916968d88a99b85d5f0319","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/88e988925ffe167fc3916968d88a99b85d5f0319/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/88e988925ffe167fc3916968d88a99b85d5f0319/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/88e988925ffe167fc3916968d88a99b85d5f0319/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/88e988925ffe167fc3916968d88a99b85d5f0319/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/88e988925ffe167fc3916968d88a99b85d5f0319/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/88e988925ffe167fc3916968d88a99b85d5f0319/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/88e988925ffe167fc3916968d88a99b85d5f0319/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/88e988925ffe167fc3916968d88a99b85d5f0319/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/88e988925ffe167fc3916968d88a99b85d5f0319/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/88e988925ffe167fc3916968d88a99b85d5f0319/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/88e988925ffe167fc3916968d88a99b85d5f0319/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.16.0-canary.a564b194.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-+w22PUyH5/JUIdllXEgF6Q31IIQLNvWCexU0A2HPHXSWcR7zIgOW6m6vEHf2VlCsQzlwbw+GrSLhXRLTvaz/mw==","shasum":"a3ea7db7a4c7566b3a3aeda817edc7a53fbe55a9","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.16.0-canary.a564b194.0.tgz","fileCount":16,"unpackedSize":251787,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJewxRDCRA9TVsSAnZWagAA2uMQAKQ/dhST/6DMZuaoJBc3\nhuaJq/hWNJJKif8bMed+h/sYyFdqT3TNNLM1gTYL6YR59C3FcUOzBMsWKGCV\nnO5eveZoMalQk/DtaDnR38IK5DzKkslL7g5j7NHvrWpef/L2SDpcq5b00bIt\nDjDfUNCUGA9F0dUzL3+HK/QnRpMmXOqMXFLzs3kAzkmxy0ipU1Ot0VQRRdb2\n52RCBZNTOj4FXq+NfK2IZQkGbmAnIy2hIquMctFbQQlSgLB7204S1h+ZctzT\nY2nLk846S9eMNmnYhbAHn8uC7uX2e8ykKV12Emuik3DD/uUXkDTgx7yob0ru\neZgm2kR99AUHAJ87Dc9vm5WzGYs3YCXhUSR1RvqsQUip5UDA6Ag4vHjncN2j\nI4hy8AYUg4pWKYsT5Q6WEKFIMeQETPo6DnMiR0aFpIGEnT4A51kLUSEuHQJP\n9Ad2nC/JGbAYnvIzodmDlLNFC5LseqB7iqGYnFb/q2behV8wG7QjeF8LdKvE\nFEfnNHbTphfWOCovbq9UtQwPAIKcfoajTAo3lunbiDAzcsvDxGrWhmkQVmXk\nIf76TejlDk9ZFNAmYGFhtlT7MkMolUzW5ggmWtjOrnIWySKSGVBMA8HgHpjo\nIEEAhFMtXB8UFB6gaehwbkxuTF9f0Foi1TJwngwE64QHmhVVS7/TOtMDtQqp\nkl3l\r\n=V7Gd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCaH8JhSFRBHAIwvSuVVc7p6yyGA/fFZUMeBuUZ0E6lpAIgGJSIZgzIumkqV5opIwBhpaBZ8PBRm8cw0qRGTmytr7o="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.16.0-canary.a564b194.0_1589843011049_0.23645147601267724"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.16.0-canary.ef56465b.0":{"name":"@material/mwc-textfield","version":"0.16.0-canary.ef56465b.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.730920fbb.0","@material/line-ripple":"=7.0.0-canary.730920fbb.0","@material/mwc-base":"0.16.0-canary.ef56465b.0","@material/mwc-floating-label":"0.16.0-canary.ef56465b.0","@material/mwc-icon":"0.16.0-canary.ef56465b.0","@material/mwc-line-ripple":"0.16.0-canary.ef56465b.0","@material/mwc-notched-outline":"0.16.0-canary.ef56465b.0","@material/shape":"=7.0.0-canary.730920fbb.0","@material/textfield":"=7.0.0-canary.730920fbb.0","@material/theme":"=7.0.0-canary.730920fbb.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"ebf59585445179b39ed7a77dac598972ce48066b","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ebf59585445179b39ed7a77dac598972ce48066b/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ebf59585445179b39ed7a77dac598972ce48066b/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ebf59585445179b39ed7a77dac598972ce48066b/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ebf59585445179b39ed7a77dac598972ce48066b/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ebf59585445179b39ed7a77dac598972ce48066b/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ebf59585445179b39ed7a77dac598972ce48066b/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ebf59585445179b39ed7a77dac598972ce48066b/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ebf59585445179b39ed7a77dac598972ce48066b/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ebf59585445179b39ed7a77dac598972ce48066b/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ebf59585445179b39ed7a77dac598972ce48066b/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ebf59585445179b39ed7a77dac598972ce48066b/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.16.0-canary.ef56465b.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-oEX07awaTVMgYtdaE6ojRTUAqfg9fOIsuAjWc6CPNcKfr8EX4nQYZDp/Vu75y7hmQkZywwZYduT8BnRkHTwdzQ==","shasum":"66325969d72f71f82ba603950b6d0cce03f07c1a","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.16.0-canary.ef56465b.0.tgz","fileCount":16,"unpackedSize":251655,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJew1b1CRA9TVsSAnZWagAAfr4P/iUOTrXOSBut+qFf8hxy\nLL22YFWPZp5rL0GQCYqc7Db3PR9MJuHVD1K+bEtk19ekL2uEzrioJxXXTcPu\nzCSCTFSfcdfNufH74Y6fKsjcGGmUU6fp+yhTdIh9XiQm4oaPEsRwPQVVSLNm\nBaggzMtmrMxAPrxT0reDAKvYL0E2/zVGPgC6LkhHxbPEbLMh4pW1M35QMKKQ\nAPNecfO+kPqR/FljyO258ZGcW2npepZR74vkcqh7aUEmjfcW3cw9moY1hMPs\nbUcgL7miuh2aZCHOtEFi9yZxkpiiV8Myb95bmu2ZXs2OEUVyiStsdeIWydq9\nUeSxS4aCBKqCVxTeA0fzN/mIvKA0HNC3+NWlmEvgwSftPBQSB0j0kQX9/z+z\nM3y24kbsXsbBk6vkSKFcsWE3GGr1R3DnC2igoJT2dlzHJCmosWBcwLKmNvA+\nMv7oZch9MhL1iE2zVq05/6VDsIxWRh5E7kTRVmFM9eaNqAb8ZrSa+LTC1uGm\ncIp2DAtJrQdm1yrIRq1iHw5SBdJiqpMo3NJb5/Y/wQmKqEA9zC8PV6SttHHg\n8Q4X8h4nOTr4Xy/8D4wbKdp9OVBRd9jfjgMoRHYXvtqZQcusrf2/vIJYYuMI\ns1L7ZuPU7uu6U6hWvBkRSrg6+7LVrXoZKcq7NLmdvIej0Sc1Mu7+8SfWT3LY\ncJ4k\r\n=a2MM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD7cBzs2lEHO0a4U2/sGGsLkcU8LMov/WXHUNUkVbJ9oAIgXa8r202K0rS/qnrWPcnyZhCsOYwKuVw+Jg2eG/w6KaY="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.16.0-canary.ef56465b.0_1589860084316_0.01548134181123939"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.16.0-canary.c22dcd71.0":{"name":"@material/mwc-textfield","version":"0.16.0-canary.c22dcd71.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.4497b86ed.0","@material/line-ripple":"=7.0.0-canary.4497b86ed.0","@material/mwc-base":"0.16.0-canary.c22dcd71.0","@material/mwc-floating-label":"0.16.0-canary.c22dcd71.0","@material/mwc-icon":"0.16.0-canary.c22dcd71.0","@material/mwc-line-ripple":"0.16.0-canary.c22dcd71.0","@material/mwc-notched-outline":"0.16.0-canary.c22dcd71.0","@material/shape":"=7.0.0-canary.4497b86ed.0","@material/textfield":"=7.0.0-canary.4497b86ed.0","@material/theme":"=7.0.0-canary.4497b86ed.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"6a706d54228a517263b38bfc1185c9ebac4aae41","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6a706d54228a517263b38bfc1185c9ebac4aae41/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6a706d54228a517263b38bfc1185c9ebac4aae41/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6a706d54228a517263b38bfc1185c9ebac4aae41/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6a706d54228a517263b38bfc1185c9ebac4aae41/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6a706d54228a517263b38bfc1185c9ebac4aae41/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6a706d54228a517263b38bfc1185c9ebac4aae41/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6a706d54228a517263b38bfc1185c9ebac4aae41/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6a706d54228a517263b38bfc1185c9ebac4aae41/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6a706d54228a517263b38bfc1185c9ebac4aae41/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6a706d54228a517263b38bfc1185c9ebac4aae41/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6a706d54228a517263b38bfc1185c9ebac4aae41/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.16.0-canary.c22dcd71.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-+NQj43e7sHMyC9NUUKF/zd/TkPI0S6N1rM+d5bdTyjHRD5tZSzo8T8HVwI0gP3Z3k72gXpr0AQvXz7o9uXTw0Q==","shasum":"e13d23290d82d65558eb0eb8ab8d5d4522a2513e","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.16.0-canary.c22dcd71.0.tgz","fileCount":16,"unpackedSize":255660,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexBY/CRA9TVsSAnZWagAAqc4QAI6k01fLDS0ac/Uz9Sel\nZ3FYejDf9LJliFyoaEKLELOGA54Ym7WqO6ROImR9I61UEEpTX6ZnORFGEPsH\nkiaz7f/wonMHoHJKIbirwlNUIIH5sPMzZXO4LDLGLJS8rxKivtAVnHAqzfWL\nYQT9joptWNtGyfly/bvVafghn3Qb5gKj4zGEg6u2zR7vMDGKz7x3LqEFoxkF\ny8McQDXJ7aPObxlzHlwZqs0SjgwdCgX8kJx+sb0xB4wekiv7q+e33/nydZYE\n8qTUw44kkkntW0g0cd0ema3jYq+aqoscO6rxgsQjYDEfM8rehDuvLNrjtFq2\nlsPXaTPEq5nWkBOjbbutK0Nf2Po7BJhOrdpHlOU53YGxnQE4mCqV4rZKPIQ7\nq1RSbruImIaaAKnZt2C2CQBHPOSXC2QNXgwTw8kg49YMb/nARzIVZREM23El\nJHvDcCJrkVFRKLrVWYJIXLVb7d4sI0r2A9NZLHUBoUgbVXj2YOcIJ1JQ7sQN\n7HyltLSD6RzudVrufXhcm+2O+g+hNEahuAC1cyXWyoQ8q/AzS9Yx9MkJLtLF\nWZTSkb/OFrotKqh3ECmlPnhWpGBIwzf/WzFBbDg9qTLIuSer9ADwV+a6OrO8\nbZkEQ7CF21HHOgGxmhFd7sA8f+kbxf2herDY8kmhEdBpRKSaWicHxMmVvg4B\n7ufv\r\n=vpCs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCzvTGaeHayKOXHvR+qZFb1xkXcB5jgKq7HpzC2CUKSNAIgNP8dyf3sKCTui0RoVmb34mmVdfpihk0Ki5gmot5QvF8="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.16.0-canary.c22dcd71.0_1589909054666_0.6722476301970215"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.16.0-canary.6eb62388.0":{"name":"@material/mwc-textfield","version":"0.16.0-canary.6eb62388.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.e3eacefcc.0","@material/line-ripple":"=7.0.0-canary.e3eacefcc.0","@material/mwc-base":"0.16.0-canary.6eb62388.0","@material/mwc-floating-label":"0.16.0-canary.6eb62388.0","@material/mwc-icon":"0.16.0-canary.6eb62388.0","@material/mwc-line-ripple":"0.16.0-canary.6eb62388.0","@material/mwc-notched-outline":"0.16.0-canary.6eb62388.0","@material/shape":"=7.0.0-canary.e3eacefcc.0","@material/textfield":"=7.0.0-canary.e3eacefcc.0","@material/theme":"=7.0.0-canary.e3eacefcc.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"abe9e974102de52260c3cc1347abe8592e0d5e7d","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/abe9e974102de52260c3cc1347abe8592e0d5e7d/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/abe9e974102de52260c3cc1347abe8592e0d5e7d/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/abe9e974102de52260c3cc1347abe8592e0d5e7d/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/abe9e974102de52260c3cc1347abe8592e0d5e7d/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/abe9e974102de52260c3cc1347abe8592e0d5e7d/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/abe9e974102de52260c3cc1347abe8592e0d5e7d/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/abe9e974102de52260c3cc1347abe8592e0d5e7d/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/abe9e974102de52260c3cc1347abe8592e0d5e7d/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/abe9e974102de52260c3cc1347abe8592e0d5e7d/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/abe9e974102de52260c3cc1347abe8592e0d5e7d/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/abe9e974102de52260c3cc1347abe8592e0d5e7d/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.16.0-canary.6eb62388.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-BR80EvFbSAocXb2UKb33z8CP6qiGTITVlLtCZszi50Eq724knBlMIoaIUXQmNZo1uDzD0NrYSvSoKmWGKGJHAQ==","shasum":"7a72bfa39e89e7d3b66f31c6909f9ee428bdc8bb","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.16.0-canary.6eb62388.0.tgz","fileCount":16,"unpackedSize":255660,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexEO+CRA9TVsSAnZWagAAa7oP/jZWki02a9H0HHdM4w0S\nHII1/oYXC53M30D2lJobEogwob/GQMhu1bZy8MrF/Mxt/lMt7beXwzmeEB/9\nrFprqwNGdmJIwzV6uaI0AlKaBWzLpkKA2PPEXOTQO8kxeFZLkuxnIVTBbL3N\nOaP0rYwdd5FSXSdX7AmWKyNhYm+F93y1dQ/w2C/Q7LtWvZhoiWed3kxgy2CX\nG7hQ1Ba9HVTdmhmzkUZianKUlHD03hVJxVigO9SXKH/U3qtihO7dZSgNie78\nLlQIk4fi8O/l0gQUzmhMcD+Q9CArsrtxs8tY84sxN1uoyKX6rfO8HKzillWI\nvZh1BVa2By95+P94+vzVVKAcZtX0g6wT3ME6N//1HNKXUipGTmHKFbEFKEAU\nK2TlnnKy1YkcqatVSIIlC1A+HaJzNtxVMdU0QqohY0TnFcrfUooUhAt+vsRK\n0VRigJdlPZzpjOh+CtlfcT8lCZgnTqjCzfG5I1tekB5wUemJMmqgGgliSSuS\n6sp0EZUqbaH9ZTZGF7oOyt5Q4qX/ozzLrOhBoaxIFLck5X4JWRp78SH9xYXJ\n91vYDjyLz9JpwzkuaN+xyx4GyZgqlvl3dVJcAClnF7XYdOmR9HELBaJPGo3+\nbBY9CpT91M3aj1GD7qJX8h09CJQXH7p0SBOkKFrMUSTu42uhQM2hOTpImwRb\nJna2\r\n=Uneb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCrG3XENsDlP6OajnRDoYMlucfSTUvFjlZj46j5jd1PSQIgahi2Vg3iLt/EyhhYU6xQ7Icb3hvMlcBxTOP18khJUXc="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.16.0-canary.6eb62388.0_1589920701792_0.1312318179654437"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.16.0-canary.9bc3230c.0":{"name":"@material/mwc-textfield","version":"0.16.0-canary.9bc3230c.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.e3eacefcc.0","@material/line-ripple":"=7.0.0-canary.e3eacefcc.0","@material/mwc-base":"0.16.0-canary.9bc3230c.0","@material/mwc-floating-label":"0.16.0-canary.9bc3230c.0","@material/mwc-icon":"0.16.0-canary.9bc3230c.0","@material/mwc-line-ripple":"0.16.0-canary.9bc3230c.0","@material/mwc-notched-outline":"0.16.0-canary.9bc3230c.0","@material/shape":"=7.0.0-canary.e3eacefcc.0","@material/textfield":"=7.0.0-canary.e3eacefcc.0","@material/theme":"=7.0.0-canary.e3eacefcc.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"f02ad2a44567ccdf91e52b6e07f5986d49d2b375","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f02ad2a44567ccdf91e52b6e07f5986d49d2b375/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f02ad2a44567ccdf91e52b6e07f5986d49d2b375/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f02ad2a44567ccdf91e52b6e07f5986d49d2b375/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f02ad2a44567ccdf91e52b6e07f5986d49d2b375/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f02ad2a44567ccdf91e52b6e07f5986d49d2b375/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f02ad2a44567ccdf91e52b6e07f5986d49d2b375/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f02ad2a44567ccdf91e52b6e07f5986d49d2b375/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f02ad2a44567ccdf91e52b6e07f5986d49d2b375/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f02ad2a44567ccdf91e52b6e07f5986d49d2b375/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f02ad2a44567ccdf91e52b6e07f5986d49d2b375/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f02ad2a44567ccdf91e52b6e07f5986d49d2b375/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.16.0-canary.9bc3230c.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-lEi58V76qTSoYUeYflMGw12FDAeA3O1T77uNnz9tlQrRPfP0D+yXbBjllOvP9G5Lut77Psh9TmA7dwbmj36Umg==","shasum":"7b9663136f08b284914d850e9cfb48231cb0c261","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.16.0-canary.9bc3230c.0.tgz","fileCount":16,"unpackedSize":255660,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexFHZCRA9TVsSAnZWagAAmLIP/3tUt76MTOH/FdE+kWok\nD0nHUx1KGnQiqPAEzcFOlYJAO/OXmc+WPAEGGE2j5lyCbhJ9aXkXzJNn02x0\nrQdvu04HJX0WVU9w+wERgBEeOBlHTF61+rlI+TqrsQEbRGCste8+RAZAlN9K\ngduPaQkGSv4LXcPEej7OMe+T9BwruS17bjtFwjEDzx6zZxQRJnkWnsBlQON1\nGsSh7tKzn9hlXXWFyDLkFI4wmoXYNMfjnXQGETUHNGPDuSSF1zWoVaD5I56n\nvdW3SIIym8IlFP5xjgwEt+UOWMmLO/DHQD3AvfQjAATgTbwnK5zXsWTnpFs+\nJ7+gJoP/RdEs3fXtYsZetJwkLaS2c5K2xl/AX90e/UB5GLw7MfLVOOnjk9Fb\npk1Ga+lwVn3o4Rgqfzlr9Kvdgnc0hGc9Thh9/5YMgvuiJfIK8wCMAysrJLTO\nj5jCcho9Fh0enqzO46ByVOdTK309YSLp0ePbqCgDY1hcnoAx84J8LbmmvQvD\nAgWZncZ72THK9DhGg7TgYTawJWLazgmJF20lzFYkl8Oplsqe1j97BIc4Op/e\nIwIbkiKZpedzVGN7j0Z4c29XQ1n62b+Xi9oR64N5V8QdGfajz8zl50FyYs3L\nCqqMmytoVIp/lGyXIGd8Ao1/+UAraTfcC1U2cj56/waW6hozQjOQ4oUfMxeF\n4noo\r\n=dJtt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCy9GsuZa5rq8XcQbsKm6+/2gvH4amjnWluFFOWSYC09gIgcatBHL/qRjPL8LR9ZDQ4mQmQD5qtt7f4xsCSHIpYunM="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.16.0-canary.9bc3230c.0_1589924312729_0.39888218310573653"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.16.0-canary.421a6856.0":{"name":"@material/mwc-textfield","version":"0.16.0-canary.421a6856.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.e3eacefcc.0","@material/line-ripple":"=7.0.0-canary.e3eacefcc.0","@material/mwc-base":"0.16.0-canary.421a6856.0","@material/mwc-floating-label":"0.16.0-canary.421a6856.0","@material/mwc-icon":"0.16.0-canary.421a6856.0","@material/mwc-line-ripple":"0.16.0-canary.421a6856.0","@material/mwc-notched-outline":"0.16.0-canary.421a6856.0","@material/shape":"=7.0.0-canary.e3eacefcc.0","@material/textfield":"=7.0.0-canary.e3eacefcc.0","@material/theme":"=7.0.0-canary.e3eacefcc.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"caa535baf074d026cb6a6f50dad38341320274de","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/caa535baf074d026cb6a6f50dad38341320274de/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/caa535baf074d026cb6a6f50dad38341320274de/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/caa535baf074d026cb6a6f50dad38341320274de/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/caa535baf074d026cb6a6f50dad38341320274de/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/caa535baf074d026cb6a6f50dad38341320274de/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/caa535baf074d026cb6a6f50dad38341320274de/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/caa535baf074d026cb6a6f50dad38341320274de/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/caa535baf074d026cb6a6f50dad38341320274de/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/caa535baf074d026cb6a6f50dad38341320274de/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/caa535baf074d026cb6a6f50dad38341320274de/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/caa535baf074d026cb6a6f50dad38341320274de/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.16.0-canary.421a6856.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-7jgGCI9W83NcCmW9A4cpuYiLlxfaTObTGClFFBFvPMEPnV2RZ47ltcP23qgm0bnlHVosQ3/CGKtYOYaLOxhybQ==","shasum":"5ea44b9ae76b089970f17569166dc7e2cc30a6be","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.16.0-canary.421a6856.0.tgz","fileCount":16,"unpackedSize":255660,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexL79CRA9TVsSAnZWagAA104P/2iqd6oSVS81jBICj724\nj53hKEzDBhKxKIkQOwioGsjHIDcbQHuh0q6GqBhYM6Z/83Cr3lZrcnOXMmJ4\nTSyOsBr1kzDkWRpuAp8K/wjRIiama1rOz5VZ7WFWIuRdKN2UuL6rLdTfW28a\n5YfWNaUNWJN2i/7EpCvX0CL9Kgv5AnIPlKbhQjuJPmvGeBPXgfU0JbMi+5Al\nPgq742AvDkcZ7vb6ivjjialL0q3sAEUYpq+dVKxr/sT6V9SqOeqBCMzHlGxy\nqLm5hkuOIjZal5LNPxVck9hXG4MI0sGUxHE4EIbQhgPrJf5oaCda1gXzCeSp\nKP0AqsROF1d9cilb7bNt8x61oOZIP6w+/e4B5Ha08mtS0qmWACPi851NDQUr\nJyYw1D2E8IP5x9lg09U+ijPUwtAEzFhyDzvis0KzFFzgLWfCMM7r2788QFgs\n2oLHbPrPoE5nnKCw6rKMUq0Vf0o4gGo0x7T8pd00wTf+8UPd9rk7fuxYPlM5\nRa1frFoePSgMw/O55YYUuomSO8xkQhlj1KZ3mN3Sq1cbkAiwo0IHroUu+K7l\nAcSuTgTqLxS0qlHCGBPWz7WFchVdNNC3+opXI2J6FZCEXQg/cE7Z7LX+Vx5H\nyJFGPR4dO182hcv+8IRocJw/zx621RJZSccvE/P5VMk3RyDT02HFKjpE6JBt\nQXif\r\n=+0dW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICDHVdKa0J5pFVf6seDKQHRCZ8RJArN4IZB4xAIZL5kNAiA4wi9gEsgvATi0MvqOlSz3pFSUivJodVn7Op8KGXULDQ=="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.16.0-canary.421a6856.0_1589952253380_0.10207739530289972"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.16.0-canary.761aa6f2.0":{"name":"@material/mwc-textfield","version":"0.16.0-canary.761aa6f2.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.e3eacefcc.0","@material/line-ripple":"=7.0.0-canary.e3eacefcc.0","@material/mwc-base":"0.16.0-canary.761aa6f2.0","@material/mwc-floating-label":"0.16.0-canary.761aa6f2.0","@material/mwc-icon":"0.16.0-canary.761aa6f2.0","@material/mwc-line-ripple":"0.16.0-canary.761aa6f2.0","@material/mwc-notched-outline":"0.16.0-canary.761aa6f2.0","@material/shape":"=7.0.0-canary.e3eacefcc.0","@material/textfield":"=7.0.0-canary.e3eacefcc.0","@material/theme":"=7.0.0-canary.e3eacefcc.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"2888b72f42dfca39ebb17e6fe3df0f964d21febc","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2888b72f42dfca39ebb17e6fe3df0f964d21febc/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2888b72f42dfca39ebb17e6fe3df0f964d21febc/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2888b72f42dfca39ebb17e6fe3df0f964d21febc/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2888b72f42dfca39ebb17e6fe3df0f964d21febc/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2888b72f42dfca39ebb17e6fe3df0f964d21febc/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2888b72f42dfca39ebb17e6fe3df0f964d21febc/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2888b72f42dfca39ebb17e6fe3df0f964d21febc/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2888b72f42dfca39ebb17e6fe3df0f964d21febc/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2888b72f42dfca39ebb17e6fe3df0f964d21febc/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2888b72f42dfca39ebb17e6fe3df0f964d21febc/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2888b72f42dfca39ebb17e6fe3df0f964d21febc/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.16.0-canary.761aa6f2.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-ZYElLwOoemq5NDi63mS3HpehhGZ6dCuyGyq0qiqIXXWz3t4Wk9seTpvX+b/2Jj6ZztyWMdLb9xnsvDQfnq536w==","shasum":"bdae28cdfac20c71c5ed137aab01cfe015468082","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.16.0-canary.761aa6f2.0.tgz","fileCount":16,"unpackedSize":255660,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexaGJCRA9TVsSAnZWagAAL2AP/i1IRZFfGXuG7uOeUHAb\nsCYnM69MPO4KtKZtU4ysj9EpBDr3n8EtgXfwl1kzdxbYwsLuz4stRp4dP/F+\n42ElVvmq3x8a0Z8vY9kZu6QsywVbW5PaAnuntmJV9y6JGeDGjWeKPtlWl1ZS\nC7ouHI+H/DQF+axHvSy0RqLbH0SXuQSAMDbyhS4ZfcKRRFsMAqkwd8D5osqL\nIVA1nPOrcH+or9lwc7TKgEDUYcmAuq4lV3BqZbpYoC+aZw5csz8uTo+nTXyc\nUAwFshvFc2D/YY6pcLAq5z3fwi+tl+2H1wa6xnqV4n4C7XFchgHH+Hhe33sS\nR4yt84OaK9eThDKlzeWmfH3P9W5iJCzX7XkPRKcktn6/vlNQS7EoL4LN853M\n8qofHUH1k2Raug0/O/1htvE/2k/I3ep9idmxxLlLl/6Hq5Ai4w3m3HRdRp+O\nGE9V1lQJubuxeLxAt17YPZLYeerITLUFFAsoP+dppJFZl9vYeG2Um0pXesI4\n6rCZJdXInJEyY+K6zzYxCPj7w3siIym08u/EonbeN0Usz0aBezfKvb96BqgY\njLrISlk75bSS2feSVwO2xix/AevxOXEQCYUoZ7Z79NBwkT95wEG0/qsDIr5m\nXyQEAR7PhlbRDQwB6dC+4vZul/rcy6WP8WOgddT8g9zpV9tvwbKHM2VT0Gby\nIyiF\r\n=Aamt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDerSwpNEtGJTDhpDaD8VRy1FAxkkwGAiGQMctzeOJF+AIgQb4ywQnkZHkGL/jXHdAr8xYP6ssVBSierlQ6bel0xH0="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.16.0-canary.761aa6f2.0_1590010248563_0.45058873855208237"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.16.0-canary.f8654c40.0":{"name":"@material/mwc-textfield","version":"0.16.0-canary.f8654c40.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.4ebce8d78.0","@material/line-ripple":"=7.0.0-canary.4ebce8d78.0","@material/mwc-base":"0.16.0-canary.f8654c40.0","@material/mwc-floating-label":"0.16.0-canary.f8654c40.0","@material/mwc-icon":"0.16.0-canary.f8654c40.0","@material/mwc-line-ripple":"0.16.0-canary.f8654c40.0","@material/mwc-notched-outline":"0.16.0-canary.f8654c40.0","@material/shape":"=7.0.0-canary.4ebce8d78.0","@material/textfield":"=7.0.0-canary.4ebce8d78.0","@material/theme":"=7.0.0-canary.4ebce8d78.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"3b845b0ec744d5631e466e04412254ba2fba6ec1","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3b845b0ec744d5631e466e04412254ba2fba6ec1/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3b845b0ec744d5631e466e04412254ba2fba6ec1/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3b845b0ec744d5631e466e04412254ba2fba6ec1/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3b845b0ec744d5631e466e04412254ba2fba6ec1/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3b845b0ec744d5631e466e04412254ba2fba6ec1/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3b845b0ec744d5631e466e04412254ba2fba6ec1/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3b845b0ec744d5631e466e04412254ba2fba6ec1/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3b845b0ec744d5631e466e04412254ba2fba6ec1/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3b845b0ec744d5631e466e04412254ba2fba6ec1/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3b845b0ec744d5631e466e04412254ba2fba6ec1/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3b845b0ec744d5631e466e04412254ba2fba6ec1/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.16.0-canary.f8654c40.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-+yXqlpjGYmw6GcQePN+b4ruCf/dmjvPaWyH+aQnl+JeR5MVACQtLk6K4bnCcR0Yri3zu/6Fp6QY9+JJh6sU2eQ==","shasum":"aba24f12a692e6ee2159dea074f21ba99ede06d7","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.16.0-canary.f8654c40.0.tgz","fileCount":16,"unpackedSize":255660,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexaPFCRA9TVsSAnZWagAAwrIP/1vNFJJKKiW4ULewEM+L\nPFBMEU3exjKN6wF87zsUY0OhjiYaP5DgUmmvTYOLVF4XsHo7x7e3OR84gERx\nz6PTkOQTkPNyC/rnKbnsiII/KgHvQs5Q+wgbnDHhLW5gU21pLWcWsmDn9roc\nomyDYWUnM3e0o/LjLqQVi6UOD1LzDLrmJiiGE9qaHJxZ4Em1tRa6B/9r/YCl\nume+B0lqDpySNLzF36Na+LSn1r+5GUTfY9wRmoKuHj3S/Cq3wql6HqtKohlG\nDlZ9ewMZ0jEToB/2hkItvuQ31E7MsT8avGsjjJkQD4nWY60Md0P8fhg+9IUj\nqw0xoOaJUxQERWa2iOnNbqCC9EzHR3Yx58FDqAMwj/hrJsAvji7AwOZ2YBRC\nORI+tNEFYa9wXf1cT8bZaYYzDDUR9PN/h1E3TiE2o9l5vOtQPz/Dv8p1sot1\nNxeLVKQ4zRkjFebXcTYPuqIAQoDNYDkkJeG6y9z9fsLIWUw5ahqxviyxoSNE\nVc2UkepEIxu3YDlIkqUgkPxNhmuHGAfUOC83pTZklpae/ozLrJ5hDUXJgonb\ngXyfdtODSyaXMZ5rdimPvwYYO85+eDJwhdEYxUSZgwXEnFfcAL2ADlZhQtD7\nZYvwUF1+IyRSJY/KYYwoZdWtgJ/SauJJGHrt23l948GFiftJEdGJeJjz1uD7\nTHqw\r\n=esct\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC56RnZLHF4Fio6Ka8a82vE8em5oYFrvmCKW4l30Gw7UgIhAMG/3btDAk9jIY+0jabD+jtVyfznkJUEBxUBRu5NIxm1"}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.16.0-canary.f8654c40.0_1590010820249_0.27252319077085385"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.16.0-canary.05f3853e.0":{"name":"@material/mwc-textfield","version":"0.16.0-canary.05f3853e.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.c67667e8e.0","@material/line-ripple":"=7.0.0-canary.c67667e8e.0","@material/mwc-base":"0.16.0-canary.05f3853e.0","@material/mwc-floating-label":"0.16.0-canary.05f3853e.0","@material/mwc-icon":"0.16.0-canary.05f3853e.0","@material/mwc-line-ripple":"0.16.0-canary.05f3853e.0","@material/mwc-notched-outline":"0.16.0-canary.05f3853e.0","@material/shape":"=7.0.0-canary.c67667e8e.0","@material/textfield":"=7.0.0-canary.c67667e8e.0","@material/theme":"=7.0.0-canary.c67667e8e.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"47fd7bad9cbebba6f27bd4bc85aba3a4fe6dfeb4","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/47fd7bad9cbebba6f27bd4bc85aba3a4fe6dfeb4/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/47fd7bad9cbebba6f27bd4bc85aba3a4fe6dfeb4/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/47fd7bad9cbebba6f27bd4bc85aba3a4fe6dfeb4/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/47fd7bad9cbebba6f27bd4bc85aba3a4fe6dfeb4/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/47fd7bad9cbebba6f27bd4bc85aba3a4fe6dfeb4/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/47fd7bad9cbebba6f27bd4bc85aba3a4fe6dfeb4/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/47fd7bad9cbebba6f27bd4bc85aba3a4fe6dfeb4/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/47fd7bad9cbebba6f27bd4bc85aba3a4fe6dfeb4/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/47fd7bad9cbebba6f27bd4bc85aba3a4fe6dfeb4/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/47fd7bad9cbebba6f27bd4bc85aba3a4fe6dfeb4/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/47fd7bad9cbebba6f27bd4bc85aba3a4fe6dfeb4/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.16.0-canary.05f3853e.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-LqakaGtYOuC8QrX4daP93dspdYPN1Nf/ui23lWiuklPwvgioVTcvggxSkwu7gGgv0rLxGtgGdB9eXQbe41dqcA==","shasum":"a0b04281d0a469b5ab641d49060511e5d8ed9221","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.16.0-canary.05f3853e.0.tgz","fileCount":16,"unpackedSize":255660,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexrtcCRA9TVsSAnZWagAAs4AP/0oGR/Bo9Tb8tECPWpgZ\nWKVTUCechHspCBBEndhOCLw5JBhLK+t6QPh+J2fgyK7KZi54t2j69BDwzP+/\n/wCC8Sq2kJPnkkPWG49vAkYAH2h3yMtB8tj1JLEeU8QAbCgcYlt0KHU3wEya\ndDl8KyvsuApjoZ8koPw8YutnIwg4+NoF3Rkb8h/wF7y99M64LRgAsnpnOEYZ\nDANuNvJSd8qZoS9/etJapeiJQtrh5Vwtto9/exvpa48UvLkzbJYS1t4mNmif\nXYWzJfVu8OqYJEC82n8mrdmVBvAf4BE1xGMLUV7uEFbve9andJBP5HYGgiPT\nDDKoqCdTfaZh0c+GRZVkirMH68Vg4x2JhLoS3kVXFrzr/BjU/W06/mJyIcuU\nv6lVzKD4mYsYptnJHjC667CFs6xF1Z/gdErJgP9IJ0NV6jRTjsBjh4sSAzIi\nJKSvbFwYdRviRpEbva5Bo77d7b7eFen0WJ5aC3Sckh0beSSnxHogRpFK3yOF\nthK4Gmx+aJoOtNysfqfxWvYmF9RKwpfUZ39DkDZblvHOpfSNJfFu85anc8Wq\nd3mzcdLW8C8L7vyP281Rm5SH6Y43pVKpJb5PT2tScYDBIk12p2Ayy/jUuYPO\njAxJcs8OWCNm1l0Juj5oJu/Tshmhzr8TYjHznAcrP19nAQ0JLYrs4s+4IZAt\nauF8\r\n=QpjG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICjlWI2s2YOWROpcgqyyUekSmgjmYFlu7aJm5niSMC3uAiBvHD9dr2eKASI9Hq3IQ4MzD42mcM4roHyVCPuxEhU/WQ=="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.16.0-canary.05f3853e.0_1590082395763_0.18790753404226024"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.16.0-canary.5fe61f4e.0":{"name":"@material/mwc-textfield","version":"0.16.0-canary.5fe61f4e.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.c67667e8e.0","@material/line-ripple":"=7.0.0-canary.c67667e8e.0","@material/mwc-base":"0.16.0-canary.5fe61f4e.0","@material/mwc-floating-label":"0.16.0-canary.5fe61f4e.0","@material/mwc-icon":"0.16.0-canary.5fe61f4e.0","@material/mwc-line-ripple":"0.16.0-canary.5fe61f4e.0","@material/mwc-notched-outline":"0.16.0-canary.5fe61f4e.0","@material/shape":"=7.0.0-canary.c67667e8e.0","@material/textfield":"=7.0.0-canary.c67667e8e.0","@material/theme":"=7.0.0-canary.c67667e8e.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"7b3ddcc96480928cfbc9538fcd5a840b5ba5205f","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7b3ddcc96480928cfbc9538fcd5a840b5ba5205f/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7b3ddcc96480928cfbc9538fcd5a840b5ba5205f/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7b3ddcc96480928cfbc9538fcd5a840b5ba5205f/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7b3ddcc96480928cfbc9538fcd5a840b5ba5205f/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7b3ddcc96480928cfbc9538fcd5a840b5ba5205f/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7b3ddcc96480928cfbc9538fcd5a840b5ba5205f/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7b3ddcc96480928cfbc9538fcd5a840b5ba5205f/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7b3ddcc96480928cfbc9538fcd5a840b5ba5205f/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7b3ddcc96480928cfbc9538fcd5a840b5ba5205f/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7b3ddcc96480928cfbc9538fcd5a840b5ba5205f/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7b3ddcc96480928cfbc9538fcd5a840b5ba5205f/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.16.0-canary.5fe61f4e.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-I+w3QiYy5uEv8yBdC2VJu0/dS5HhIBDWveQnFVdO8fI3azlOUGQ8b59VfGsabdWWHULu8Cm4rlF56yzRC9Xb9w==","shasum":"628b90e50b028b5f362a52423ce0bb42c8862f9e","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.16.0-canary.5fe61f4e.0.tgz","fileCount":16,"unpackedSize":255660,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexwm0CRA9TVsSAnZWagAAJO4P/jqSNajOjy7X8byI70tC\n8j0/iWSTM0SDPYjUcr1HhlGU/foQWaWfNsz8zPlRtUIbxFdHL4xnKR+dDZ0X\naN9CSHu8Q3AscH+TVmUkj6b2sens1GjUbTaNUDzpkbQFs7ssGE8gj5ogzMwp\nacUHcSJ0gqyYtB5m1PuqR04BFzlCfiV3z9u2otCZeVD+QRHZ4VUJPUTIWg3N\n+1fpwnwpDCZEi9Umz2WLVQXh5a1CgToE0H7SIe+HHNu7Z6EVg3wQk+3fymNM\nQD6+/neP/1wajsNEAltIhmefzenGa8a2KhR/i8ub5pc7HFBb8tZwqVobLxOH\nuhjo7YHHpvTkLCNRg80YW1wFoRtLqBDuFipJdRIdun1PpA4/5sU65x3mg9MM\nu2HcDawPVNq+NqbTBfLphkcOVeIhjh6oHlnI9p7kNRh9IYWnaUmg+fRM7qEK\neRXgqnxnN0PnFgjIMhjA3W8Iz0hTR468D+exTM/2s5iaU7o9s50PNYryWs+7\n5rl9dFmNy7gUv5hJRYTbU8BBMi0WwgiVIF8/Imyns4G6/8v0MwSpIZs8Iqxa\nuSEG/TtU9YacRmwJhJtFBlZiTzO+cddcFPijLRojsoL92/Xsoe7IRyvuDQEA\n2roFm9Lz4CtPEsMYKXpylecDTyJV7YQ2xYMQkzhLHQ0ZK/KmScFvTB0byoWu\nTBFp\r\n=SQGa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA7EI8v1Duf2dBlFn+iGdkM16ugkYjp6lP64Q57rgZs8AiEAnXQIL0jXCufDh3QMuJDfiKqbfUhXVVvHS2/wEHaAzH4="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.16.0-canary.5fe61f4e.0_1590102451727_0.8311901994273678"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.16.0-canary.17d33745.0":{"name":"@material/mwc-textfield","version":"0.16.0-canary.17d33745.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.c113fc942.0","@material/line-ripple":"=7.0.0-canary.c113fc942.0","@material/mwc-base":"0.16.0-canary.17d33745.0","@material/mwc-floating-label":"0.16.0-canary.17d33745.0","@material/mwc-icon":"0.16.0-canary.17d33745.0","@material/mwc-line-ripple":"0.16.0-canary.17d33745.0","@material/mwc-notched-outline":"0.16.0-canary.17d33745.0","@material/shape":"=7.0.0-canary.c113fc942.0","@material/textfield":"=7.0.0-canary.c113fc942.0","@material/theme":"=7.0.0-canary.c113fc942.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"b97ea4369af06c50f10fd7a5fedf708bbbc380cf","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b97ea4369af06c50f10fd7a5fedf708bbbc380cf/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b97ea4369af06c50f10fd7a5fedf708bbbc380cf/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b97ea4369af06c50f10fd7a5fedf708bbbc380cf/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b97ea4369af06c50f10fd7a5fedf708bbbc380cf/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b97ea4369af06c50f10fd7a5fedf708bbbc380cf/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b97ea4369af06c50f10fd7a5fedf708bbbc380cf/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b97ea4369af06c50f10fd7a5fedf708bbbc380cf/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b97ea4369af06c50f10fd7a5fedf708bbbc380cf/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b97ea4369af06c50f10fd7a5fedf708bbbc380cf/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b97ea4369af06c50f10fd7a5fedf708bbbc380cf/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b97ea4369af06c50f10fd7a5fedf708bbbc380cf/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.16.0-canary.17d33745.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-jBYvT0Rjra2iPExoV3C2/j+4yN30kJjAoaWeJH5bnXG5ycLdDqQzUkiRgnvHhMsEhS8GmX8MnZuPwCrPJ6J9pg==","shasum":"0f5018561dae0c261f64a5b50c6975bef638db56","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.16.0-canary.17d33745.0.tgz","fileCount":16,"unpackedSize":255660,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJezUA4CRA9TVsSAnZWagAANFsP/jQrvqJXyHUf/mk4Chdj\nKObk2eq1KykHrwHAFdCcCu8xIDUqYsl/PVnV/N6FlReZ2tcdf5baDutluNKI\nvFHSIbDQYuJg8sw6TCXfIhpWleCauu9SRixI6cwwpGMwugxM/gyS8OUf687A\nLb49N5STmpA63bABduCJ6ZmLMk2EE+a/RjX2Djw32tTYUEmrEFHyhtjZsCgy\naH2x9c4Up4Nu+slWKcHyeb8uUcp07zREO1irHKM+pOLYGcG48rL2uub/jJkj\n2h4FuvVtJCBfPzCEvuKx5BnSTmv38rWD9CVapViyQjFss8EDwIe7s+CRPqBg\nJaZvfFv23pMKYMuktK/CC6U5e0ipRnBcpJ1A3qUWQuYZSxJVL/IEuNXFeUwj\nq+P06IcNq0ycrU/M+Wkwk8G+48hlEaSmN+i4n+Mox+JFr44xW/K9LjEvRBfa\npv6dsAwhG+KPTYPZABrz6P5yRZz9Ol/nKEKlT3OqR1z4UhFu6doFFke07urx\njeHd8cpLJ3/SGubjpUdkDOM1DP88sSdcvloTITnf2P87hHMxRYPxj7wokGFC\nxlAZyIAgnbHsMh8UKa1RemJAEu5g8GHzldkQM3+KF/bOz/pS2nwLNoqnPIHD\nGVpfLu1ox7kvoYgl8pfddW2nJZpc2486swWeVbo0Yzz9zB4siZBGp1tz+x99\nTwzy\r\n=Dew/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB0XH1nAI7c17x2n+eeNHNDCulZCAtn6Ix1aXhWH3XGNAiEAkWEQ3xBHdi1kzZk5Qubx0PpeUuMuZ9LGUo1f+08gGsk="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.16.0-canary.17d33745.0_1590509624368_0.9032249455122174"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.16.0-canary.e8b52f5b.0":{"name":"@material/mwc-textfield","version":"0.16.0-canary.e8b52f5b.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.c113fc942.0","@material/line-ripple":"=7.0.0-canary.c113fc942.0","@material/mwc-base":"0.16.0-canary.e8b52f5b.0","@material/mwc-floating-label":"0.16.0-canary.e8b52f5b.0","@material/mwc-icon":"0.16.0-canary.e8b52f5b.0","@material/mwc-line-ripple":"0.16.0-canary.e8b52f5b.0","@material/mwc-notched-outline":"0.16.0-canary.e8b52f5b.0","@material/shape":"=7.0.0-canary.c113fc942.0","@material/textfield":"=7.0.0-canary.c113fc942.0","@material/theme":"=7.0.0-canary.c113fc942.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"2877bdfbc0560854bc1aab7aee7ca63f798613ed","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2877bdfbc0560854bc1aab7aee7ca63f798613ed/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2877bdfbc0560854bc1aab7aee7ca63f798613ed/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2877bdfbc0560854bc1aab7aee7ca63f798613ed/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2877bdfbc0560854bc1aab7aee7ca63f798613ed/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2877bdfbc0560854bc1aab7aee7ca63f798613ed/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2877bdfbc0560854bc1aab7aee7ca63f798613ed/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2877bdfbc0560854bc1aab7aee7ca63f798613ed/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2877bdfbc0560854bc1aab7aee7ca63f798613ed/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2877bdfbc0560854bc1aab7aee7ca63f798613ed/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2877bdfbc0560854bc1aab7aee7ca63f798613ed/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2877bdfbc0560854bc1aab7aee7ca63f798613ed/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.16.0-canary.e8b52f5b.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-G08lg7k/lW8YsCm7I4mQIVLegLVMDaoIeOt0BJUzmxaMqP7zB+XvgF5GkOog873o5xsjK6IfC8prfGvlVijUDA==","shasum":"44c4289cbc4547d61fe468bda70a4ddc572134cb","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.16.0-canary.e8b52f5b.0.tgz","fileCount":16,"unpackedSize":255660,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJezWMfCRA9TVsSAnZWagAACd0P/2Kh3ER7rmC5xm2J/OSV\nGxBtSq3mo89/yLQcS4HjbFwbp6ba7lzSG4B/VWxm9d+WPWV5BJWI7TlqN7On\nG2J1mPgdQBu7IM7pR4PSIN2+XgQ1so2crDcs/YcUO+3SULzTw60waiamrSpv\nxmQMIwBqyuwn1sE17EpN7hcajy1HokZL3EaFfsGaPZ6TaLEEM4HzRlrmdxLc\ngYEuhsy9PRPyRoRNFy6DCxSwpv5dOMk8CU1o+KvUtocV9I4mblosO5DvWuUz\n7VloUDIWAdG/hNDgEp3ySjwjBGu+MwIavZhycCKi0wFzwtGNWopAyMJXPMEg\nmEixLLMfuPerYC7CulhDEMaolVyp3amiUEiFtxpBr1O1tCaSFcugJ9ZEUVJk\nn+q17n0349bDuAEUG25mSEUQmsAQ9qbawTpaZFKaS57BCK6FOtU3Hhf2QEZC\nl9vwINjZTiERvSvhWDTPyvmMFNIH4qTpI852mLa86l64iur6+iRg0tZAyeqc\nmGPTR0qOZM40R+fF8ChgjnumLxxXlIeuaV7vWHurH5DWjh2rIvx1FLRA099p\nnMlVqYIk/sY0MmZKby+5NC/PD9IpfGNrwJX5256xytjeaA/rKtqdM4+tdhxS\nNpXR9iYClFPKzOVLRT9pdZobDx2Rso7HALZaJQ3+VNP07tny7vXpb/yBdAyq\nT9h+\r\n=3IaE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDnVmL9x6eGGkuImKWlxc7fY7+f/rx9Pxlq3LGrH4qx3QIhAN1AEEbcyURqqM6JpI+bUsQD0C8liXGPHixFN0tl5ZOI"}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.16.0-canary.e8b52f5b.0_1590518559303_0.3767492594894315"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.16.0-canary.09afa0a9.0":{"name":"@material/mwc-textfield","version":"0.16.0-canary.09afa0a9.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.01de07011.0","@material/line-ripple":"=7.0.0-canary.01de07011.0","@material/mwc-base":"0.16.0-canary.09afa0a9.0","@material/mwc-floating-label":"0.16.0-canary.09afa0a9.0","@material/mwc-icon":"0.16.0-canary.09afa0a9.0","@material/mwc-line-ripple":"0.16.0-canary.09afa0a9.0","@material/mwc-notched-outline":"0.16.0-canary.09afa0a9.0","@material/shape":"=7.0.0-canary.01de07011.0","@material/textfield":"=7.0.0-canary.01de07011.0","@material/theme":"=7.0.0-canary.01de07011.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"924f688ba033093a21706afcd1d5b3dea4527355","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/924f688ba033093a21706afcd1d5b3dea4527355/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/924f688ba033093a21706afcd1d5b3dea4527355/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/924f688ba033093a21706afcd1d5b3dea4527355/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/924f688ba033093a21706afcd1d5b3dea4527355/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/924f688ba033093a21706afcd1d5b3dea4527355/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/924f688ba033093a21706afcd1d5b3dea4527355/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/924f688ba033093a21706afcd1d5b3dea4527355/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/924f688ba033093a21706afcd1d5b3dea4527355/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/924f688ba033093a21706afcd1d5b3dea4527355/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/924f688ba033093a21706afcd1d5b3dea4527355/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/924f688ba033093a21706afcd1d5b3dea4527355/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.16.0-canary.09afa0a9.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-dE6VzvEwdssxRzmWciOl8toOvD6fyaCk3eIU06TbgKKDPfNg2DUdo8Z2QluudCLO9aU7W/O/OCF5tvNea+LmgA==","shasum":"c0feb8f4e5f85fda9eebbbcea2d91299952a7265","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.16.0-canary.09afa0a9.0.tgz","fileCount":16,"unpackedSize":255660,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJezY2hCRA9TVsSAnZWagAAqVIP/RRoQ5tvzhVHrsK6OO2Y\nFd04jBi4/2HYzzIw0KGgPBInvIe2qsOm/utsIuZe+WSGiteGajIRGEC5vATo\nbgz4hcLeY6TYIwcsaium//24LOyP9FA56r2fodqLFCOZ92STDprM/V74rhpZ\nf9PuVl4fzdvV9cG/yixRjSzpUAkxyBcVJ04IuMTMZcf/fuvU8e9ZtL8+Ykve\nO/MijclFVVQCqjh30jwYqYNaPlnuPmsBV0VbO0PM92/VnYRN1KYp+rxYmztj\nPsM+e3O2pCSx2HWi3CVutKT7RtIOApg6h8kmflVwQUTJK4iwRGfJeTL0vZ5X\n6VkC09PVpKhiH78Xb7/SAymaGVdXcHxL5mGjversXFNrp1GMO/8KPWt/kiJQ\naGotiG+Lc2xHGjTuWRRSedTS6WBbOrkp3pZ6J5DuWb9rFUdNpPxz5ORec6Fy\no6NlTZ9+KGp+8NvEF68m8khU+LAqnD9JPW4hffEO1q1wv9plMz4RYwBnEwDe\nNN5auFPDWGekXfKAAdi7K22fz+XuDv4Tu4NZ6dbEgBjaTILC8BZ8yrV7WahD\n9mNdh0l8XXmcukofF754uTk5y/+ZxaKJM2odplpiwYaWQappUZLzAWly8m0E\n8hJa652/fyEo8eyueMwWsXAjRuDFZx3LRciznH6fqRH7F9duHEEakEik2kDf\ngBNE\r\n=M6B3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDbfhi8OalS0Tocljxyu4k+MLlOpo9BpI2V46Cp7bDnVgIgNFWBiQaTDTV7IpQCirhD0ccLjy7w0pC/JgF3/i/N9w8="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.16.0-canary.09afa0a9.0_1590529441096_0.9738505046686983"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.16.0-canary.58bc9166.0":{"name":"@material/mwc-textfield","version":"0.16.0-canary.58bc9166.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.d91794c7e.0","@material/line-ripple":"=7.0.0-canary.d91794c7e.0","@material/mwc-base":"0.16.0-canary.58bc9166.0","@material/mwc-floating-label":"0.16.0-canary.58bc9166.0","@material/mwc-icon":"0.16.0-canary.58bc9166.0","@material/mwc-line-ripple":"0.16.0-canary.58bc9166.0","@material/mwc-notched-outline":"0.16.0-canary.58bc9166.0","@material/shape":"=7.0.0-canary.d91794c7e.0","@material/textfield":"=7.0.0-canary.d91794c7e.0","@material/theme":"=7.0.0-canary.d91794c7e.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"71845a1e43b7378230bcb8e8fec40f195da11c2c","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/71845a1e43b7378230bcb8e8fec40f195da11c2c/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/71845a1e43b7378230bcb8e8fec40f195da11c2c/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/71845a1e43b7378230bcb8e8fec40f195da11c2c/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/71845a1e43b7378230bcb8e8fec40f195da11c2c/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/71845a1e43b7378230bcb8e8fec40f195da11c2c/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/71845a1e43b7378230bcb8e8fec40f195da11c2c/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/71845a1e43b7378230bcb8e8fec40f195da11c2c/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/71845a1e43b7378230bcb8e8fec40f195da11c2c/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/71845a1e43b7378230bcb8e8fec40f195da11c2c/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/71845a1e43b7378230bcb8e8fec40f195da11c2c/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/71845a1e43b7378230bcb8e8fec40f195da11c2c/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.16.0-canary.58bc9166.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-r0mNXhcxWlDe01fATSeZmsJlVV+weTx69v7FPuQuuEDoMAu7FNeRFYuzz4zvkIMB23qpGJ/QM6GRoVKyPjak3w==","shasum":"2d4874534e784b3721d677551148a5737fffab77","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.16.0-canary.58bc9166.0.tgz","fileCount":16,"unpackedSize":255780,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJezbSWCRA9TVsSAnZWagAAy8AP/1iXatDiBxUX8lPDtCan\nFW9Y1LBmFcRilm4LnQmKeIBMTDpgcYoWpKwEzlH2StTK5GzkQzYs3MYbjQdl\nNTshZ7NfMcbREFwZIqmFHV1WLjKBO0mkxOvilCWJhvEqpcGZN2Xo+u+fauZn\nWtkGa0yAD0PbGo7G1I8MPwLQ6bpxgULjIr/1M9sx3kRtuDNToPJatGQbQQwF\n5nKfyWGmlRU3kNJ4qiuzWVd7TgXjvevwRDZmRZpJfVSXCK92f8vp+LGhkMHZ\nXCW8e93QzM7eZG+vaeUm7zLKQoQO9v+7daFgvnCwBGhirgV9433g6CtWhYFv\nbpnGtjCszNIPvMZvFmykgvhOLsDOhLlqOQa0d2GaUzO7CTU1UXRB6iV4tWAA\ncPaWCYzHddRheEKOA+BxILGY74RusDnkPNPHM4ad2DsRV3tZ5FVG0t0VctkI\ngLde6k38WtRQpVuxvvggY1aeNydJT8gaicT0eiADsng5azXPilDxu7za2YPm\nSJeJUWoZK5bogPMf+fdgYx2X89D3Mytg6Nf0HcOxoi/F2ikUne0lHv0JOGNe\n8gKnYWgqOI7tjDO9aAsBewa401PiYctNaPAMaQSXNvIMdtl9dlaxb0ozIJ+0\nHoMbnoP1BevreBng5qLAK1TEEiW8NKodK0qtdNBdb3V7OFmZBvW/32rDxZD2\n83zC\r\n=tsTX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD9d6PDKqpjR5Kr6st4fZqw3603ZkbbNoM6wiQmt9AVsAIgHFFHvohVYbXWPv2tF/zducK57Nr+WesOExS7tI+RHo0="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.16.0-canary.58bc9166.0_1590539414248_0.8360294400261701"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.16.0-canary.43bde144.0":{"name":"@material/mwc-textfield","version":"0.16.0-canary.43bde144.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.d91794c7e.0","@material/line-ripple":"=7.0.0-canary.d91794c7e.0","@material/mwc-base":"0.16.0-canary.43bde144.0","@material/mwc-floating-label":"0.16.0-canary.43bde144.0","@material/mwc-icon":"0.16.0-canary.43bde144.0","@material/mwc-line-ripple":"0.16.0-canary.43bde144.0","@material/mwc-notched-outline":"0.16.0-canary.43bde144.0","@material/shape":"=7.0.0-canary.d91794c7e.0","@material/textfield":"=7.0.0-canary.d91794c7e.0","@material/theme":"=7.0.0-canary.d91794c7e.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"eb504ac1efc09a16041fabd1f3fbe62a49717c77","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/eb504ac1efc09a16041fabd1f3fbe62a49717c77/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/eb504ac1efc09a16041fabd1f3fbe62a49717c77/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/eb504ac1efc09a16041fabd1f3fbe62a49717c77/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/eb504ac1efc09a16041fabd1f3fbe62a49717c77/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/eb504ac1efc09a16041fabd1f3fbe62a49717c77/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/eb504ac1efc09a16041fabd1f3fbe62a49717c77/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/eb504ac1efc09a16041fabd1f3fbe62a49717c77/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/eb504ac1efc09a16041fabd1f3fbe62a49717c77/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/eb504ac1efc09a16041fabd1f3fbe62a49717c77/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/eb504ac1efc09a16041fabd1f3fbe62a49717c77/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/eb504ac1efc09a16041fabd1f3fbe62a49717c77/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.16.0-canary.43bde144.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-pflRFNyvwTFsZUsGwlQOf7+3ftrAZ/BFICsAVaPLwA5LDXOysNblcmeQHvg0yHWJHyW5g5wEYalK0bqsQFpBPw==","shasum":"10764e4ce45adcf67192c755233461eba7d27b72","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.16.0-canary.43bde144.0.tgz","fileCount":16,"unpackedSize":255780,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJezrF3CRA9TVsSAnZWagAAu7wP/jMEXkslaUwfwILcWGQ8\nKodXq7AzG6mNGC5opHXSeJiEFPZfPPOlNL7ohm8tjI/Sh3Jz6P9T3nvfbXdc\nxsAeWQMW0GdvZUBOiovY5qdoaG3NopzAI53zCkiOYABUpab86p21WAUGq3ey\nv0pSXO3324K0qribzsySdFaZgWNXac5B+Y7G/u3Z5h1T+R3O4L+MSe4DxHAN\nw9Y9Qz484ldfun3G6d/uED0qPqIR802UXVxIQ3fUjr0Vl9O8gulbU+OrNDTW\nbhzOMOQaXAgjwj0mY93n0TMbpFSLhq9Ek/eQrF6X+NutbpA92oYxoV6Y4RLS\nWIwWOYzdqPXxRfpWpJLMMfbHFnJ58yEuCZUPIgE2+m+49meI9P4mNUC56MHj\npIxkgm/etcJeH2OZdHGNzSY56F/JXQcyruZQOIgw/6eL/mvSCAWoFLxJe0+J\nVUFW4BCc+BQas2ATF6AZd4VPGptxnmtJMu9Jpudq+V4A0Slyp+ieXqVVG6cA\nnf+kto0PwbteiKKfyhyeKsqoVDp9EPRKzndGGgVtzUr3LcDSUgKVVjzLIoRG\nBk1EAesMBqxCHoNUnRkrD1vuILHYL/+Mj0aQ8lLQgsGshpYbN6+c8nbdTpsz\naZdyp8CZYCVwKNTVnSdPG+epWOqUwvzI20cvabynzZyvFKnEw7eAMosLLDpO\nvypf\r\n=DqkM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDAYaBzIMsJHleJFgqZnZR3roUDJL1hfi0fUOcuGcbuJgIgJM1HN6fFYZzY39xkg7WyPpNvFkce2sbT7P/o6j+3J0c="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.16.0-canary.43bde144.0_1590604151432_0.48939584465487473"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.16.0-canary.51067bbc.0":{"name":"@material/mwc-textfield","version":"0.16.0-canary.51067bbc.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.d91794c7e.0","@material/line-ripple":"=7.0.0-canary.d91794c7e.0","@material/mwc-base":"0.16.0-canary.51067bbc.0","@material/mwc-floating-label":"0.16.0-canary.51067bbc.0","@material/mwc-icon":"0.16.0-canary.51067bbc.0","@material/mwc-line-ripple":"0.16.0-canary.51067bbc.0","@material/mwc-notched-outline":"0.16.0-canary.51067bbc.0","@material/shape":"=7.0.0-canary.d91794c7e.0","@material/textfield":"=7.0.0-canary.d91794c7e.0","@material/theme":"=7.0.0-canary.d91794c7e.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"5dc99bc495fa061e0960f717c69cf33620115937","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5dc99bc495fa061e0960f717c69cf33620115937/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5dc99bc495fa061e0960f717c69cf33620115937/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5dc99bc495fa061e0960f717c69cf33620115937/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5dc99bc495fa061e0960f717c69cf33620115937/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5dc99bc495fa061e0960f717c69cf33620115937/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5dc99bc495fa061e0960f717c69cf33620115937/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5dc99bc495fa061e0960f717c69cf33620115937/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5dc99bc495fa061e0960f717c69cf33620115937/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5dc99bc495fa061e0960f717c69cf33620115937/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5dc99bc495fa061e0960f717c69cf33620115937/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5dc99bc495fa061e0960f717c69cf33620115937/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.16.0-canary.51067bbc.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-o2nYshf0BKHU60SGjrPqMVOrnwoITnY05A+dDV1ik6zpQY2fw2TYZtb3LI97dHr2Xy7Ppqh8FblZTIeaRdQcCA==","shasum":"cd51433e5031553769c4a0bdd0bbd31b2511bdf6","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.16.0-canary.51067bbc.0.tgz","fileCount":16,"unpackedSize":255780,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJezsd+CRA9TVsSAnZWagAAUJ0QAIp4STuCh+O1+i8S6WEO\nyXUEqQ69PYve4pLedSz2rrKOdcWVpIU2bsT8eJZ2YYJ7oLLRzs2mFzMCJy9F\nsvhoDt255CuYP1LaCl8RTlz2ezFDj8xMAYBDV5tFFH7oKsxTY82jfZ0yqEmN\nuBbC2RxbHouGA/p4di0Xu4yvxSfvVegNX8izKS7tGpfB/nG1uEU4uXRgLHfe\nUUVcnOswKPtAajgy6EvUExiPte/e88HfK0tdMpMPfxKClKGvn26LQHd2FlQd\nEj/aitfhs7noA9WOn6DWJ//1065jNUHcpZwbJkwOMaG5WvxrZwg+VPIRGpV2\nrwnUK/6io/fPwxC3z1Quvi8eMnfaodW8H6ETEt/wlTqcXZOD+5iNU7enNcXv\nqxEj/QAsWLiZwVxvy5Sza7ITcuXhEPBPlAW5nnFe3Y7VOxjbf969XKKEbmSs\nu0aZAZZEAcjdcKMcX7wFI0rMgBUOv+IOTa0yqK12+dL3+9+jODxOR7elWQme\nOaHKMcXAZaBM6MZxsyiJ/IRmsjkH+g2jVpUvORa8oLZ/+8MwuKjsjQMXvcHH\n+ilOGJrB244LXep6ESBeocZbGsQJ3kTvmJpp/kNqgF7dddaF6+an0u5t8LqJ\np0NOOTkcyLd5XOeM0n6RUjHVTmFkJxOsC6Aa14ERzl3ng/BrKwnsgBXti9K+\nMhtV\r\n=gdNU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG6GWrSH590Wy7aZ129QjV91h9mlGBzePfU4pOTvFcM8AiAW/xOVa+fLalxTAHOPnOrajdJuC2JnKOIodg5i3ZDxLg=="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.16.0-canary.51067bbc.0_1590609789785_0.7413309926333032"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.16.0-canary.92751ffa.0":{"name":"@material/mwc-textfield","version":"0.16.0-canary.92751ffa.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.d91794c7e.0","@material/line-ripple":"=7.0.0-canary.d91794c7e.0","@material/mwc-base":"0.16.0-canary.92751ffa.0","@material/mwc-floating-label":"0.16.0-canary.92751ffa.0","@material/mwc-icon":"0.16.0-canary.92751ffa.0","@material/mwc-line-ripple":"0.16.0-canary.92751ffa.0","@material/mwc-notched-outline":"0.16.0-canary.92751ffa.0","@material/shape":"=7.0.0-canary.d91794c7e.0","@material/textfield":"=7.0.0-canary.d91794c7e.0","@material/theme":"=7.0.0-canary.d91794c7e.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"534233b7f60f5860c6a4bd35799b98a3c5d277b1","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/534233b7f60f5860c6a4bd35799b98a3c5d277b1/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/534233b7f60f5860c6a4bd35799b98a3c5d277b1/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/534233b7f60f5860c6a4bd35799b98a3c5d277b1/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/534233b7f60f5860c6a4bd35799b98a3c5d277b1/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/534233b7f60f5860c6a4bd35799b98a3c5d277b1/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/534233b7f60f5860c6a4bd35799b98a3c5d277b1/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/534233b7f60f5860c6a4bd35799b98a3c5d277b1/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/534233b7f60f5860c6a4bd35799b98a3c5d277b1/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/534233b7f60f5860c6a4bd35799b98a3c5d277b1/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/534233b7f60f5860c6a4bd35799b98a3c5d277b1/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/534233b7f60f5860c6a4bd35799b98a3c5d277b1/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.16.0-canary.92751ffa.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-yzkY3g0EPDxq3pa1mzt70cU0Ry2n1VlS0LglB42ybEbzQnM+VzQSseR5ZwZLoFJVwicon7MpD115A19o1nkicA==","shasum":"8201beae7dd116e6a2b3a38af653a21679241ac8","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.16.0-canary.92751ffa.0.tgz","fileCount":16,"unpackedSize":255780,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJezt1cCRA9TVsSAnZWagAAOGgP/0cJU2vbBabrdBsAUMIE\nR5J/bJUGTSsfpO4QftJV98x/FH9UA08V/9MIY9Uqs4pGmLcYJV1VUglMz76G\nrrnM1abbAKWDTg7pdVeuMHtEwbfbiQBeSFIyTV7gCJnOTqpo11BrbwxgN8Cn\ntXnjsvwGsf6wyD6GbBsvXJeHGx0fHe1am2Xv7RNHDqzshN9jWTJgfbwa+Wle\nSq5yZUIWBZ/9hpzd4dan+BaaCUbfObjSw03Vq1D/lep0Mwj42opIuNCBGo9n\npPWS8O6Nzu2x6Iy1KDVcpl+Um6x91uzfUVv5+YSJg9+mBGw+p43GB5MOI7IV\nhxBuG5uFw+rUf1LAcxyecQyoi1mlOPX4Ea051TavKLvaVMMYIdiiszwItCOM\nzP9RiqwweNr3HklsBr1geLZ8dLQj4KktN0AAtZhSplNoLekasDT7UuWxJ8Gc\nDDwmKRegtz51TnqerIzYasq5E60oSDe0HaR04UF0aojh6EyYq08rtIIxAfhv\ncFWi+NMh3j7oxcKi7sIXvlqKbp1Xy7G8F1Gbxq+fGtSCKrhLVD7M/HAfE32Q\nP7bASwoWXDjBfY8Es6nPfDkW6sYPJYtjLnmOiVe2e8i7okY8//8mFNa5td5s\npbj3bhkSDWO4x0d+OLhAsWbyDxDgCtqNT76PkWr31M9spKZ1X1z6iztQLkQ3\nt2yl\r\n=8XBJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD8cDCU53cIlK6MYlSe2g6Lnn+NZakFwtbIXpQjCqgNWwIhAMMkHxayzGZcBClTIG7tUYLUUnUt8fJvdksENJ47nH/s"}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.16.0-canary.92751ffa.0_1590615388029_0.8456380682909135"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.16.0-canary.aa2b40bb.0":{"name":"@material/mwc-textfield","version":"0.16.0-canary.aa2b40bb.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.d91794c7e.0","@material/line-ripple":"=7.0.0-canary.d91794c7e.0","@material/mwc-base":"0.16.0-canary.aa2b40bb.0","@material/mwc-floating-label":"0.16.0-canary.aa2b40bb.0","@material/mwc-icon":"0.16.0-canary.aa2b40bb.0","@material/mwc-line-ripple":"0.16.0-canary.aa2b40bb.0","@material/mwc-notched-outline":"0.16.0-canary.aa2b40bb.0","@material/shape":"=7.0.0-canary.d91794c7e.0","@material/textfield":"=7.0.0-canary.d91794c7e.0","@material/theme":"=7.0.0-canary.d91794c7e.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"2da9556d449ea1f3ddfce5e0978fba83f759a1e3","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2da9556d449ea1f3ddfce5e0978fba83f759a1e3/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2da9556d449ea1f3ddfce5e0978fba83f759a1e3/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2da9556d449ea1f3ddfce5e0978fba83f759a1e3/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2da9556d449ea1f3ddfce5e0978fba83f759a1e3/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2da9556d449ea1f3ddfce5e0978fba83f759a1e3/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2da9556d449ea1f3ddfce5e0978fba83f759a1e3/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2da9556d449ea1f3ddfce5e0978fba83f759a1e3/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2da9556d449ea1f3ddfce5e0978fba83f759a1e3/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2da9556d449ea1f3ddfce5e0978fba83f759a1e3/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2da9556d449ea1f3ddfce5e0978fba83f759a1e3/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2da9556d449ea1f3ddfce5e0978fba83f759a1e3/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.16.0-canary.aa2b40bb.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-GBKV5Mqfm2Hman5v2FCSzejh3VSnnJcoAKfOou/DFx4bdosAEf+lX3uTb42jhuIMPzhB7LPzbKdXQW6G4fxl5Q==","shasum":"e6b99d2ed4c15b22c97764727d43b38d0d9e1a40","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.16.0-canary.aa2b40bb.0.tgz","fileCount":16,"unpackedSize":255780,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe0A2wCRA9TVsSAnZWagAA2/IP/j66p0tSPzAl9JMdn1sZ\nkiaZu3IOdnkvxCj1tue6DO8k018uOvv9YBMgCiSdenMDBSMG7b3if3vY3IB+\nOF0afQwBIt7YAvioODCn8bgBExOG8Ph1kHradmn+GbiJn3XZXa13oHIkBdzJ\ntwyIO1r86/agPORiDgIOr5XzL9D926q+qFd5bmzXUMQF5kHZjRE+gXI2sdvd\nRkX10x+xM4PlDk+yrW3x4ywb3O6lYdane0TrC0r6SPE8trwzqnLvLeO9eB8c\nrgYxDndPagDLo0h6lVAMC+J7p/weiseDAcDtDuKcHbcSdImtgQoyUMoWV5fO\nj/RmNAhJ74H9mPaRXYNZmde6hGG00qqc9rKQOFHumZdilQzPrRU0ExG4L0+n\nDpGoMPsmxcFPC3UbFQQanwe3V5Sg2kl5DSAF+T99xy+MnWRmYULWZUYDN6Yz\nKkEgMM+WEeNCXd6f4tNX28v2F64u7nw/HMVPphK/o5tUV/nsTPxkYSTY/ae5\n2t2mAJ2EDb+3sI7rR13x1yl27lSo8w9fXP3YvNkoJ+Hm53G2bGqTcYr8m12i\njL0gKI3uIkFgT+0zydVZEFuFYWBEGs7GVP9ZOzAnYMnK3exOwYfANPN88/2B\n11fvEUqN71vKuY3Snt605BIAo+h+cmLsLZpFpBU5Fl9EhvKyHJC4NhKaSWke\nSLBE\r\n=gAvw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH4xRfpyVPdGZVT0aJU/keggoS02w1IgU/e3oNmnKH6vAiEAzFJwACibO4KqEZQg0mtrG4eNgytGjlmx3qLaqg6oGdU="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.16.0-canary.aa2b40bb.0_1590693296226_0.04203255888158308"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.16.0-canary.1a870a01.0":{"name":"@material/mwc-textfield","version":"0.16.0-canary.1a870a01.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.d66d22bf9.0","@material/line-ripple":"=7.0.0-canary.d66d22bf9.0","@material/mwc-base":"0.16.0-canary.1a870a01.0","@material/mwc-floating-label":"0.16.0-canary.1a870a01.0","@material/mwc-icon":"0.16.0-canary.1a870a01.0","@material/mwc-line-ripple":"0.16.0-canary.1a870a01.0","@material/mwc-notched-outline":"0.16.0-canary.1a870a01.0","@material/shape":"=7.0.0-canary.d66d22bf9.0","@material/textfield":"=7.0.0-canary.d66d22bf9.0","@material/theme":"=7.0.0-canary.d66d22bf9.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"f9a61196d2e2f42c5bfffe7dbe30411a16b908a1","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f9a61196d2e2f42c5bfffe7dbe30411a16b908a1/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f9a61196d2e2f42c5bfffe7dbe30411a16b908a1/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f9a61196d2e2f42c5bfffe7dbe30411a16b908a1/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f9a61196d2e2f42c5bfffe7dbe30411a16b908a1/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f9a61196d2e2f42c5bfffe7dbe30411a16b908a1/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f9a61196d2e2f42c5bfffe7dbe30411a16b908a1/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f9a61196d2e2f42c5bfffe7dbe30411a16b908a1/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f9a61196d2e2f42c5bfffe7dbe30411a16b908a1/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f9a61196d2e2f42c5bfffe7dbe30411a16b908a1/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f9a61196d2e2f42c5bfffe7dbe30411a16b908a1/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f9a61196d2e2f42c5bfffe7dbe30411a16b908a1/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.16.0-canary.1a870a01.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-3UMEfQjrLqopL0+20KhKNfLefTT+Z1i03JIGC0M2LIuA/mePurzNvOt3aqT3uTbuqajINGkV7/wPQO2IA63Enw==","shasum":"3a5b1be34c6f835d720e8dfd36d771cddfc611c5","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.16.0-canary.1a870a01.0.tgz","fileCount":16,"unpackedSize":255780,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe0CqrCRA9TVsSAnZWagAA7f8P/1BHjgTQ0+ra08eSt1Ed\ndakjrniutWZt0HC5U+OVfhUDMJNq7tJn7erN69UrmGp1NWU3sGjIt6KAYmRQ\n2oG9IT/jquhFj0sZXUbxV8ZZq8O/4qwtz22mmBP1iM7ou6LkCwK/iAenTbXm\nUsgbcu4/Ir90NR2Cz6q5v3H8Pr8V3HaGO2BALcoYcLP4I4mO6S//+PnAbOxQ\nTGDE3+Wf87pAcJ8W63db4HYBkVNB1c/3DkInzoUmmI9mSNDzmofwF2+yTryP\nedUMSmosm7gzt52gEo7d56g1FxVQGBCG8Ie7dIPlJIWWtfEBNTzVJkvk8SNs\nw5x72WYWv4zUKqPd/ycS3RogppPacObSgr77TSWeexNMw+vP6JDXgcoZjyi+\ncP+yY1KsqSDKhRcu6q1Z2GaYiEjnCtCeQen1CMLbyBlWW/M3erQJwlY0u0kQ\nBGZ41AqGzfjNaBQfP91k8utk6Ac18SYpWSW0h91kU5WKUFiWkIlC95kC+hCm\nxaeEMeGcRpiISz7Ht/U7FXtMajUZRiZ6VpGPvsMFGdsyMb6xDCE3PmJ0bsCl\nkquw97xexq+1aKOhpHHHtzzYNh3dSTxiz05/usz1rRsMiTvEtvgqaO9Y2ln/\ntUhb3eaN9Sqg7PpS2hpcqu+3obOtT3JfMEzsbfmVD1o5lm5gEck5/IAcltAn\n/3ML\r\n=kT/m\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDLi2U1cBLCkcD5/688WrtzcvSusMl8zx/svFrWrGlhCQIgA9yLHCUs+kcNCgImknOvLi0A3tUzbRoTLXkr6ebltWU="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.16.0-canary.1a870a01.0_1590700715384_0.18650481218052573"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.16.0-canary.ad57d086.0":{"name":"@material/mwc-textfield","version":"0.16.0-canary.ad57d086.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.d66d22bf9.0","@material/line-ripple":"=7.0.0-canary.d66d22bf9.0","@material/mwc-base":"0.16.0-canary.ad57d086.0","@material/mwc-floating-label":"0.16.0-canary.ad57d086.0","@material/mwc-icon":"0.16.0-canary.ad57d086.0","@material/mwc-line-ripple":"0.16.0-canary.ad57d086.0","@material/mwc-notched-outline":"0.16.0-canary.ad57d086.0","@material/shape":"=7.0.0-canary.d66d22bf9.0","@material/textfield":"=7.0.0-canary.d66d22bf9.0","@material/theme":"=7.0.0-canary.d66d22bf9.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"718a29a398b0baad30119bd852a5e1bf4d8e8e3c","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/718a29a398b0baad30119bd852a5e1bf4d8e8e3c/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/718a29a398b0baad30119bd852a5e1bf4d8e8e3c/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/718a29a398b0baad30119bd852a5e1bf4d8e8e3c/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/718a29a398b0baad30119bd852a5e1bf4d8e8e3c/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/718a29a398b0baad30119bd852a5e1bf4d8e8e3c/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/718a29a398b0baad30119bd852a5e1bf4d8e8e3c/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/718a29a398b0baad30119bd852a5e1bf4d8e8e3c/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/718a29a398b0baad30119bd852a5e1bf4d8e8e3c/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/718a29a398b0baad30119bd852a5e1bf4d8e8e3c/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/718a29a398b0baad30119bd852a5e1bf4d8e8e3c/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/718a29a398b0baad30119bd852a5e1bf4d8e8e3c/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.16.0-canary.ad57d086.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-lPJzHvh4DUaeFe+tN1B0nVwpbK9LFu6TccoS5SAmzKB8qXXMo6QvTLrlVJyiGUoW3RBArb86VGXDaEJib0t6Dw==","shasum":"d4896347a8f68e79816a08288b0dee5e8d37175a","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.16.0-canary.ad57d086.0.tgz","fileCount":16,"unpackedSize":255780,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe0Z90CRA9TVsSAnZWagAA3CoP/ivSC7mYnH/thIKqp62s\npEwAs1rHT8r2dqcclbbXu9tRILPNrJLdjJX5C1OhGJAp3tGssOtmR5aa6G84\nfaD90iWmI6MtVPBtZW0y+6GJenQNPpDUrTag8/YlhmmLm+aW1odMxcPGMWbz\nEoB9RqzSBT2OL/tWAE6fB3BArUnF7IqSXQG4nGAgaZP+Q/gu0YFEMpF+R6av\nf2GCWE6bEZ+FWBFJBFj0cwhSn/xsSROUzgFe/iAo2BxyH8qzrX2jtodPseIp\nnQo6eMFt5RGVKQvT75g/bhY5vaxiOEQHZGrhZjeBcnLfwj5jvSZp3XWE9gls\n/9/RSOD7w/F7aY7VUjbdWG1tYB4ka4E1zN2MNeQdJgmqAvdLeLIZ8H5hyMIC\neHyDW+mQprDGstWmaW9r1qRgBzbaQ5Emc0LLSImYcoCxB9VcFuxZBA8oYZY/\n3NILYkpKJuPBF+UfdLIVvDdB22ig+j4e2Lj+eh6ZNmjwha0MKZAGfbALYIco\nVlamA4J3TNkBKITWpxrPgRefQUG+yL+1xZyS7wiHi+K9rQbTua8p6r3oaApp\n6CnnWm8HuOadJUqhVzwCPQ/BRxVSNqDBDty1A94yLSpklFLlcYICduBvS6HS\nID2D3/aRLQEzfX5qTj7zOQioA4727FL0MMXoiMUsB9OthCJv39dHd3wK5ox0\nh8dm\r\n=/3C7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGriZFClQeJNcupO+8FJH4qVNGvZxmfpR92UD6lFTdYiAiEA62rm9TRtdwMpnp2no2Uz7Eri98Z2iI0YLFJcGZJJBG4="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.16.0-canary.ad57d086.0_1590796147864_0.6488586804361136"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.16.0-canary.3bf2b4d5.0":{"name":"@material/mwc-textfield","version":"0.16.0-canary.3bf2b4d5.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.8073a20a9.0","@material/line-ripple":"=7.0.0-canary.8073a20a9.0","@material/mwc-base":"0.16.0-canary.3bf2b4d5.0","@material/mwc-floating-label":"0.16.0-canary.3bf2b4d5.0","@material/mwc-icon":"0.16.0-canary.3bf2b4d5.0","@material/mwc-line-ripple":"0.16.0-canary.3bf2b4d5.0","@material/mwc-notched-outline":"0.16.0-canary.3bf2b4d5.0","@material/shape":"=7.0.0-canary.8073a20a9.0","@material/textfield":"=7.0.0-canary.8073a20a9.0","@material/theme":"=7.0.0-canary.8073a20a9.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"796a0757a7808c623433691d3c52ef63cda47751","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/796a0757a7808c623433691d3c52ef63cda47751/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/796a0757a7808c623433691d3c52ef63cda47751/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/796a0757a7808c623433691d3c52ef63cda47751/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/796a0757a7808c623433691d3c52ef63cda47751/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/796a0757a7808c623433691d3c52ef63cda47751/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/796a0757a7808c623433691d3c52ef63cda47751/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/796a0757a7808c623433691d3c52ef63cda47751/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/796a0757a7808c623433691d3c52ef63cda47751/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/796a0757a7808c623433691d3c52ef63cda47751/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/796a0757a7808c623433691d3c52ef63cda47751/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/796a0757a7808c623433691d3c52ef63cda47751/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.16.0-canary.3bf2b4d5.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-VrAQnwRPMllECR5QM7njXuLNlvovJQofv8pGiXvGwmtTj5pPDFpljTtj9MK60TMcUOlGJu2o4aNSvpM0szuEKQ==","shasum":"f05734b2ddbc0ddaa1501b03f01309b6ca7fb48b","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.16.0-canary.3bf2b4d5.0.tgz","fileCount":16,"unpackedSize":257127,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe0aqVCRA9TVsSAnZWagAAYEsP/AngnHNLO6DIqn6Sn0o8\nvCiPOIB+JVj1tsuzqSbKhbJo3oxrMkhyyIEmkhYCQqNb1DN8HphHVxATWpdu\nFhIU2DZJtrcp2wCdD1QycO+RERH04THvbeLhn4RDGQEX4pA4uAjMLJeIDMbq\nRf7sSJfqmwQHMP9zFjaXoZvE6guo2Fw195B8yPSMpU0J2DXm1Tl3t63naOhe\nr6Ql95shp9cpKNfXRIjcDEsKdqQw6V/AxpgHb096vkHJ4HZ0XD8fSIoM/TfH\nbIrwh322excrFZ8As0CELPaZAb6rlovFrNd7cE3WWQrkFlcLAcU8fFKhmRN8\nK8QVqwz/VwitxiPip7s5JIn637UeBTqk7zHut9/W2Ay4lwEXFUEeNVbL1jX8\nItYhZDjEZazuQq6uUrCRm+5KVNLb022pFdJ/oxooULdgiJDFMGLpPecWgOB/\n5K44hV+MRpkOvV27IuHzNyku33GunSqRCv0lpal0AnLJTbFj/Y2hKzoSOjfy\n14FJuvs/HGVg52WaqMSvUMX8FXNzorNX+UV0JX18V5NTfXOMeemu0JlpJRv4\nVeOdy2DhYleH81LhF27Ua3gqzkHCQehqhlE0WyTK0EmK0miT3BoMO0mYal6J\nXckDy2NL2MjKm4uWN+aWFxeAggmaY9w3LhjW6AxS19YLjzlRaCjMMc+7F8DM\ng4oo\r\n=U1Oj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCW97eWXH2LFPk594euYIpdSatzNrg+bWkmvNhEqkwXEAIhAPl6cNdnVbRd4p6KOSSuj5sDPK8vLV/cje4SkzYyWCTO"}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.16.0-canary.3bf2b4d5.0_1590798996773_0.5067538671102556"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.16.0-canary.ac05f090.0":{"name":"@material/mwc-textfield","version":"0.16.0-canary.ac05f090.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.8073a20a9.0","@material/line-ripple":"=7.0.0-canary.8073a20a9.0","@material/mwc-base":"0.16.0-canary.ac05f090.0","@material/mwc-floating-label":"0.16.0-canary.ac05f090.0","@material/mwc-icon":"0.16.0-canary.ac05f090.0","@material/mwc-line-ripple":"0.16.0-canary.ac05f090.0","@material/mwc-notched-outline":"0.16.0-canary.ac05f090.0","@material/shape":"=7.0.0-canary.8073a20a9.0","@material/textfield":"=7.0.0-canary.8073a20a9.0","@material/theme":"=7.0.0-canary.8073a20a9.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"dcf12105ac71a486ee350d7b7fafeee2e7fbba2a","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/dcf12105ac71a486ee350d7b7fafeee2e7fbba2a/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/dcf12105ac71a486ee350d7b7fafeee2e7fbba2a/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/dcf12105ac71a486ee350d7b7fafeee2e7fbba2a/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/dcf12105ac71a486ee350d7b7fafeee2e7fbba2a/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/dcf12105ac71a486ee350d7b7fafeee2e7fbba2a/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/dcf12105ac71a486ee350d7b7fafeee2e7fbba2a/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/dcf12105ac71a486ee350d7b7fafeee2e7fbba2a/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/dcf12105ac71a486ee350d7b7fafeee2e7fbba2a/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/dcf12105ac71a486ee350d7b7fafeee2e7fbba2a/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/dcf12105ac71a486ee350d7b7fafeee2e7fbba2a/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/dcf12105ac71a486ee350d7b7fafeee2e7fbba2a/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.16.0-canary.ac05f090.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-rWiItilP1iod3ukUFO90kN8HOwGeiApPWQOt5TSsYNpioDKh3AuYKCUpOVk7DY8Jctz6joLaRmyPjsD3blWe2Q==","shasum":"d80db7ebefe6559bc6b3f536255bd8eb2ac793f0","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.16.0-canary.ac05f090.0.tgz","fileCount":16,"unpackedSize":257127,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe0cnICRA9TVsSAnZWagAA7wEP/2w/fbg3mqHishF1Mgf3\nJuc32RVZaDIaBIkzDEYFScXNjIiU69H2avHUiFj11VcUDrnpBvyqSymnqsoi\nOXHPAvKve1pKZFfcdKasTlWASzJkLkRMstmgKnReCTj0WaZ/XsGpJEdUQl9h\nr8lesrRtyRz1/4FUVqmSkU8rdiwGVSfs+vAvJfKYgyWWQGrVGxRWCqATny1b\nU185q4oyol8XKLmtNFmgDYuKc4dAxKEaa2yY+uccACJYaoTlFU99wER1Ga5N\nuaTMuThimgAwgZ2J57J0S7pVvTCehniz2bPo2UQQrOoGjT9f0v0UQ5hTMJXP\ngPnfFqzFjyf1qNyFJRIO5q+vnLgxAHDjK4fiBLN044NvM/XykjR7KAvcN3ag\nG/Dy4/rqBLqIYJDda5vl0RT/ZYhzdfR6Ki+dWhDu7k1Cmz1tmG/JrX3McwRX\ni76g4LWZyU8t2/Jf9KVjFCCAcVts3KgN2jMcA9pmEDpA+U+SJla/maWjIZB1\nQoGyFkTk+yiq7D+buT3r7ygpm9E1oKGCTPYP67dFkCXWZXcUJshmSzWtJnzD\nv1h14ADt3Es+dlzcNsqKrk/emgNrSFlDiavwRi77l1K33gO+ht+F7oSCY2XX\n3AdzZ2kcF0nMX7YsZMDQ/4lWP2IOq1CRY4cThxn6JBUpNWhJW35sQAWIfF8l\n5jwB\r\n=mwxM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCFN9i9YMK6bGXoOmJ4MPJ6lf27w/moo8j3MlLVe9DklwIhAL/KrDDKRu5M4IS1nabid+vbiV8EZGm/Wx/3Ae5zwKzi"}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.16.0-canary.ac05f090.0_1590806984260_0.6124748776426461"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.16.0-canary.0ba7b095.0":{"name":"@material/mwc-textfield","version":"0.16.0-canary.0ba7b095.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.8073a20a9.0","@material/line-ripple":"=7.0.0-canary.8073a20a9.0","@material/mwc-base":"0.16.0-canary.0ba7b095.0","@material/mwc-floating-label":"0.16.0-canary.0ba7b095.0","@material/mwc-icon":"0.16.0-canary.0ba7b095.0","@material/mwc-line-ripple":"0.16.0-canary.0ba7b095.0","@material/mwc-notched-outline":"0.16.0-canary.0ba7b095.0","@material/shape":"=7.0.0-canary.8073a20a9.0","@material/textfield":"=7.0.0-canary.8073a20a9.0","@material/theme":"=7.0.0-canary.8073a20a9.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"ea87617c8c9beaed33b593554f344296ff2b1702","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ea87617c8c9beaed33b593554f344296ff2b1702/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ea87617c8c9beaed33b593554f344296ff2b1702/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ea87617c8c9beaed33b593554f344296ff2b1702/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ea87617c8c9beaed33b593554f344296ff2b1702/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ea87617c8c9beaed33b593554f344296ff2b1702/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ea87617c8c9beaed33b593554f344296ff2b1702/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ea87617c8c9beaed33b593554f344296ff2b1702/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ea87617c8c9beaed33b593554f344296ff2b1702/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ea87617c8c9beaed33b593554f344296ff2b1702/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ea87617c8c9beaed33b593554f344296ff2b1702/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ea87617c8c9beaed33b593554f344296ff2b1702/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.16.0-canary.0ba7b095.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-x/LtWwN5R2kMrszaM0vZ+xZhKqUiNCpWW6D2NlHf0mO4V080bxi3k6Df83kfhXnnNkaC5cVERQ6S+ZP9AyibeA==","shasum":"1a4ed660499d71e510d72bb5e72ef4d8f273a049","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.16.0-canary.0ba7b095.0.tgz","fileCount":16,"unpackedSize":257127,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe0ctcCRA9TVsSAnZWagAAbsEP/RvI5P6Cfjbdj4ur+wsd\nBsayAaRhevDenxfG3mDrzksUe2YkOVCtkdjEn76KKZuXfMu3jiQlF3A0fIOl\nAObXPqFf3ActhKCuGMmYxPn/k5l3+Aji66cwMw0XOv6v5JGh/I2pEMfWSzRA\n4Y5dJWj6gXwbDpURJL4F8Gx3JU7gLjt3SBtq/L32KZwGfFk+2VoZPctIEe0v\n8iY6gY8xj8GJdQr+7VJWPmkOWp3DZaB2z2h9f0SMP3mhkW8hJdDcbrkWWRMR\nDYH/C6JlUvEP+ehOIFFdPaYMvCsEdYuG9WJY24Yp+PXbTIGJyQe4osn0fScn\n8Y9Q8XKc7X0ify5zJZ0c/+C7zr0j0sl2RmSttrA9kfp/U36vL8k7syw7gb8p\n1AVwmGQSyOvwsPAMPgdHI5bdMh189ab0Rvqpa6EBtBRJUa4hcmca8gbzqnl3\njNU/Uv0daz5dPNH7tZFcfpQx6p7xpiAN/7FXubDqBhXnDyiL/XWJXBFgh/WA\neK0F8EH1eP90dpFOR882PIG443/gzxh0G4XQLFbc+LXK8ydqVYn9TdQWh9tv\nZ3A3QUxmU+fl0zR5EjvG2TJ+l99LUwJCgdsx3ZEt7JFQf1gRz2C4LhEoVqoC\nWlai+6iRPJlM42XueT+oVqC8gvyX6NETnEye4xQQDzy97jTygGRZ//iTMx/9\nvB5j\r\n=CeF/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGgdVXAcq9lRx5pXzQlhAi1eGD9rw5ZXCv5Yob2CSCp7AiEA42CaydnRasZo+I0oSeszfr+rZo+vmAjzGc9ydCIUoeU="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.16.0-canary.0ba7b095.0_1590807388164_0.3877296683589577"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.16.0-canary.5eaa9bac.0":{"name":"@material/mwc-textfield","version":"0.16.0-canary.5eaa9bac.0","description":"> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.","main":"mwc-textfield.js","module":"mwc-textfield.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.b9776b1d0.0","@material/line-ripple":"=7.0.0-canary.b9776b1d0.0","@material/mwc-base":"0.16.0-canary.5eaa9bac.0","@material/mwc-floating-label":"0.16.0-canary.5eaa9bac.0","@material/mwc-icon":"0.16.0-canary.5eaa9bac.0","@material/mwc-line-ripple":"0.16.0-canary.5eaa9bac.0","@material/mwc-notched-outline":"0.16.0-canary.5eaa9bac.0","@material/shape":"=7.0.0-canary.b9776b1d0.0","@material/textfield":"=7.0.0-canary.b9776b1d0.0","@material/theme":"=7.0.0-canary.b9776b1d0.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"publishConfig":{"access":"public"},"gitHead":"971c5d20ea684615fa18f3c991d77704a2435384","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/971c5d20ea684615fa18f3c991d77704a2435384/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/971c5d20ea684615fa18f3c991d77704a2435384/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/971c5d20ea684615fa18f3c991d77704a2435384/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/971c5d20ea684615fa18f3c991d77704a2435384/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/971c5d20ea684615fa18f3c991d77704a2435384/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/971c5d20ea684615fa18f3c991d77704a2435384/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/971c5d20ea684615fa18f3c991d77704a2435384/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/971c5d20ea684615fa18f3c991d77704a2435384/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/971c5d20ea684615fa18f3c991d77704a2435384/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/971c5d20ea684615fa18f3c991d77704a2435384/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/971c5d20ea684615fa18f3c991d77704a2435384/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","_id":"@material/mwc-textfield@0.16.0-canary.5eaa9bac.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-mf/WksSaduFBuhWG4kdWXuQASSU/+WcFSwKGIHH7v1Ai9mIgk7Cog0zhX3t16b1vbkR2VnzyShJxeWcBVYjvfg==","shasum":"a45950192db97839684d1819fe5b3f3555f5ffbf","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.16.0-canary.5eaa9bac.0.tgz","fileCount":16,"unpackedSize":257858,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe1Y8rCRA9TVsSAnZWagAA+agP/A6RA+Qmcfrem8QrS1u3\nRT7MtWflqobBDrTw0WDHwewRn7/h8ULo2Y05Rj4iKHkMt8jAZApFkiYKUy7a\niC6tU/1Xi2xPRN0t0PYiGaXkLSDcvlwIZB2BX8vIZc3f+ojpz2uvKZnqAork\ncdFZWXIBEjqMTNqEg6PHUTlMC9/2D3HQq/aLrXAKC2yBV/ARDbuTvAGDRZuU\nJw5QFfwJoNuMsIpd3faupFSx7IgxXGNiVhCZbdN7KfovGMjQb2IDZa3tXM0f\n3ZJkQZ4ZoRGjr4ruwAGy6/7u+Pm8Vlrx/PiIoED9z+z6eZ7us+U/T6sTTEbL\nxaR2XCpKT0EuDMJFE4e0QaywNnndY+5I4r9vfnUwtKmG24Fk1e1yBQRo7M2f\nSzeyhADV34zU5pCX2u0Jcn/GcCRHMIuOSY2Dxh2aU+T1jzC2eHFL9jfiqVi8\n5wwFCAvdQGxPraH9tQ8ihwTYODLz01NfggYRKQ0XMYmrOeBnEbVXpJV4KEpz\nMfq6f+9k7B9PkFSNlUwdQSCisruk/Yu1cGizcigIUd0mDrKAMyQw2Hh/OsTp\nsbFEKpxgpob28a/p7pKHMo8xTNxhZugWYdKdpJ6ul/34neVa4FmXU3+Gt7mx\n4TgbNUFcZr9L7Yr/zoxWNgjNe4pDjQ8xNTsOes9JpsMvoZ70j5k2pHoGebPK\nDNLV\r\n=ttsY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDjH3iYS58u9A54JtevG8g359umRgghZNGMseB4WIkTfwIgZx/HmetDf4AsrD86Nl9Ajlv+ioAsECqJNU9YceghBV8="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.16.0-canary.5eaa9bac.0_1591054122655_0.9989391689637956"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.16.0-canary.5677ac20.0":{"name":"@material/mwc-textfield","version":"0.16.0-canary.5677ac20.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.b9776b1d0.0","@material/line-ripple":"=7.0.0-canary.b9776b1d0.0","@material/mwc-base":"0.16.0-canary.5677ac20.0","@material/mwc-floating-label":"0.16.0-canary.5677ac20.0","@material/mwc-line-ripple":"0.16.0-canary.5677ac20.0","@material/mwc-notched-outline":"0.16.0-canary.5677ac20.0","@material/textfield":"=7.0.0-canary.b9776b1d0.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.16.0-canary.5677ac20.0","@material/notched-outline":"=7.0.0-canary.b9776b1d0.0","@material/ripple":"=7.0.0-canary.b9776b1d0.0","@material/shape":"=7.0.0-canary.b9776b1d0.0","@material/theme":"=7.0.0-canary.b9776b1d0.0"},"publishConfig":{"access":"public"},"gitHead":"371e5022a95234955de71585477022efd63b4645","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/371e5022a95234955de71585477022efd63b4645/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/371e5022a95234955de71585477022efd63b4645/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/371e5022a95234955de71585477022efd63b4645/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/371e5022a95234955de71585477022efd63b4645/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/371e5022a95234955de71585477022efd63b4645/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/371e5022a95234955de71585477022efd63b4645/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/371e5022a95234955de71585477022efd63b4645/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/371e5022a95234955de71585477022efd63b4645/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/371e5022a95234955de71585477022efd63b4645/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/371e5022a95234955de71585477022efd63b4645/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/371e5022a95234955de71585477022efd63b4645/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.16.0-canary.5677ac20.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-hTepF7tPh/hwo8WTVI9mjC/W5rG9iCytOE9WkNhr1uz/J9bPf4eqhY0haCTsC+v/pRb+npeapGNAs9n2dn7VGw==","shasum":"854ad267eda7b2e2107b83d541b49b83b94f53cf","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.16.0-canary.5677ac20.0.tgz","fileCount":16,"unpackedSize":258199,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe1ZXPCRA9TVsSAnZWagAA9f0QAIf/Q830uljr0t/VprVf\ns2078v0Mf0s4w/jUpQACxp3FV/jHnr21A+NTzNKIc+5W5CBY1JNLduMvedxg\nEAi3DO5Wh5NZqOtmgPToUWj4nB8eHRPIJZmQQmYVB+CANGy5cj21xvcfstXI\n0/lgQXQeEzS4TiDYR5Cz25P9GzedFGVZNsholBFglDHwtOMYnQNzLj0qVnpO\n4+tTkx41gbcCqYxZFaHyBnT6Uf3D6WdKFpmljMYEoUUJ7gGr/jXMH3S8I3OS\nsxT4hEAh6N/Ss9slj2u3A4BlCsY66Y/AZ1wOiqvCTuWEBGQ0W/gi9SDq499F\nj7BWUNBG7O8AWSFkI9emVg5+18M95ghYxTNvUcevHrETK9iCtg8Yi7bxN7S4\n04ZlSacdzvq6TPWxZf59BlzWNWAziFzf4boSYfO/lGd8wzqBGJB7EhRE9IeS\npHw9zFIl/I6fH4KvlDO+Riw+qnYVU6YvxGFHFjBlJcpZPZYu2rHhI5ej5ogs\nRqkyBuK/Zr84dbm8k4AcUCJnqOplCh5aKkxKX9+qlyTdw+4CNVEubLPLIg7w\nBlgXoJCDQsxA2T8IPKef5GQB9igZOdtYQFsNyYZWvaX+rkxCzHZIKuO/mrSf\nWPsy0LRm24tIzEC4tKqhkoUKo60ECJTCpEiZArYX4VDyVtmzEzfMY8R1Zicf\n3nbr\r\n=/qgc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEHDKc+8fw+3Kf5BlmZKmXrPMdE4y8JG2hyBg0hneECeAiAOIPjHFRDg3/PFeyFTfO4RwnX5NNnq1tpFdjtNQ+lAyQ=="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.16.0-canary.5677ac20.0_1591055823193_0.2269304391239817"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.16.0-canary.7ac6bff4.0":{"name":"@material/mwc-textfield","version":"0.16.0-canary.7ac6bff4.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.b9776b1d0.0","@material/line-ripple":"=7.0.0-canary.b9776b1d0.0","@material/mwc-base":"0.16.0-canary.7ac6bff4.0","@material/mwc-floating-label":"0.16.0-canary.7ac6bff4.0","@material/mwc-line-ripple":"0.16.0-canary.7ac6bff4.0","@material/mwc-notched-outline":"0.16.0-canary.7ac6bff4.0","@material/textfield":"=7.0.0-canary.b9776b1d0.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.16.0-canary.7ac6bff4.0","@material/notched-outline":"=7.0.0-canary.b9776b1d0.0","@material/ripple":"=7.0.0-canary.b9776b1d0.0","@material/shape":"=7.0.0-canary.b9776b1d0.0","@material/theme":"=7.0.0-canary.b9776b1d0.0"},"publishConfig":{"access":"public"},"gitHead":"393ff5005fafa04ca276d60639975d8bbe851f70","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/393ff5005fafa04ca276d60639975d8bbe851f70/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/393ff5005fafa04ca276d60639975d8bbe851f70/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/393ff5005fafa04ca276d60639975d8bbe851f70/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/393ff5005fafa04ca276d60639975d8bbe851f70/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/393ff5005fafa04ca276d60639975d8bbe851f70/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/393ff5005fafa04ca276d60639975d8bbe851f70/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/393ff5005fafa04ca276d60639975d8bbe851f70/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/393ff5005fafa04ca276d60639975d8bbe851f70/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/393ff5005fafa04ca276d60639975d8bbe851f70/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/393ff5005fafa04ca276d60639975d8bbe851f70/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/393ff5005fafa04ca276d60639975d8bbe851f70/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.16.0-canary.7ac6bff4.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-wR3XYjbLRn3IOmCMOyF0T04anVIeHJQ+n4PQYAbLsdCR0uj0nMyShhzRZk7ZkK47nJ+L3MzffcdHIKXiJNlZ9Q==","shasum":"a963a82d01402b496d454a8d2f9d35875e0c2322","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.16.0-canary.7ac6bff4.0.tgz","fileCount":16,"unpackedSize":258199,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe1ZooCRA9TVsSAnZWagAAQucP/0sEuo++G4FapBupk/BA\ni/+8fT60Cgsp7+/F8j7s39skzI4YeatphUGSNgJWtsvKKHtfumpj+E9ZKTzD\nv3IpZVWDTL9usHRziNQZiY++mY+chNOsWYiViVassTbNJJnU4L9ZTSUqbYXW\nINEYsgIJkXcTE2LGm42CaZWBkXvTmFx1JSK9ThhPly0e++8HJZcuFfQUx2OG\nTn/qzcU47Ih3IIwd9bqkufY2OwO2IFZNbnyESdNmCYHWe0bpVosi7ly7rnSd\n+uC5hGJDfjdML3dciG1DrMan/YEc988/UFFhfdNJHy+DkLPmy6Kkc/sOqIKv\nScEa8eMage5MdVr0k0YMjYBeS3rTGA4276blnajv7Zz+c+i3MXzh1VLdxI0X\nSmIpEpHYwo+JZYI7O1zWZYUJchjbAMToHUc/wKhbG1DtV0D9uyuQ/Xv2a5Nl\nOv+Yt/O5aJwuYpPqI0T9U/+qDnzCMFwt8jjbeTiGQ6EkgxHVZIFaCnfJgtTm\nCyPUifbYdyv2+Mg9FX0KEOji1xONwo+mUWGhokYkiJR+ti+0hXfdwJd8aqme\ntH655wh9ROu3ND4R4BiD4iJjVDvu7/0X23CpXrvutfFRzTaQ7U/RIS3QQLzz\nKRfGlWW/2ohhH5zxLzC5+I2DU8qUNRoJ+WtLPVhEVHf4Got2XTnQ8cWwGV2s\npvz8\r\n=B8nj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAUiPyZk2QfU+l8jhcHnu8W7XQCe+oC8JtF187yReqvBAiEAkk4yl5BzB7t7/ZJXkzgR8jcEkQnI8baNTTE/yNUhhZY="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.16.0-canary.7ac6bff4.0_1591056935762_0.6695715643773008"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.16.0-canary.d45622aa.0":{"name":"@material/mwc-textfield","version":"0.16.0-canary.d45622aa.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.b9776b1d0.0","@material/line-ripple":"=7.0.0-canary.b9776b1d0.0","@material/mwc-base":"0.16.0-canary.d45622aa.0","@material/mwc-floating-label":"0.16.0-canary.d45622aa.0","@material/mwc-line-ripple":"0.16.0-canary.d45622aa.0","@material/mwc-notched-outline":"0.16.0-canary.d45622aa.0","@material/textfield":"=7.0.0-canary.b9776b1d0.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.16.0-canary.d45622aa.0","@material/notched-outline":"=7.0.0-canary.b9776b1d0.0","@material/ripple":"=7.0.0-canary.b9776b1d0.0","@material/shape":"=7.0.0-canary.b9776b1d0.0","@material/theme":"=7.0.0-canary.b9776b1d0.0"},"publishConfig":{"access":"public"},"gitHead":"ec53ab9a7c87df6783ef1e555aba6d7de86c46eb","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ec53ab9a7c87df6783ef1e555aba6d7de86c46eb/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ec53ab9a7c87df6783ef1e555aba6d7de86c46eb/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ec53ab9a7c87df6783ef1e555aba6d7de86c46eb/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ec53ab9a7c87df6783ef1e555aba6d7de86c46eb/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ec53ab9a7c87df6783ef1e555aba6d7de86c46eb/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ec53ab9a7c87df6783ef1e555aba6d7de86c46eb/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ec53ab9a7c87df6783ef1e555aba6d7de86c46eb/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ec53ab9a7c87df6783ef1e555aba6d7de86c46eb/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ec53ab9a7c87df6783ef1e555aba6d7de86c46eb/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ec53ab9a7c87df6783ef1e555aba6d7de86c46eb/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ec53ab9a7c87df6783ef1e555aba6d7de86c46eb/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.16.0-canary.d45622aa.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-KtL9hG4BPX0XYE/eMWQBF20IkGXswBphgTTwUEZiii1w57Xd0jngx/DzXfNyuNtnovkJcj4DlM6iUnbnYAUaeA==","shasum":"82acfb476d9f1762f7d58d34e4f0e0078b8f5f19","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.16.0-canary.d45622aa.0.tgz","fileCount":16,"unpackedSize":258199,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe1uSoCRA9TVsSAnZWagAAeG8P/20WEwsV5nORJekTG7+6\n5lvZC9IUyIeH+zoBuYwaoTrqmx4kgJUS95A7iEXyrEsGNnUDAQYso/WKa8ok\n0qxLBMgCTW2huTkjzkrYiflFIofpo2SxevUnxHf2AflnUwBacFFK8twF9Gj4\nUoknSmBhDs1qOozzmoD92puiZvtVfP269Du20ijeMjQLDQCkGBj4yL0L2DE9\n33YAm82ilUmPPOqedowHHj84mZilvtAu3pDuA5NfIINd+5xgMI1wWo39OgWS\nsRGESeDp7hHwS0VTu/AIPjCJdfpAVpSKD3zfuehgyK1t3fzuXiyMllT4dvve\nplhqb9TIyy3DljiYmvzitr5LMvqq89gJEtccYNe4OyZXyeC+2tIQVsWT3rZA\ni2IKvIZesqj42igvxR0keXFyfog2s8Z2wb62E3K2GfJ2Vi2FpBQHCGU7k4KZ\ny/gD68HugFC156LklFse1UyKD1hC6PBe/hXpaiDj1/4D/XMk1OpGyszBSeKm\nhLZjR4oS6rQd+Xi96NqStQajkNJF5O+YX/CScYG5XkmuzdTQntsuQzDOkz5a\nr/7afDFIEBhCENjTg3aNuETHGmuwTstSwOl1oiWxu5/J/4nNQxGw5Kz2jP8z\nF/WdzSRrNuxeRL3dU52AkSSllD7cH9vE/8v0kqagAFwuMkIoEiyeOkUUbDX+\nI2AX\r\n=UN1B\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDv+tfMro4EvJHyry4zI6FxrVuM/kK8dPDkYV5NPouf6AIhAKsXpNc1HsqumDagYFSATOdnCxtipxAy1iEKi4xvFRmH"}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.16.0-canary.d45622aa.0_1591141544272_0.5935928216570909"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.16.0-canary.dc26c709.0":{"name":"@material/mwc-textfield","version":"0.16.0-canary.dc26c709.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.a0dc2b5c4.0","@material/line-ripple":"=7.0.0-canary.a0dc2b5c4.0","@material/mwc-base":"0.16.0-canary.dc26c709.0","@material/mwc-floating-label":"0.16.0-canary.dc26c709.0","@material/mwc-line-ripple":"0.16.0-canary.dc26c709.0","@material/mwc-notched-outline":"0.16.0-canary.dc26c709.0","@material/textfield":"=7.0.0-canary.a0dc2b5c4.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.16.0-canary.dc26c709.0","@material/notched-outline":"=7.0.0-canary.a0dc2b5c4.0","@material/ripple":"=7.0.0-canary.a0dc2b5c4.0","@material/shape":"=7.0.0-canary.a0dc2b5c4.0","@material/theme":"=7.0.0-canary.a0dc2b5c4.0"},"publishConfig":{"access":"public"},"gitHead":"58a25b562ae31e6c32c67599f842dc6bd1f86398","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/58a25b562ae31e6c32c67599f842dc6bd1f86398/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/58a25b562ae31e6c32c67599f842dc6bd1f86398/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/58a25b562ae31e6c32c67599f842dc6bd1f86398/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/58a25b562ae31e6c32c67599f842dc6bd1f86398/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/58a25b562ae31e6c32c67599f842dc6bd1f86398/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/58a25b562ae31e6c32c67599f842dc6bd1f86398/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/58a25b562ae31e6c32c67599f842dc6bd1f86398/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/58a25b562ae31e6c32c67599f842dc6bd1f86398/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/58a25b562ae31e6c32c67599f842dc6bd1f86398/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/58a25b562ae31e6c32c67599f842dc6bd1f86398/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/58a25b562ae31e6c32c67599f842dc6bd1f86398/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.16.0-canary.dc26c709.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-EesAhtZHDSStbblT97rRdjNF8rzwuymOeaK5ntw07rhHSn7WBX0Kesd10NqCm2mdF30AsEKRYG24G7cRKBYnLQ==","shasum":"eeadf408992931e465a9dc34715f2499cefec259","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.16.0-canary.dc26c709.0.tgz","fileCount":16,"unpackedSize":258199,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe2qkrCRA9TVsSAnZWagAAOhUP/i1Ntmfxph6rublJAPAb\n8GMGMfmQOliULyRSKwfrG3qQ0jjnZsp663FtdmtsjfNv2Xzci3qThY/FGR7u\nCdsTMiKTo4vsdtqJ9KuzjtNwNVrsp7YQN3vLJYpqe+utmN7lEHT5gI4NjKwV\nnfkPfD/XXAvhrTKl3/+YOpHFZJAOIy88K3jOjCJTx1+z4EsYSFVtj2i1aLpY\ncnVOeDhsM7iT6+PeGAwRlj6EkCaRRowm+ny2Wk47zVXvjxvkT7XJnGqbhX67\n0fJKgyklXxwbXOOml3cwoFEAOwk1bzB4Pm7s6AzXkRj3BuJRYujLSga/9RWJ\nMK4SdIETbrCCwlsI73wa6ZNUNXu/AVfAL2r0Yf4puxhJgQ04GaO92fcLbIXs\nEB6evukF2Krcmy8aotCXLyxMfJMl1vO84WBtHrmQKmhzf94T3Xn/8g6Bvn5U\nKn19QRJOCWZUywi+UNfbZIdAFLEBn/7nznLr16scU/79pT8xyIQmcQ6h7Sa6\nKjEqhPf8Tdu+hMQ1NcSjmTd+SdxVYwRMzF/x33e8adVhHAw6g9ECas7q/i95\nhRzDQk3ODOneNdxcHpWrwsTVAUDtqSIZSah4yqnmEONTo641W+VhjY7w/Qii\nW1gzVIHwt4/+ejDyBatn6/xLQQNagqX78VmUVDobTbs3npW0f76zGf9TTbJM\nDLKu\r\n=dws3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDckCTnu3diiwDc2NTws8AFSgdmKGoaF5qtBVnfgtUTewIhAPhq2qpfQK675vnIQTMWxULFPccG0vGON+MLpoAkEWlS"}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.16.0-canary.dc26c709.0_1591388458696_0.6110709877428004"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.16.0-canary.b9baf6db.0":{"name":"@material/mwc-textfield","version":"0.16.0-canary.b9baf6db.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.a0dc2b5c4.0","@material/line-ripple":"=7.0.0-canary.a0dc2b5c4.0","@material/mwc-base":"0.16.0-canary.b9baf6db.0","@material/mwc-floating-label":"0.16.0-canary.b9baf6db.0","@material/mwc-line-ripple":"0.16.0-canary.b9baf6db.0","@material/mwc-notched-outline":"0.16.0-canary.b9baf6db.0","@material/textfield":"=7.0.0-canary.a0dc2b5c4.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.16.0-canary.b9baf6db.0","@material/notched-outline":"=7.0.0-canary.a0dc2b5c4.0","@material/ripple":"=7.0.0-canary.a0dc2b5c4.0","@material/shape":"=7.0.0-canary.a0dc2b5c4.0","@material/theme":"=7.0.0-canary.a0dc2b5c4.0"},"publishConfig":{"access":"public"},"gitHead":"911d44443a75be4f249c595f2fb8a90e42365c6b","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/911d44443a75be4f249c595f2fb8a90e42365c6b/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/911d44443a75be4f249c595f2fb8a90e42365c6b/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/911d44443a75be4f249c595f2fb8a90e42365c6b/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/911d44443a75be4f249c595f2fb8a90e42365c6b/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/911d44443a75be4f249c595f2fb8a90e42365c6b/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/911d44443a75be4f249c595f2fb8a90e42365c6b/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/911d44443a75be4f249c595f2fb8a90e42365c6b/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/911d44443a75be4f249c595f2fb8a90e42365c6b/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/911d44443a75be4f249c595f2fb8a90e42365c6b/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/911d44443a75be4f249c595f2fb8a90e42365c6b/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/911d44443a75be4f249c595f2fb8a90e42365c6b/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.16.0-canary.b9baf6db.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-CUWEkLJF9rEaLyZGlhXF2vvmq+OGA4sEznkfDuFXIOQqRXBH0KmuKsgQUss6x4uB6zSqA30BpOk5+YPbr9dgRw==","shasum":"d3707b973b377baf63a3ddf36a766edeec3f451b","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.16.0-canary.b9baf6db.0.tgz","fileCount":16,"unpackedSize":258199,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe2ql8CRA9TVsSAnZWagAAGUUP/RJTWCOS0OR8LNUmesjx\n//Stq3I7qOrTSxZFFOq5qL+YAV1xkfuF/j1Vx/T7NV5wYo7iTFIJVH2ICQBS\ndHzA8jSPJxT7Mj8D/j/AThk1TQ9k45xgXLILGkXp2+JP9AxmEPuZZTvYnBYf\n+PThgL9MecRQK5wNQC1noYcwcop55eBkUzLIxbPZmlF8f4d8e+ndGYBwiMFL\nomIXD1/z7cSqwqiIc7uf6TPso1uFSFIbRKcP1Ff5YDuiLYHD8WxjGtmR8DIP\nuAUoCcgz1Tk+YvFIrsA9+l0DDMrW2G2eRq4XEVjGijhCSRjBdL/vFBfMbJOy\n4BRbNbUKoO4MEVZ99/vSWlB8pC8Ks+RYLynyKTYS0KHLTaLgunOb0XpBg9Ud\nZM9hUh5fF3SzuIiyDxv0BtZ/x8lGyyv1kqm9MYGIV+GlHxUngmpcK8qWyLIc\nZcVBT7cm8OEWgK3LFZ/Rr9r1bkYw06zBQD+uwOtMRX/rB6bBzD+wWaYhOA44\n+3pdeOyJEQl3ZTyI/NmGmzHQebDlf8yzqjYAsIpqbLkfjkoQIC6x7lp7TJqx\n/UYxH65qkog5eawgNei1hPNKrdOAk+HoOpMmmbaprYB80flVHzrW++1BvMmS\np5Q0pbPw6IcKA1c3LVggCfYRN/IQljZth+wQKQV2KAiUsMEj29LCN3uXQDeR\n3IBX\r\n=C75/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCcH05T48EbvLaaFd/NUixlaSnjKiKs6xAlztjHCg0lpgIgOCByaagm35N8vKwidyKrqLLAKUPDKQxhiRy197UgyBA="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.16.0-canary.b9baf6db.0_1591388539816_0.26624076407893416"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.16.0-canary.e0b8c9d0.0":{"name":"@material/mwc-textfield","version":"0.16.0-canary.e0b8c9d0.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.a0dc2b5c4.0","@material/line-ripple":"=7.0.0-canary.a0dc2b5c4.0","@material/mwc-base":"0.16.0-canary.e0b8c9d0.0","@material/mwc-floating-label":"0.16.0-canary.e0b8c9d0.0","@material/mwc-line-ripple":"0.16.0-canary.e0b8c9d0.0","@material/mwc-notched-outline":"0.16.0-canary.e0b8c9d0.0","@material/textfield":"=7.0.0-canary.a0dc2b5c4.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.16.0-canary.e0b8c9d0.0","@material/notched-outline":"=7.0.0-canary.a0dc2b5c4.0","@material/ripple":"=7.0.0-canary.a0dc2b5c4.0","@material/shape":"=7.0.0-canary.a0dc2b5c4.0","@material/theme":"=7.0.0-canary.a0dc2b5c4.0"},"publishConfig":{"access":"public"},"gitHead":"8067f7c0024a048e98d327efa458b70ed21da6e5","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8067f7c0024a048e98d327efa458b70ed21da6e5/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8067f7c0024a048e98d327efa458b70ed21da6e5/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8067f7c0024a048e98d327efa458b70ed21da6e5/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8067f7c0024a048e98d327efa458b70ed21da6e5/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8067f7c0024a048e98d327efa458b70ed21da6e5/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8067f7c0024a048e98d327efa458b70ed21da6e5/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8067f7c0024a048e98d327efa458b70ed21da6e5/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8067f7c0024a048e98d327efa458b70ed21da6e5/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8067f7c0024a048e98d327efa458b70ed21da6e5/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8067f7c0024a048e98d327efa458b70ed21da6e5/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8067f7c0024a048e98d327efa458b70ed21da6e5/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.16.0-canary.e0b8c9d0.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-Zfg1h8mxUcroO8xw7oQU/pd3y2U5n3VFmSe09GwSSZom8epAKmkea5MCJV2JZ+wzWOfO//zdSlFcaC4CwcDNcw==","shasum":"524e29f68d039accb2716608e0f19fa6af02ef07","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.16.0-canary.e0b8c9d0.0.tgz","fileCount":16,"unpackedSize":258199,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe2s+GCRA9TVsSAnZWagAAcWoP+wWtvf8YZQ1u72lUp68/\navQTVVOat3yFMJuuNu14+T4q7DZmo60/h0PLSihhSsGjPuD1LBoR12QbUbHX\nUDmGFcKSPjjp6jJA8e8nZRQ3ZHH8coH0EykYF7hf9boc56uCtL+GPJVB3ECT\nn2u2ID9SXmiz9IXXZ1BZZ+s7RYsG6IPup5pw5MwO2Gn8Qahca1vfxY+dSd3g\n7OqmJucyqIwMMJ4ISSVkM9zFx/vmWx6mRTinlo9751uqZny/88gpAZMuMZzO\nLKwq6A0GGq2BG3MZ4yTdehPzWcs9QY/iywyA6rn/D+OhbYdVxe5d9Iz2CKsp\nP25v6gQCIyCv8HSDICMYrpW6Ust9/Hu8V5rdh4Bp0YGuDaLEp1YC50bKENSK\nc20EQH4E+3yGCfAvrRbSexYUrLu/DAyzv5ja4ulYCZ4lNtCNq3gLZvG4ySNO\nFyfiQ9TQx1kTgZMZbfGypij9HyfGPSqX+zc31Jpkr21+eEFBFLlzD80DU5pE\nDkR6NxN82nECP/UyDyUS/EEi9vfDxkzL148H8JRm8YUxGPOkocsN+JtafZo0\n4TSZhMrh5Agkbcq+TCs63FMOIojMFncCTyY2rjfmP+MOCKdcb46AK/fsJN3C\nW31Z2UPDAGSU95Hl/4QbPf+wef/ymqKaztoJ+xeykYYennzoUirIkt9BvkTG\n9wFb\r\n=sFOm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDr+XeLr4zj6Olx3dRXdhKR10G9g8kpwGKBBzLRBPFqmwIgdKOtXQYEui4DWkOQlj0wW7MzvbCEUDeYtvLvEOYdJdE="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.16.0-canary.e0b8c9d0.0_1591398278324_0.9061235754994126"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.16.0-canary.51552859.0":{"name":"@material/mwc-textfield","version":"0.16.0-canary.51552859.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.39e6f71e2.0","@material/line-ripple":"=7.0.0-canary.39e6f71e2.0","@material/mwc-base":"0.16.0-canary.51552859.0","@material/mwc-floating-label":"0.16.0-canary.51552859.0","@material/mwc-line-ripple":"0.16.0-canary.51552859.0","@material/mwc-notched-outline":"0.16.0-canary.51552859.0","@material/textfield":"=7.0.0-canary.39e6f71e2.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.16.0-canary.51552859.0","@material/notched-outline":"=7.0.0-canary.39e6f71e2.0","@material/ripple":"=7.0.0-canary.39e6f71e2.0","@material/shape":"=7.0.0-canary.39e6f71e2.0","@material/theme":"=7.0.0-canary.39e6f71e2.0"},"publishConfig":{"access":"public"},"gitHead":"be62282108625892e385a5b64edabb5c9949ca75","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/be62282108625892e385a5b64edabb5c9949ca75/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/be62282108625892e385a5b64edabb5c9949ca75/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/be62282108625892e385a5b64edabb5c9949ca75/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/be62282108625892e385a5b64edabb5c9949ca75/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/be62282108625892e385a5b64edabb5c9949ca75/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/be62282108625892e385a5b64edabb5c9949ca75/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/be62282108625892e385a5b64edabb5c9949ca75/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/be62282108625892e385a5b64edabb5c9949ca75/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/be62282108625892e385a5b64edabb5c9949ca75/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/be62282108625892e385a5b64edabb5c9949ca75/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/be62282108625892e385a5b64edabb5c9949ca75/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.16.0-canary.51552859.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-IQdghd+ce8vBMi7gTMbH3S8IBg5j6uBlzzOu0QLaKcmtMkTlpuX19JTz0ruMBChKb9J6+g68O6qklOzCCWThLw==","shasum":"842529c564ebdae5fbb7c7fd9877f1bddfad1201","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.16.0-canary.51552859.0.tgz","fileCount":16,"unpackedSize":258199,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe4CReCRA9TVsSAnZWagAArA0P/jnr1fuJrzXDcqcRwA5p\nyJCdWfiJkJZ1VY1WbQNwOu6u9CxZ9OMYARa65RjZxlVpYg7RS0jjsJWwSOH+\nc2Fvl+alFL75auTRxjWEbDnamAygoRGMxnLtFEUJ0mMnZ2nD8iZAXdAT/hr0\nV6nrhUW2l4s2rmQoqFHGJC+d8FaM0rldfLtilRj5dZAT4IQA3mVeEuKGz0+W\nHSTzi8qexdjL0rTtE8vU3GsgwLsXzkAit0Y+FMn7d5jazuChLXA+gphZmJ78\njbsWz6BxaXHDKcoDNoihfTnQCSuEpOthLxwRPvQLIpmwqpcxDV0aP1464pFX\nGoMyeGsC4lpQh8sD8w/nHlGU5G1x7YSmI8vPaq6+/t1uYDBJpb3QwKNHPhxE\n6XULIEmcbRs6tYGM98OimyXBC9YTcxoOqUiZYVX0XN4i2kuy+T+xEMUilG+t\nOxQ6kdM/cXEBr/QtMMfURmy/g/w4N0JJAUbwFgadvqUmR9ntVGp3EQXdWorw\nFCeyoedEPbroFhun9axjodSTg34QDdDNMFAuDUKmGe5E46zfCSuZ501sqeZ/\nHyl9CB+PpAukc4Xncj8np5dfPOAZFQaBzqLPoH+dBeIjBpVKjmN9wPj2wK48\njrZ4awQP5CmqizOSyNO2XPD+zpDHycn8N3EGwU7/2EwLZlkBTIKTQHckI+6e\njSR7\r\n=+ELW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGqqgqvOUMUyVGJjoEbtlyvugsdCZyGbxoUML3EePf9SAiEAuMqpVKGzsGCtlJcSup1aKSVtD1LSLBB0ODlt1PBow5U="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.16.0-canary.51552859.0_1591747678276_0.11015140181556027"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.16.0-canary.2e269285.0":{"name":"@material/mwc-textfield","version":"0.16.0-canary.2e269285.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.39e6f71e2.0","@material/line-ripple":"=7.0.0-canary.39e6f71e2.0","@material/mwc-base":"0.16.0-canary.2e269285.0","@material/mwc-floating-label":"0.16.0-canary.2e269285.0","@material/mwc-line-ripple":"0.16.0-canary.2e269285.0","@material/mwc-notched-outline":"0.16.0-canary.2e269285.0","@material/textfield":"=7.0.0-canary.39e6f71e2.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.16.0-canary.2e269285.0","@material/notched-outline":"=7.0.0-canary.39e6f71e2.0","@material/ripple":"=7.0.0-canary.39e6f71e2.0","@material/shape":"=7.0.0-canary.39e6f71e2.0","@material/theme":"=7.0.0-canary.39e6f71e2.0"},"publishConfig":{"access":"public"},"gitHead":"de64737d606dbb8ab6368d8fa30690e62fa24cb0","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/de64737d606dbb8ab6368d8fa30690e62fa24cb0/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/de64737d606dbb8ab6368d8fa30690e62fa24cb0/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/de64737d606dbb8ab6368d8fa30690e62fa24cb0/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/de64737d606dbb8ab6368d8fa30690e62fa24cb0/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/de64737d606dbb8ab6368d8fa30690e62fa24cb0/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/de64737d606dbb8ab6368d8fa30690e62fa24cb0/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/de64737d606dbb8ab6368d8fa30690e62fa24cb0/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/de64737d606dbb8ab6368d8fa30690e62fa24cb0/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/de64737d606dbb8ab6368d8fa30690e62fa24cb0/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/de64737d606dbb8ab6368d8fa30690e62fa24cb0/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/de64737d606dbb8ab6368d8fa30690e62fa24cb0/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.16.0-canary.2e269285.0","_nodeVersion":"10.20.1","_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","dist":{"integrity":"sha512-gV1ODCrOxBKS50as3UQ0GXR2ZlsHyt8IRZAs4sKtx9CP3qrgzQYgUmV2VVe8Tbq6MH745u+O1gEUCGVlOneHsw==","shasum":"84bf9651be1e3284302e607144b42e4534f55abb","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.16.0-canary.2e269285.0.tgz","fileCount":16,"unpackedSize":258199,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe4DjsCRA9TVsSAnZWagAAXvcP/RXQMLA/hEjCsuwc60Sf\njQOlZm1DT9B5E7fRVAl1swdhFfJ8Pq3EGQJBYMu4mLPVXeBMF9mVJI25kJ9e\nynpp1ia6F2lxDz9xsSbllxQ/1xB4dcxW5q5lU8dhTLx2FJQmsA4XbNya6/Xc\nlk//OKIerT8Pbcy36zNPL5EiQc/KnW2G1oi3efqx0JMo9A1NpR8WTAxmjN94\n1XzZ3cat3YgwFFrv7NOtonq1rhsJZyL3p0pIe2wDaa218G2h2nX/IjRTLA6z\n5aUmD9D27LwDZhYBjSTLzy3vvfdhMTudBiilzsMclWyf5K+1P6g/S01Ohf8h\nG2hf8o6uzHvNVgM6q+xfTjO9/wpGA9uAA6v/KADyAyvCKMzppemlwvVLBqp6\ncM88icny4GE5f+oWGOCHqqipTRryDq+E/SLl5HIL6SyxRAn/Hz4ieH/svTYh\nyxNL7yOQfqWpGoWpKkAFsMADJMa2c0pBTAeUDjLfXXWm9zrEAsqjgcp+r5WJ\npxQqKH77SglrNq3+eBX4iL//pBK0R7NrDHnS3Q/69O6Fn3BgVlhLDDhrdbgA\nnWn60RdbwdUzeGNgfE8VjEKgZqCBpTtaJ/q/4GyayJDPIdTUfe03CXc+Bi63\nLthNBwfdiocBUhFuVHAybJbgacVjCHe+sZaqbW7Ee+8DvYzeVChunHHSIIah\nrzd/\r\n=bWkO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDY6w+XfYi6SVVc7+RhpdKt50AL87+/L+FDyeYCATuHLAIhANpUWBNAhcbyWeg3HxbNueqUMdXcal13veVTlFr/YAii"}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.16.0-canary.2e269285.0_1591752940274_0.7280846793626696"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.16.0-canary.be138b01.0":{"name":"@material/mwc-textfield","version":"0.16.0-canary.be138b01.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.39e6f71e2.0","@material/line-ripple":"=7.0.0-canary.39e6f71e2.0","@material/mwc-base":"0.16.0-canary.be138b01.0","@material/mwc-floating-label":"0.16.0-canary.be138b01.0","@material/mwc-line-ripple":"0.16.0-canary.be138b01.0","@material/mwc-notched-outline":"0.16.0-canary.be138b01.0","@material/textfield":"=7.0.0-canary.39e6f71e2.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.16.0-canary.be138b01.0","@material/notched-outline":"=7.0.0-canary.39e6f71e2.0","@material/ripple":"=7.0.0-canary.39e6f71e2.0","@material/shape":"=7.0.0-canary.39e6f71e2.0","@material/theme":"=7.0.0-canary.39e6f71e2.0"},"publishConfig":{"access":"public"},"gitHead":"cd3bec5fb787616d9ec3c5e011ed8224add04ad2","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cd3bec5fb787616d9ec3c5e011ed8224add04ad2/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cd3bec5fb787616d9ec3c5e011ed8224add04ad2/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cd3bec5fb787616d9ec3c5e011ed8224add04ad2/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cd3bec5fb787616d9ec3c5e011ed8224add04ad2/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cd3bec5fb787616d9ec3c5e011ed8224add04ad2/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cd3bec5fb787616d9ec3c5e011ed8224add04ad2/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cd3bec5fb787616d9ec3c5e011ed8224add04ad2/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cd3bec5fb787616d9ec3c5e011ed8224add04ad2/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cd3bec5fb787616d9ec3c5e011ed8224add04ad2/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cd3bec5fb787616d9ec3c5e011ed8224add04ad2/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cd3bec5fb787616d9ec3c5e011ed8224add04ad2/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.16.0-canary.be138b01.0","_nodeVersion":"10.21.0","_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","dist":{"integrity":"sha512-UfeSQuebde42hhkGZJOobJcJc/Ckqg4uEzrsjCc+1alGxSvyRuMv9MlO1FiEiXpLpkXCPsjtt+NcdsPwEJ3g1A==","shasum":"195b7eda906e633849e43d6d3aee7916ed909540","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.16.0-canary.be138b01.0.tgz","fileCount":16,"unpackedSize":258199,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe4Uc9CRA9TVsSAnZWagAA7QIP/jltmfJKBsSd9QDSBQV4\n8UunZhpEYYhHMIMDH8NQ7XXkjIgb5lL74bhT78jUZ+ew/nP8FOYuWeegR7H8\nsMVLxupW2tV+qBRyq03PtK9N9OtvLP3+XduyqV21mBOtTwKdHhi0ze/mVGYX\nZNpIFov0pzou3atKsCAxHv04v2uZRYyu5UMsBBIIEEBULlb8GHlU14piE81O\nkwC4xUSsH7V53e7+A1b0Nl4L3XzXqTrt5x+LyKP97kps4TvDrJqeUCstQcpr\nLNY6gBNF4ejFnb1y3PAuWCFcQhEcpprqe7WPJ6bPoM16POxo0C5F3Z6roKrM\nnmo7HGdh1rEVRF6wLCyZB65s7VCwOesuq4yNSZGDeOT7a/XULydwsuoQKJgP\ngXVKV7Kwrw/FdeiWST2hlI2jsRczBvTRb9iOit/GX4tZ66p1UE7T2htqeOhQ\nZ2F3qONJx3aD/FLsFOCMyxW6/vrvQWKm/C8rrLY2s5MLoeobDa4HVwyrljZ0\n57n6DAuulNpu+Mnqg3Tbx/yVqBwvW4plUjJxaOY86ufLTPDBsqOpOu2M7RAU\nQyALyLG1iU1Za4AVu0jEqTlKml7yncriNkOzzZd2vauzW0go9BDX9r3nBOkE\nNIfAWz0y30PHsrSPlB0tOiZ0rtFUDpTOg/+p4hq44ycS6282iRc8JsYqtaJH\nmB69\r\n=3klW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEq8NWnv6lqOfyxOlbqMJ3phphDyF74euJCS/435l2gQAiEAwo02pgX3uLDIFWZa9EXpv2VAaaLfFiGaNOkKQFq47YU="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.16.0-canary.be138b01.0_1591822141090_0.576687896443798"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.16.0-canary.04bccf5a.0":{"name":"@material/mwc-textfield","version":"0.16.0-canary.04bccf5a.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.a6ac8f629.0","@material/line-ripple":"=7.0.0-canary.a6ac8f629.0","@material/mwc-base":"0.16.0-canary.04bccf5a.0","@material/mwc-floating-label":"0.16.0-canary.04bccf5a.0","@material/mwc-line-ripple":"0.16.0-canary.04bccf5a.0","@material/mwc-notched-outline":"0.16.0-canary.04bccf5a.0","@material/textfield":"=7.0.0-canary.a6ac8f629.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.16.0-canary.04bccf5a.0","@material/notched-outline":"=7.0.0-canary.a6ac8f629.0","@material/ripple":"=7.0.0-canary.a6ac8f629.0","@material/shape":"=7.0.0-canary.a6ac8f629.0","@material/theme":"=7.0.0-canary.a6ac8f629.0"},"publishConfig":{"access":"public"},"gitHead":"c077c9c7d3e6ab509f750f7ecab7ee8a858e7d22","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c077c9c7d3e6ab509f750f7ecab7ee8a858e7d22/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c077c9c7d3e6ab509f750f7ecab7ee8a858e7d22/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c077c9c7d3e6ab509f750f7ecab7ee8a858e7d22/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c077c9c7d3e6ab509f750f7ecab7ee8a858e7d22/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c077c9c7d3e6ab509f750f7ecab7ee8a858e7d22/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c077c9c7d3e6ab509f750f7ecab7ee8a858e7d22/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c077c9c7d3e6ab509f750f7ecab7ee8a858e7d22/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c077c9c7d3e6ab509f750f7ecab7ee8a858e7d22/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c077c9c7d3e6ab509f750f7ecab7ee8a858e7d22/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c077c9c7d3e6ab509f750f7ecab7ee8a858e7d22/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c077c9c7d3e6ab509f750f7ecab7ee8a858e7d22/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.16.0-canary.04bccf5a.0","_nodeVersion":"10.21.0","_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","dist":{"integrity":"sha512-sF7X6c8Jvv1AQkVzv+8MBcubdiYir+C1h6JSogPfN30L09vTBBO8MDXY33EWqJUKDpC9aYUTOUgIW1XDlVVOVg==","shasum":"300e0d0c2028ace0b95caf99be3676bc4f03a88f","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.16.0-canary.04bccf5a.0.tgz","fileCount":16,"unpackedSize":258199,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe6BlPCRA9TVsSAnZWagAAShoP/3R7ebSPq32aPmPldmJD\nVibQR2Yt0xFaZ4vj7SRmYZkjh+sfVNk53YRCD49ATk3HvjIOq9uylS9Nu8qC\nxVpugUWoB2tAj+oVR1XnHv3N4HEaT+agAzV1lo46jGyToy8cvfL4JxMZ/pwx\nCcgxR+gtRMDMV+lY4gBV7AufGQO+7WLHO41HY3oIyi0MX9Nqm1Zh8Mv/0Mf/\nmC9harNudS29UJqY6ltkF/iwegeFskXYQx1LlqcyJgetsTev6DAgq7UXrfDU\nM0b2g472gEYiakuMH/OOtQPBztCoqP3GvqePfDiyHb6GrMPBD+l29Tqi/9ni\neJM1w9i+tfTF1g523nbluv+WnLWBdJPQ5UJRM0eQNXVEn6bbT/CyGinJC8Sx\n9TZLaQglp8Q9wBQiauYhxaewNXp7wkz7ktyPBZ2F+5+v/OKi1VsLfB43goQI\nDkSXnSE3hp5cpf/EdUSBPgzWh5q1yIbniI72qcYytmtlerfE6xWS6+bPtDFT\n9RGHlIfDtbfvWbTorUCVgY7TnoocsfWI3QJvungwRGQVhM1HZbO+w3qIuZNz\nz7ThJ8Z9qKPYX522T2PL2B3umT9iFTRd/CYz3XHbCvkvQQhIxMTjlOflEpk0\n7vgTOjTaEQYvR7ozX6Tn8TVr8ulAtYSbfx8iRhArshnhKUAxl/AmkOU7OX84\nogzF\r\n=vyty\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAMZQhkrgYzYUhBqXezg8eW6Z1MS75eSrV0056Q52wZTAiEA64jWh9oUespZs0rOX4fjR0tE+anzj2TOeQivj9PcDQ4="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.16.0-canary.04bccf5a.0_1592269135567_0.5839189529571585"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.16.0-canary.b44dea36.0":{"name":"@material/mwc-textfield","version":"0.16.0-canary.b44dea36.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.a6ac8f629.0","@material/line-ripple":"=7.0.0-canary.a6ac8f629.0","@material/mwc-base":"0.16.0-canary.b44dea36.0","@material/mwc-floating-label":"0.16.0-canary.b44dea36.0","@material/mwc-line-ripple":"0.16.0-canary.b44dea36.0","@material/mwc-notched-outline":"0.16.0-canary.b44dea36.0","@material/textfield":"=7.0.0-canary.a6ac8f629.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.16.0-canary.b44dea36.0","@material/notched-outline":"=7.0.0-canary.a6ac8f629.0","@material/ripple":"=7.0.0-canary.a6ac8f629.0","@material/shape":"=7.0.0-canary.a6ac8f629.0","@material/theme":"=7.0.0-canary.a6ac8f629.0"},"publishConfig":{"access":"public"},"gitHead":"c3acae783f88caaa2b0db088b82e7b98ef4ecd95","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c3acae783f88caaa2b0db088b82e7b98ef4ecd95/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c3acae783f88caaa2b0db088b82e7b98ef4ecd95/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c3acae783f88caaa2b0db088b82e7b98ef4ecd95/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c3acae783f88caaa2b0db088b82e7b98ef4ecd95/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c3acae783f88caaa2b0db088b82e7b98ef4ecd95/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c3acae783f88caaa2b0db088b82e7b98ef4ecd95/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c3acae783f88caaa2b0db088b82e7b98ef4ecd95/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c3acae783f88caaa2b0db088b82e7b98ef4ecd95/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c3acae783f88caaa2b0db088b82e7b98ef4ecd95/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c3acae783f88caaa2b0db088b82e7b98ef4ecd95/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c3acae783f88caaa2b0db088b82e7b98ef4ecd95/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.16.0-canary.b44dea36.0","_nodeVersion":"10.21.0","_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","dist":{"integrity":"sha512-C1HL3XQQv+IzcqA468y3HcPf6RBxNDm019lfKVenlY4rLNRHlDRtT5rglNmam78Sm9jGIooDqZQGs3DQbRamAA==","shasum":"09e93f0dc775acac65f972eb9abf77792e3ee730","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.16.0-canary.b44dea36.0.tgz","fileCount":16,"unpackedSize":258199,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe6TJDCRA9TVsSAnZWagAA7FgP/2rVQxTwTjRPINNdqO1y\niQw8SzItUP5HXmMSR8PYF1Cm3zdnzbw5kj028+nUInxEO/pbDdG15W3ohJrD\nB4aC5DGXF9CPsNjs8NguvPaIl40ulBfMK0XWwMbaFZH8oqwVPdviNWF55Kp7\nfDUj710wwJ+UrGEBD1Zkj9kuVICN21gy1i/OgdEk+2V7wUBDy3p6xzZKPcM9\nju/x+8/j4Y+hzjORvjGxKjBPdSFjsNt6OVTkkH02OBvndjQJl3ThZ89KKRmN\nvovcSFaXn7bfJ99XHZRMRyxtysrraVyO1cqTW1PQ7SCAORUx9r/pGK8Y2kJ9\nYt27K93FJeuD8mG8sn6LIbQZRudtzuU42sGxUln4TLsXctTCOcT9Plc7zFpq\nd4tJ23ycJbVBmweW2Syul7B+JJpv+087RUTsaVsjB85gj9kb9a0lNBFt+kof\nhzK+DM0lUg6INeLw6loO9KTcr3kcd6ZVddTPNVl9jpf1cGrwsmPYHmkOREUz\nkxRa+yQIVjsNxWVZTcvaaAXCG3FJLyPMB7fRNOZca1oh6DxfWfMAHww4O2kR\nOVVMKPVmiNpsvM+fAfcES6qbarV2VpD9zrfM4sgvjqq/G4NjFZ0sg96cx4tW\nZ2J2yXO6XskLWm7XsBGeKdtilzVDewbg2Hx03UGeQiGy/ezjrjXcqvZuPboN\nw1Rm\r\n=ziCS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHPNVnMtraozKbPXvJtYOSkD0TJyDclU/ERWfAPYJgWnAiAoPStiJIHYTNHsvO/TKHc9HE9a7u6fS9w+CEUEcjAdQQ=="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.16.0-canary.b44dea36.0_1592341059190_0.9266032905176538"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.16.0-canary.e2577e87.0":{"name":"@material/mwc-textfield","version":"0.16.0-canary.e2577e87.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.a6ac8f629.0","@material/line-ripple":"=7.0.0-canary.a6ac8f629.0","@material/mwc-base":"0.16.0-canary.e2577e87.0","@material/mwc-floating-label":"0.16.0-canary.e2577e87.0","@material/mwc-line-ripple":"0.16.0-canary.e2577e87.0","@material/mwc-notched-outline":"0.16.0-canary.e2577e87.0","@material/textfield":"=7.0.0-canary.a6ac8f629.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.16.0-canary.e2577e87.0","@material/notched-outline":"=7.0.0-canary.a6ac8f629.0","@material/ripple":"=7.0.0-canary.a6ac8f629.0","@material/shape":"=7.0.0-canary.a6ac8f629.0","@material/theme":"=7.0.0-canary.a6ac8f629.0"},"publishConfig":{"access":"public"},"gitHead":"4cddb26ad140f9a5ae7e41d4f66258da9ffadc5f","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4cddb26ad140f9a5ae7e41d4f66258da9ffadc5f/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4cddb26ad140f9a5ae7e41d4f66258da9ffadc5f/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4cddb26ad140f9a5ae7e41d4f66258da9ffadc5f/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4cddb26ad140f9a5ae7e41d4f66258da9ffadc5f/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4cddb26ad140f9a5ae7e41d4f66258da9ffadc5f/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4cddb26ad140f9a5ae7e41d4f66258da9ffadc5f/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4cddb26ad140f9a5ae7e41d4f66258da9ffadc5f/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4cddb26ad140f9a5ae7e41d4f66258da9ffadc5f/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4cddb26ad140f9a5ae7e41d4f66258da9ffadc5f/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4cddb26ad140f9a5ae7e41d4f66258da9ffadc5f/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4cddb26ad140f9a5ae7e41d4f66258da9ffadc5f/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.16.0-canary.e2577e87.0","_nodeVersion":"10.21.0","_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","dist":{"integrity":"sha512-VLDcSyNwP/uhPtevHDMNNk94e4BmgGkjoY5/Qsvg7jNRtHVTi8K69ysY3coAGlnRY+QjtpPvFdMazGxKpvyyZw==","shasum":"95f2c716bc3e2d7bc0c160c82a0fe0ea98216d0d","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.16.0-canary.e2577e87.0.tgz","fileCount":16,"unpackedSize":259152,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe6TTTCRA9TVsSAnZWagAAbrUQAIaUH0v9SH9zh+/II7x7\nNi8Hxzr5BVKnEJNqx0kVnKEkJ28s3wm6gJZb0UzPh05NuAr36VSCnR7N0sIn\nc/tU3hKwM0Hqjq5167gpeYbDNJ9IVT63FE1h/f0xbZr4BLqBqjToqB+EjMvH\n4CHmc+OH/YzHz+F9dCeALwBkOzBwrwgYQCOtRCMxof52yOW9VK+/ifBUDqdU\niWJPL+GhdWSJGP952jnXgF7/R+gtUVKjJhXN/Pb+CG0gl//zImTBRN3qo3a8\nLwIrz4DPKbOWBob7OH8Yo1mWWn2J9F+eOYEwVP76+1D26eqbuvN1yU929Bho\nNU3KD7hb4qR0abE9mvK3jr8bLcYx5EZaM3J9RpGhAw5wuHVV9zDJ6/VQ3drJ\ndUxvUqe3Ilr5i1CXDuE4EXnEZB/6pxXrtp9plX/o0ZTthja+wgBLp/wawqy1\nm/Fcnmq4Hllrx0HDEDEyjRv6NP6JzDaI0PO9D1McumDR3NPAusj6HBI6CBFx\n+HI2z/20NPjXxo3QzTPv3yJNrQcIQwKvw1aWA3Yo7cq0qro0ZXaWFlk8qS9W\niICiJ3C2dJez4ToVUK4YpVhnNpz7oI/IrbaHRqQZ9BCaDImzYXphEKES4FFL\nuazn/E5azbc3qjpiYCEuZVJ5HChgdKU0n0bQ1uOnb678J/ipX64aL5ziC1QE\ntcHW\r\n=N0NT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGmkIccT5m+Q+s/T737sa2182xR3X6OTsqoljGFXo2y+AiEA/b/vxp//m7izfwvm7M/zqzvU0h1gEV++IVHQQBAzpf4="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.16.0-canary.e2577e87.0_1592341715212_0.8968422550028983"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.16.0-canary.58b73343.0":{"name":"@material/mwc-textfield","version":"0.16.0-canary.58b73343.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.3aa33998e.0","@material/line-ripple":"=7.0.0-canary.3aa33998e.0","@material/mwc-base":"0.16.0-canary.58b73343.0","@material/mwc-floating-label":"0.16.0-canary.58b73343.0","@material/mwc-line-ripple":"0.16.0-canary.58b73343.0","@material/mwc-notched-outline":"0.16.0-canary.58b73343.0","@material/textfield":"=7.0.0-canary.3aa33998e.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.16.0-canary.58b73343.0","@material/notched-outline":"=7.0.0-canary.3aa33998e.0","@material/ripple":"=7.0.0-canary.3aa33998e.0","@material/shape":"=7.0.0-canary.3aa33998e.0","@material/theme":"=7.0.0-canary.3aa33998e.0"},"publishConfig":{"access":"public"},"gitHead":"ba9eb85b43f514dcacb8e7517e4b8728a3629bef","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ba9eb85b43f514dcacb8e7517e4b8728a3629bef/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ba9eb85b43f514dcacb8e7517e4b8728a3629bef/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ba9eb85b43f514dcacb8e7517e4b8728a3629bef/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ba9eb85b43f514dcacb8e7517e4b8728a3629bef/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ba9eb85b43f514dcacb8e7517e4b8728a3629bef/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ba9eb85b43f514dcacb8e7517e4b8728a3629bef/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ba9eb85b43f514dcacb8e7517e4b8728a3629bef/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ba9eb85b43f514dcacb8e7517e4b8728a3629bef/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ba9eb85b43f514dcacb8e7517e4b8728a3629bef/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ba9eb85b43f514dcacb8e7517e4b8728a3629bef/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ba9eb85b43f514dcacb8e7517e4b8728a3629bef/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.16.0-canary.58b73343.0","_nodeVersion":"10.21.0","_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","dist":{"integrity":"sha512-k4rA82r2xGQUZrrRCG9Mwt1OFT3WqPeQFMiC7mL/wynXWuEEUV78Ay7fhZ97NOr2fKRMefxUIMJD+rk/JKMkhw==","shasum":"e1ebaa87453f023de0d14b841d2486dd462ccd8e","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.16.0-canary.58b73343.0.tgz","fileCount":16,"unpackedSize":259152,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe6ThZCRA9TVsSAnZWagAAhCkP/1G6ey7lIqMOYcxE3oYi\n6p1+h8InAuihF5yvK6L5XVgOeznum+HDgLxor1B/YZdLvDD9u59H0UjTWLkJ\nJikdNT4V0EbtrOfVsFgc+kMC3328ryPKToox4z+ow+B7QDmHwySuBueK2iYT\ncgLx0gV3LGn2tZZ+fg9KDcT2h7e+SGYVoo07HMxl1l5rQAuhw1earHOZDXlh\ndCjs8iSMDTvUM1P1p6F5O13GD0MK/vNX/Oe7m/CzgP2p9kZ3Ic9dtklnx7Cx\n57eKlD03xCSgt9x3tvaIE+8GXd61RjZ2i+Vdycdkko9IPRPcBjuSV2fNQY8K\nwApvYHQpMNAj3R/Nt0Zti/RGGiCrirxLt17up7fDBNIOe04FdZMGHD/ypcj+\nG22c7ZdiedzPVS9YUNP4Dr/N4ErUo7wGo1bkIc7ZTZpzqgSgKqqBzBGE1EkF\nWXtwSNZsErpMfw/QbXl0oY29AVZYoEtttbh6BUhQE50hCF2SyDiWXY2VDf5U\n6/jywP1W7gsRdELg4wlnpH1iq0WkrfFCS+FuD5L0/1z+lAqd4ehRgzndSuah\nH3mk4GTBwYGPwHo8OQf43Zmt5CUvML0f+9lHDHIGBfRVzyAv+Nst8G0cM16+\n6DTOzJkl0ztMjpMhVNCG9CFlYMzYIajRlgUksXxqO+PZvs5CrhwYC+dQ4Iss\n7KqL\r\n=DJSX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFTgq4/UhAP+iHqsLCu+Y4aD4GU9hXSDsholbxBcC054AiAZrfsIvaNMxAdEuw1lR1CQw21TMhWp093J7B3+owWC3w=="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.16.0-canary.58b73343.0_1592342617335_0.05715994008950931"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.16.0-canary.f155c058.0":{"name":"@material/mwc-textfield","version":"0.16.0-canary.f155c058.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.f2a488e95.0","@material/line-ripple":"=7.0.0-canary.f2a488e95.0","@material/mwc-base":"0.16.0-canary.f155c058.0","@material/mwc-floating-label":"0.16.0-canary.f155c058.0","@material/mwc-line-ripple":"0.16.0-canary.f155c058.0","@material/mwc-notched-outline":"0.16.0-canary.f155c058.0","@material/textfield":"=7.0.0-canary.f2a488e95.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.16.0-canary.f155c058.0","@material/notched-outline":"=7.0.0-canary.f2a488e95.0","@material/ripple":"=7.0.0-canary.f2a488e95.0","@material/shape":"=7.0.0-canary.f2a488e95.0","@material/theme":"=7.0.0-canary.f2a488e95.0"},"publishConfig":{"access":"public"},"gitHead":"bfa2e71d76745185343aad4d0a9a2b6c3b134563","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bfa2e71d76745185343aad4d0a9a2b6c3b134563/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bfa2e71d76745185343aad4d0a9a2b6c3b134563/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bfa2e71d76745185343aad4d0a9a2b6c3b134563/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bfa2e71d76745185343aad4d0a9a2b6c3b134563/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bfa2e71d76745185343aad4d0a9a2b6c3b134563/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bfa2e71d76745185343aad4d0a9a2b6c3b134563/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bfa2e71d76745185343aad4d0a9a2b6c3b134563/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bfa2e71d76745185343aad4d0a9a2b6c3b134563/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bfa2e71d76745185343aad4d0a9a2b6c3b134563/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bfa2e71d76745185343aad4d0a9a2b6c3b134563/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bfa2e71d76745185343aad4d0a9a2b6c3b134563/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.16.0-canary.f155c058.0","_nodeVersion":"10.21.0","_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","dist":{"integrity":"sha512-yVoZTzZci7nMpBIb9dkyaa3PdIX4tvu3tPTkE641Ighmr5JWqgvc86ZjqSX6Qh6TGPFgrFL/rofOomFFou75TQ==","shasum":"6156b39cc017c261db378195ab9a52c7f2cef022","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.16.0-canary.f155c058.0.tgz","fileCount":16,"unpackedSize":259152,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe661zCRA9TVsSAnZWagAAyN0P/3a5tQcDAqb07gwdlCa3\n9c3b3zft9lyl7t8GXWsiVmHGQLX+XpZvuA7chx0lRzclBwwj6zPeaXdtC5nW\nwZgULZqiXR7cm9i8QP4TNF3PzNknkwMYXkL9E4/kuK+GS0HSM2TWr/PpIsei\nP/Xo/+kwqfuiEpQjRW0Fw+WXO6LosWsHdtw+fCXZU4m4CDNFfghJxMPjDXcT\nv6m9vE2Izh1AJODGf1qYOW7Yvokc+q48McrEcbFsj8fhWq9Dsv3wJYzddlEr\n3UuAKQ+0UmtYzAOG2qrsiNhtdoT6jRvaIyoUCwY+GqFqy3JxRvP/2WbuTcYr\n3We9xdjTH93uPsYPTc6/6RHnd/QfpGF/+ZY6bE+MlZfhC9N1509XAtU3Xyaj\nJ4c6LNN7dXnPnuOrgVbJReFRi0coEHTMuVUh5+13L67nMhBaIPdCFXTXX8Ln\nlHG7NIKRKKgoDM2pULnUYHEZ2i9e/Rmz17zyvne5We10dLX2DqFLi2gVi69X\n2MUrzzFJqpCnr3vecJZf9UXwUft8BFs6JCjKP/UnqxkfI2/H24un7vx8Nwgm\n284Lj6Pa7sF306a/5hZt4RWKORYQnhHUbHdvDzakhXTc/jHg4H1TFAjg+9HW\nZdSksdcJWdbQP2xerm8jcn2a/447Yv76o9jlak4CnGa7vtkUsprWM0Xhu8/y\nBJGZ\r\n=BztB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC+vaW8Jmae6PeEIdM5VfGi5fmFxsvA9TrJcQ+qrMml0AiEA6U//KxvjHwDafZ6eun6xYCba18d0bMRURm7eqzNzx04="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.16.0-canary.f155c058.0_1592503667437_0.5662182740052109"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.16.0-canary.309779d2.0":{"name":"@material/mwc-textfield","version":"0.16.0-canary.309779d2.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.f2a488e95.0","@material/line-ripple":"=7.0.0-canary.f2a488e95.0","@material/mwc-base":"0.16.0-canary.309779d2.0","@material/mwc-floating-label":"0.16.0-canary.309779d2.0","@material/mwc-line-ripple":"0.16.0-canary.309779d2.0","@material/mwc-notched-outline":"0.16.0-canary.309779d2.0","@material/textfield":"=7.0.0-canary.f2a488e95.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.16.0-canary.309779d2.0","@material/notched-outline":"=7.0.0-canary.f2a488e95.0","@material/ripple":"=7.0.0-canary.f2a488e95.0","@material/shape":"=7.0.0-canary.f2a488e95.0","@material/theme":"=7.0.0-canary.f2a488e95.0"},"publishConfig":{"access":"public"},"gitHead":"5227f0923971be3709c93d0a8ec0d85564fb31fb","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5227f0923971be3709c93d0a8ec0d85564fb31fb/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5227f0923971be3709c93d0a8ec0d85564fb31fb/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5227f0923971be3709c93d0a8ec0d85564fb31fb/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5227f0923971be3709c93d0a8ec0d85564fb31fb/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5227f0923971be3709c93d0a8ec0d85564fb31fb/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5227f0923971be3709c93d0a8ec0d85564fb31fb/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5227f0923971be3709c93d0a8ec0d85564fb31fb/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5227f0923971be3709c93d0a8ec0d85564fb31fb/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5227f0923971be3709c93d0a8ec0d85564fb31fb/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5227f0923971be3709c93d0a8ec0d85564fb31fb/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5227f0923971be3709c93d0a8ec0d85564fb31fb/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.16.0-canary.309779d2.0","_nodeVersion":"10.21.0","_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","dist":{"integrity":"sha512-QNEZ9XNefNxWI8D0KsxpBTkbTGRTMnqWOwgjypXdiRsyrA4pjbs/F5eR38A5b5BsO8pm7fFOQMYtqKzn8gN9xg==","shasum":"ef4deb96cf3bc736315a83d2c9d191e1900fe8f4","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.16.0-canary.309779d2.0.tgz","fileCount":16,"unpackedSize":259152,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe6/+pCRA9TVsSAnZWagAAHjwP/RyE/o3vappnvpaZOEuY\nD/UKouvupFn5+bm3RqUTIJ8KIjeGTKum6QUxwo0VeM0K+4/9Ur3rTzMXizaw\nuj4T4tgd63r0A63sLdP+UPu1dLqD/WcMBkAJrVJmmbKnyawgBa+cvlYTqGhf\n1jxJP2x0SosXRXEC4EJBqyotUMJz9VfgKRw7rQOlBuT4mx8UX770S5l4NqPD\npSjZs0jFd4bCyDjeqaJUPex/nwfBqctmi6CBpWJXMXbnRT4RPjwAVz7tFeb1\nvAhx0Hvxk5DTNIexx80kwDZZL0/c//yEynrVzs52fWdcHBG0Rl4h9nJN5dky\nNYGEJepycXagXES8yjKIXaheRtu7YCcspK9HTUg/ImyOXl81fgDh+XFWeILG\nBZcKwwUp02j51L9bI+1NTOOhyPqFKO8LKnCWertqSU0SvlptovR/enjEedEd\nTAmZtSH6KdcThYNumfPQ67XuPp4RKlyZqvk13q9pf5yTb4rqdmW9i4UBfFq0\nnF9rQVoewP8p+K1iaAqryNTLVoSrilX+OAVt3tHUiBz8n0HznkvGv0W4iZqK\nTYW+3Dd4Oq49TRmonBTDdoCqzWb7Btqbw+ZNtYej42scIyfGufYVv0SCO0dH\nb9QmggJ957QrivmCZd0QalBZR7CjS0Av5m+NtvZCT4e7PS13DQCtlNMp2BTk\nylDJ\r\n=2oeS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC5hTJ/TbnqflzJ5nluNM+u4y0iXE6Fp2xkqtL5Hwc31AIhAIPs6NXLqaAM+8mxIfpg4g7qu57FluCyJRIRqTz6Rj/q"}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.16.0-canary.309779d2.0_1592524713512_0.042547040693100335"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.16.0-canary.e7649968.0":{"name":"@material/mwc-textfield","version":"0.16.0-canary.e7649968.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.f2a488e95.0","@material/line-ripple":"=7.0.0-canary.f2a488e95.0","@material/mwc-base":"0.16.0-canary.e7649968.0","@material/mwc-floating-label":"0.16.0-canary.e7649968.0","@material/mwc-line-ripple":"0.16.0-canary.e7649968.0","@material/mwc-notched-outline":"0.16.0-canary.e7649968.0","@material/textfield":"=7.0.0-canary.f2a488e95.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.16.0-canary.e7649968.0","@material/notched-outline":"=7.0.0-canary.f2a488e95.0","@material/ripple":"=7.0.0-canary.f2a488e95.0","@material/shape":"=7.0.0-canary.f2a488e95.0","@material/theme":"=7.0.0-canary.f2a488e95.0"},"publishConfig":{"access":"public"},"gitHead":"33e44f7015ad267b659c9bf1d34799ab8d508993","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/33e44f7015ad267b659c9bf1d34799ab8d508993/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/33e44f7015ad267b659c9bf1d34799ab8d508993/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/33e44f7015ad267b659c9bf1d34799ab8d508993/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/33e44f7015ad267b659c9bf1d34799ab8d508993/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/33e44f7015ad267b659c9bf1d34799ab8d508993/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/33e44f7015ad267b659c9bf1d34799ab8d508993/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/33e44f7015ad267b659c9bf1d34799ab8d508993/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/33e44f7015ad267b659c9bf1d34799ab8d508993/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/33e44f7015ad267b659c9bf1d34799ab8d508993/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/33e44f7015ad267b659c9bf1d34799ab8d508993/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/33e44f7015ad267b659c9bf1d34799ab8d508993/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.16.0-canary.e7649968.0","_nodeVersion":"10.21.0","_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","dist":{"integrity":"sha512-Tm9hF4sgzFl0PaSRFbnx5M8LSfBEIujhesmSlfK7FTn4GQQEJk70yc8tIhJvnENxME6T+CncRPjPmlpFa/R7Aw==","shasum":"8cc74d02d89c46b9cce7d3f2270c7892b6599925","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.16.0-canary.e7649968.0.tgz","fileCount":16,"unpackedSize":261200,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe7TDZCRA9TVsSAnZWagAAYL4P+gMCNOH8GOH3zlUabCca\n3b0FrQpXs4XTytKN7lWK0XeQz7u/89mhQb8omSglkK86Dcc17pWEh81bvSNu\nBGulywUPCYiHfmEfipFOnXQHaUAJPcRugbdgtDydowUeLylpzTMNO+oIybHz\nKPT6kB3BtIBbvCRbhBd42/ibzMBHbyACAyyT8knAdNiDjf0NIbwlyI4Aow94\n5rbCDMkokJIuBncBRb2AEpUxfoDzeERyGQAKmFgtqyrKE6++9ONS/iDk1pUh\ngUIiTRs8ymszSE18lNvKsQxKztZLxYA6w3gsAPJOWLIQko9gUN065KaBaqMW\nxK8r17RacfL2Gh8/9lci7Wqd1ZzSFiwpdBuSJR9eHADJzXktj6ZCtEw+unSo\nFuhKyH88RtaO1qNepEIVS0ueI3ZT04bNsn/EvUwuThQjASDgQ0vKMP79ZzgE\nu5vSxkrOcb7Bjp0PRMQig8PnjTqhDDUlFz+o5J/UfuScJLbqElpFVEbufiJq\nDpXy/nksPDmXj0d2wf72VzJat/utDZSupE44G8tVm6u3na+aDKThOp9Y9Mp5\nrYkC4XMDBjsLLPnqz7AsemoGxNVYcLxMb0F4vay5j9VjEhHZ4KKHw+5ll7t8\nfDknPClc+ld6aDakYF9k6lAFowWTKw2DCxvJVSB2Mrsm/Ulfsu6Q2n6Osvhi\ngkmu\r\n=2pvQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFAyE2BMDBFI7GkpaaA+FaV+Uxc7EmnFj0LRvqsdn6tWAiEAsJTB6m9Dn2pwQh3p7xfLCbHAeZg802J0KdIOC989fR0="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.16.0-canary.e7649968.0_1592602841121_0.0512021140720631"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.16.0-canary.8e21c78b.0":{"name":"@material/mwc-textfield","version":"0.16.0-canary.8e21c78b.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.f2a488e95.0","@material/line-ripple":"=7.0.0-canary.f2a488e95.0","@material/mwc-base":"0.16.0-canary.8e21c78b.0","@material/mwc-floating-label":"0.16.0-canary.8e21c78b.0","@material/mwc-line-ripple":"0.16.0-canary.8e21c78b.0","@material/mwc-notched-outline":"0.16.0-canary.8e21c78b.0","@material/textfield":"=7.0.0-canary.f2a488e95.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.16.0-canary.8e21c78b.0","@material/notched-outline":"=7.0.0-canary.f2a488e95.0","@material/ripple":"=7.0.0-canary.f2a488e95.0","@material/shape":"=7.0.0-canary.f2a488e95.0","@material/theme":"=7.0.0-canary.f2a488e95.0"},"publishConfig":{"access":"public"},"gitHead":"87567a000d0fe9c1fe6f2b37030908bdda7f3290","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/87567a000d0fe9c1fe6f2b37030908bdda7f3290/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/87567a000d0fe9c1fe6f2b37030908bdda7f3290/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/87567a000d0fe9c1fe6f2b37030908bdda7f3290/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/87567a000d0fe9c1fe6f2b37030908bdda7f3290/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/87567a000d0fe9c1fe6f2b37030908bdda7f3290/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/87567a000d0fe9c1fe6f2b37030908bdda7f3290/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/87567a000d0fe9c1fe6f2b37030908bdda7f3290/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/87567a000d0fe9c1fe6f2b37030908bdda7f3290/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/87567a000d0fe9c1fe6f2b37030908bdda7f3290/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/87567a000d0fe9c1fe6f2b37030908bdda7f3290/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/87567a000d0fe9c1fe6f2b37030908bdda7f3290/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.16.0-canary.8e21c78b.0","_nodeVersion":"10.21.0","_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","dist":{"integrity":"sha512-7s9eSAvyT/tMY57kxTj3hYb0476a2F0ugQq40CfJydzuNuHWeKCiVeXTtKyA4SrPl95R22S03Gfq/rj/9TOd+g==","shasum":"24ca22bb1d6323034b0bfab14f20f96bff0522dc","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.16.0-canary.8e21c78b.0.tgz","fileCount":16,"unpackedSize":261200,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe8InzCRA9TVsSAnZWagAA3UgP/2hBGi/obyY9gQUrlBLT\n+5W1WLj2WpqyhJ/owgIBw0rsFG41lTUNhoCvE5erD+U8LoyhBf3TTjjxzODc\ntyCfAye1uf6UJco3TVcs2ZFw4llSN7d7J64Q+fmLWanjohBStfsB/+yDtJ8I\nD8mv3FLE+Mo1aLO5fGOGlKpcWZCax017SUAO2vjaEF6hXPd5S8MNlJAwnh8y\n/uQfTd85BBjE8wrscwFaatoLYK3AYxalPkvnChnQD1ZZS5oJntYgfV3AYoVH\naTcLsNGm9oOghVFDo0ydZyqRHBTYmL5RUs0mB9HQuTUyWtyfbKCvcWF+fHis\nIitYOrxaVLNIvPxvXKEsNNPNbGsutcQ3citzFHO4G8GJykr80G3ZXbt0x9u1\nRNy0UAPymml78IXT0PdbsrgdG0z0Rva8K42q8ookceU3v7VgEIGgjiqw0yMZ\nVPjMtSQyOTekRCx0K8RxLXXUrQKer/vkZX7+IssOa69ysSZQqwrFRVhr6Nu+\njI0bqiEsmm5H/oJU5bFpJyycz9iny2D5g5A44yfaS6tblk6EMAYNGE6yG+zp\nsWZbOk+WSf4Hq6gH3Pz3vCgeUjxQo8+Y7vN7sMv2CmFgnjytkI9Yg6PInD5Y\njsDuq4ut/8igD6tMNTEUDxx8yRPIb8kt+MKWXYw3OFm+CzvfUf3uINOssIkm\n9MJy\r\n=+OEX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHD3RsNEQD+MY6if5lYoTRau5HiRQFEyK/9G0N/XREwGAiEAk4OKFFwG/EIdur1LYx6uXXlU/t1n8HqY+yK/ztUeM4g="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.16.0-canary.8e21c78b.0_1592822258498_0.8843875043748319"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.16.0-canary.6db76faf.0":{"name":"@material/mwc-textfield","version":"0.16.0-canary.6db76faf.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.f2a488e95.0","@material/line-ripple":"=7.0.0-canary.f2a488e95.0","@material/mwc-base":"0.16.0-canary.6db76faf.0","@material/mwc-floating-label":"0.16.0-canary.6db76faf.0","@material/mwc-line-ripple":"0.16.0-canary.6db76faf.0","@material/mwc-notched-outline":"0.16.0-canary.6db76faf.0","@material/textfield":"=7.0.0-canary.f2a488e95.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.16.0-canary.6db76faf.0","@material/notched-outline":"=7.0.0-canary.f2a488e95.0","@material/ripple":"=7.0.0-canary.f2a488e95.0","@material/shape":"=7.0.0-canary.f2a488e95.0","@material/theme":"=7.0.0-canary.f2a488e95.0"},"publishConfig":{"access":"public"},"gitHead":"6e23f797a12e3585f2e2fc7bf0311266b8908e40","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6e23f797a12e3585f2e2fc7bf0311266b8908e40/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6e23f797a12e3585f2e2fc7bf0311266b8908e40/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6e23f797a12e3585f2e2fc7bf0311266b8908e40/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6e23f797a12e3585f2e2fc7bf0311266b8908e40/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6e23f797a12e3585f2e2fc7bf0311266b8908e40/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6e23f797a12e3585f2e2fc7bf0311266b8908e40/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6e23f797a12e3585f2e2fc7bf0311266b8908e40/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6e23f797a12e3585f2e2fc7bf0311266b8908e40/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6e23f797a12e3585f2e2fc7bf0311266b8908e40/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6e23f797a12e3585f2e2fc7bf0311266b8908e40/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6e23f797a12e3585f2e2fc7bf0311266b8908e40/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.16.0-canary.6db76faf.0","_nodeVersion":"10.21.0","_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","dist":{"integrity":"sha512-XLmUA/wqGmFBO5w0FUVukbv/q3MfJG90K5TAqBZZ6hs/zUOXgM3mRy6S7v6XswCdjO2x031MyyrQ9/0U2IIaWg==","shasum":"4c31758e31b3fd58e1409677ed38c1b29ed8b685","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.16.0-canary.6db76faf.0.tgz","fileCount":16,"unpackedSize":261200,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe8R7YCRA9TVsSAnZWagAA5LoP/2VP3eufzmxYVc6uXo8b\nFAZ21Y9SnRUxzSGb/ku9uNPMVomS4GBBk0XpbPJeZpVgYBdH6ARbv1JF8l95\n5Ywh4HcHIS6cv37fhbk3YRRmGQp8hoDHO06WC6T+7y3x4/9wOhyVDYQi+Jh5\nimcWTP5TSbTLe3jYB4+0yGDxmCyyAKtDbzSN25UXZZc+X2IbLQMZEeirfnMS\n7ULM8jR5CHhlQpkuFf84ZKRtkL6/ZMhLcPwKlRTFTfGuMcaCfpaq2AHubOpq\nhzXUZJVS02D7OuNKw192rAslSN0gYeFezp9cTSUGzcgmZK7L5+OidGZDs6hv\nwbvrMFSATjQjp5EOrypj3oZBG+wVzSugyEYkQyaQKwpNzYsTGIWa/58K7Il3\nTSt8Wcha2XIrK6ovuDvfYlH3FlZM2wFa+bk80d90aKBz0dzuhH/N7ZwaGrUe\nbCixXvzidtvq0EyS6YiXiuZX+e6R4AH9/R6R/Ef4cS739Li0aLMtQagkQ6aC\nng/+xDqXXhjh/tTz5vI+CxCmsC0KbCqk8smZ712fd0G6DXx6xhnKXP8q1xjH\nZudCfmLbkVHQDThIVMpEBzAcNudNMpxc2tWBDRtfsuby0PQYvngSmDYlPSo/\nt6WZa+aBk8OQyyKQuOB4vUDODEBLyRHlna9DnZnqJ98emmZAVpfTwRqlm/sk\n/CUs\r\n=sdOo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHpQYe0IfhlpAzd8MqtEmSoudrMeaZ1CxoNVp7AwFtnDAiEApcBWe4XEjaHozaNr+zLgWwrxcyrgBXJduCUQ0dGoWRE="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.16.0-canary.6db76faf.0_1592860376219_0.9503587878713129"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.16.0-canary.c4dd9684.0":{"name":"@material/mwc-textfield","version":"0.16.0-canary.c4dd9684.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=7.0.0-canary.f2a488e95.0","@material/line-ripple":"=7.0.0-canary.f2a488e95.0","@material/mwc-base":"0.16.0-canary.c4dd9684.0","@material/mwc-floating-label":"0.16.0-canary.c4dd9684.0","@material/mwc-line-ripple":"0.16.0-canary.c4dd9684.0","@material/mwc-notched-outline":"0.16.0-canary.c4dd9684.0","@material/textfield":"=7.0.0-canary.f2a488e95.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.16.0-canary.c4dd9684.0","@material/notched-outline":"=7.0.0-canary.f2a488e95.0","@material/ripple":"=7.0.0-canary.f2a488e95.0","@material/shape":"=7.0.0-canary.f2a488e95.0","@material/theme":"=7.0.0-canary.f2a488e95.0"},"publishConfig":{"access":"public"},"gitHead":"4cd7dd845f6929aeb590a441e62cfb720106f05f","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4cd7dd845f6929aeb590a441e62cfb720106f05f/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4cd7dd845f6929aeb590a441e62cfb720106f05f/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4cd7dd845f6929aeb590a441e62cfb720106f05f/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4cd7dd845f6929aeb590a441e62cfb720106f05f/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4cd7dd845f6929aeb590a441e62cfb720106f05f/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4cd7dd845f6929aeb590a441e62cfb720106f05f/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4cd7dd845f6929aeb590a441e62cfb720106f05f/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4cd7dd845f6929aeb590a441e62cfb720106f05f/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4cd7dd845f6929aeb590a441e62cfb720106f05f/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4cd7dd845f6929aeb590a441e62cfb720106f05f/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4cd7dd845f6929aeb590a441e62cfb720106f05f/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.16.0-canary.c4dd9684.0","_nodeVersion":"10.21.0","_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","dist":{"integrity":"sha512-n0Pkhd0PLFFN+OozL5s15Rq1Q9DlmnqZ4vlyj+3qL0CX1+jYr2LbogxZcIfgUJuPah9EmG7ZEc4a08LYaWyQDg==","shasum":"c6cb87f57f82082b30c12951c011308f846bd0db","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.16.0-canary.c4dd9684.0.tgz","fileCount":16,"unpackedSize":261200,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe8hxwCRA9TVsSAnZWagAAFB8P/3QiMnSeBe47+JbGfDnM\nXlVdnc9y5YGB0g+qepu86fPmsihuu4YO83Ld7BXK/rnSUBCX89QE9eZxjRNW\nwk1jvXXV7TaSeK7Rk+U7XJCFhivlBrCQpK68/d7HkKDETpzGb0bwy+l9rt1D\nC7A3Z+7IQgoOZFDmEKcaxTcxn1dptrrucQ4dJAatc1xpS+7SD4S51SMRGEz5\n+qCzuL2E6nbLvUPaxS1ekvajk9z7/Qi8JMSAl4t/lILJgweMCaXJe0qciSxt\n/pPN+ZiMxrlEwbe4XGTEL9jfPdMPHJOubazp2MeiAevbCSueI8vT9l1/+tQH\nomtuwEWW7U0LnRZ3YJcRkdECUgQfk+/l1963nYYhLBhq620wj5zifGvSFYEO\n7xWGNiIn+y//GxfPh3vTz8O9dDpTLMMSYAAjt2fhzNC3zfp+jzYu3cYx5yMw\nV0b1TXLcX6fCuabkorpvCJhX/wzPD5jsO+Ga7baaR4ipeuxlZ61iyTHsrNQa\n1u0ZpXS+ZbJP5B+6NFc9jXTcq3DDTgPOr35OKdePt43X9owbP+CIgT0iFf9S\nRmes8KgTKO17pAhMnnbmfMR3pWlt7UzIoDvlmqFMbMNplUfJdBBoY6YaWY0D\nL8FmPaDXshH2Tjvx50wdTH/VHS1zN93nOcv5YjvndUHKR2HGa9DZhz716OZo\nLHzu\r\n=57pi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDh+uC9Mh5QaP3/L/exj196jGyzAeddS6iOXgoeCVPFbAIgGeMv5KVjkHdZ8UpQQws0FS4PfdwBDJrMWPiqFc97OI4="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.16.0-canary.c4dd9684.0_1592925295885_0.25647599049307757"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.16.0-canary.b3e53981.0":{"name":"@material/mwc-textfield","version":"0.16.0-canary.b3e53981.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.15e81fe98.0","@material/line-ripple":"=8.0.0-canary.15e81fe98.0","@material/mwc-base":"0.16.0-canary.b3e53981.0","@material/mwc-floating-label":"0.16.0-canary.b3e53981.0","@material/mwc-line-ripple":"0.16.0-canary.b3e53981.0","@material/mwc-notched-outline":"0.16.0-canary.b3e53981.0","@material/textfield":"=8.0.0-canary.15e81fe98.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.16.0-canary.b3e53981.0","@material/notched-outline":"=8.0.0-canary.15e81fe98.0","@material/ripple":"=8.0.0-canary.15e81fe98.0","@material/shape":"=8.0.0-canary.15e81fe98.0","@material/theme":"=8.0.0-canary.15e81fe98.0"},"publishConfig":{"access":"public"},"gitHead":"8d83f2faa9e72fded29e88f843dec080efd318b5","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8d83f2faa9e72fded29e88f843dec080efd318b5/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8d83f2faa9e72fded29e88f843dec080efd318b5/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8d83f2faa9e72fded29e88f843dec080efd318b5/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8d83f2faa9e72fded29e88f843dec080efd318b5/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8d83f2faa9e72fded29e88f843dec080efd318b5/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8d83f2faa9e72fded29e88f843dec080efd318b5/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8d83f2faa9e72fded29e88f843dec080efd318b5/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8d83f2faa9e72fded29e88f843dec080efd318b5/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8d83f2faa9e72fded29e88f843dec080efd318b5/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8d83f2faa9e72fded29e88f843dec080efd318b5/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8d83f2faa9e72fded29e88f843dec080efd318b5/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.16.0-canary.b3e53981.0","_nodeVersion":"10.21.0","_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","dist":{"integrity":"sha512-zxKx1IgIb+phu5H4KHCzIozkUtAagCHffXMVykrLG+0KjoLMK9IMcfnQFnTIQFUkEoxkd4G+96hmeM/ARPCneg==","shasum":"f494774105a58c87a2e465d6d85883703e7f0099","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.16.0-canary.b3e53981.0.tgz","fileCount":16,"unpackedSize":261203,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe8qCrCRA9TVsSAnZWagAA8GAP/Ahh7oYY7VwixdLxVmtc\n08ohim2/QQl238qI0sLKh+s/OPckBBpT97ak9u3R2e5iLcIdU17aGRkI9DNE\nigZjellwTiteAv3mX+ev2I2zRi2yXuXTHTRO1xAHmp67/paYD/TwnPHYigfw\nCa78LebT3OZPvZVBefIkbZqfBvl19PMLoGuId1c1vnb4FnID/3odPDRK2A73\nQK5pjDrCsvURdLhMllF+sqw1AbIbYy1IQHtmQcfDavRODvu9szK00g0aSTfu\n9NJlI61gEyvxZVaMiIzQ9LAAbY1bS9vvezTMYVQZm4ZtLSlRIu3e+uPJD15f\n0Njd6kLceP7kImnm3ZRKdN2saRbLY9IHUkUSBxQjyyhWoohpybhX1TqrnuDA\nFV/MirtsDQb3jUDQ546qx39ZPRTwVF7f1uVyCOkuTPzvNaaWGeSJ35ZgsfsS\nYYtlNSIHDtrhiAIB8Ng/v6K9Lz0es0xNans4PArUnUbPAWgNC73pvFUqRpSx\nHgscFbIx2V+PJ/g38lbjGh/7qu+5/GYHKiVouSImb7V+boZC4kSAw4zjeqdv\nUC0Ovi1M+C0fJMg3W1fvAn9T3n7UaarGPTSCV4hS1aE0CC9It8z0HDz3bys+\nKxLPSfFWb02z4ekGrGr2dkbeANcfY4YFAWQy0H0g5II7XtwrzVbTl7F5uOMF\nSAUc\r\n=YTqJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDaohT/SEfJRgagJocZgYOvtGBAbzfJNlIOTFmjDgML3gIgQitjItzpgpDv3C1p6LrINn7cA3NS3BMeWe+oVIO4V0g="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.16.0-canary.b3e53981.0_1592959147103_0.8347618980056464"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.16.0-canary.b9468f77.0":{"name":"@material/mwc-textfield","version":"0.16.0-canary.b9468f77.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.599b8c319.0","@material/line-ripple":"=8.0.0-canary.599b8c319.0","@material/mwc-base":"0.16.0-canary.b9468f77.0","@material/mwc-floating-label":"0.16.0-canary.b9468f77.0","@material/mwc-line-ripple":"0.16.0-canary.b9468f77.0","@material/mwc-notched-outline":"0.16.0-canary.b9468f77.0","@material/textfield":"=8.0.0-canary.599b8c319.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.16.0-canary.b9468f77.0","@material/notched-outline":"=8.0.0-canary.599b8c319.0","@material/ripple":"=8.0.0-canary.599b8c319.0","@material/shape":"=8.0.0-canary.599b8c319.0","@material/theme":"=8.0.0-canary.599b8c319.0"},"publishConfig":{"access":"public"},"gitHead":"89bea892912be98e07d72fec0e142b11d1874487","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/89bea892912be98e07d72fec0e142b11d1874487/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/89bea892912be98e07d72fec0e142b11d1874487/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/89bea892912be98e07d72fec0e142b11d1874487/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/89bea892912be98e07d72fec0e142b11d1874487/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/89bea892912be98e07d72fec0e142b11d1874487/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/89bea892912be98e07d72fec0e142b11d1874487/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/89bea892912be98e07d72fec0e142b11d1874487/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/89bea892912be98e07d72fec0e142b11d1874487/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/89bea892912be98e07d72fec0e142b11d1874487/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/89bea892912be98e07d72fec0e142b11d1874487/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/89bea892912be98e07d72fec0e142b11d1874487/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.16.0-canary.b9468f77.0","_nodeVersion":"10.21.0","_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","dist":{"integrity":"sha512-EH9O1phqwr8I4xc1OKCLDtfJRDy0N8rruuSr4nYCcXjo8VOQb2DqkYx9msB1juuH6D+s6SB5SaMC7uD9uRALxA==","shasum":"dc374cb78b177d62c20083749a7ba410353fb684","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.16.0-canary.b9468f77.0.tgz","fileCount":16,"unpackedSize":261203,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe88uKCRA9TVsSAnZWagAADh8P+wW4ZWIvFTSo1HMsPmYP\nSYhYMiWhNB2St5y2jvqKjzLjdw+5BiFDRc3PUvR41riXwTIufpAH5nc76PxS\nafLcpEdc9nlxXC3nA4swhuOHBNvw5eGdGgANZAqPOvXvWcsVA39kdoNQFyZG\nPtk3/cyk/QsKmrIIX+EyBTRpJhNAlp61MYOEdM1zUfsczWhNvuKdZ3d/uZai\nM5zdG50+kgVYi+x5k4VacMtPff2Lstxwez5ufRviH1CuBRqdH6HaMMxoG3Oq\n4XlfL6Iwq34K+3txJjicpxHt1XMHgoGlxnUZp0MieaY+jS4VJW80deWTWAmC\nNY+SNVxfhvel/Q1oc3iArJ+d5UVeWTkD3b/OhmuK1QfDgYnfjSwfiEWNhZt7\nb/1lLWSiLF03Fb7Gxa66qIAFPZTtZ4G4i4fnni4/EsyZPcJL51IBhInDXL/R\no8NW83O7qHuQA+0aPMSCNtocVecu7ufMviTgqyznwRNt21eR1pTLzslnTc9J\nkVReddsVtd5mQJkjgErXg+2YPaCMkouuLxzacdcQL+qWBJhwMrIDLWbMgOr3\n4xeU170O6T5Az3wMh+5x3Z7lCIKpUawrQ1X20xZQZOGUMDr2SIBLhZMI6ztu\nSrU+CY/llBndXkAdxp4Up/Uag59gqBrL4s2qWQXpJybX2rbukjF+uz7oTsx3\nTwt1\r\n=5AQf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDNQjI09aK1/ttgltxkSqwa+PtVdiA2USrQENp1tTVrZwIhAMrrhxhOPV2s4oIX20fId1RcBHo0fP9kd9cwtZPPIkIB"}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.16.0-canary.b9468f77.0_1593035657805_0.5249660892681511"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.16.0-canary.eb790e49.0":{"name":"@material/mwc-textfield","version":"0.16.0-canary.eb790e49.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.599b8c319.0","@material/line-ripple":"=8.0.0-canary.599b8c319.0","@material/mwc-base":"0.16.0-canary.eb790e49.0","@material/mwc-floating-label":"0.16.0-canary.eb790e49.0","@material/mwc-line-ripple":"0.16.0-canary.eb790e49.0","@material/mwc-notched-outline":"0.16.0-canary.eb790e49.0","@material/textfield":"=8.0.0-canary.599b8c319.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.16.0-canary.eb790e49.0","@material/notched-outline":"=8.0.0-canary.599b8c319.0","@material/ripple":"=8.0.0-canary.599b8c319.0","@material/shape":"=8.0.0-canary.599b8c319.0","@material/theme":"=8.0.0-canary.599b8c319.0"},"publishConfig":{"access":"public"},"gitHead":"722b9fe701d60a27c2554032e63a2a7579ed4306","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/722b9fe701d60a27c2554032e63a2a7579ed4306/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/722b9fe701d60a27c2554032e63a2a7579ed4306/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/722b9fe701d60a27c2554032e63a2a7579ed4306/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/722b9fe701d60a27c2554032e63a2a7579ed4306/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/722b9fe701d60a27c2554032e63a2a7579ed4306/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/722b9fe701d60a27c2554032e63a2a7579ed4306/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/722b9fe701d60a27c2554032e63a2a7579ed4306/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/722b9fe701d60a27c2554032e63a2a7579ed4306/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/722b9fe701d60a27c2554032e63a2a7579ed4306/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/722b9fe701d60a27c2554032e63a2a7579ed4306/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/722b9fe701d60a27c2554032e63a2a7579ed4306/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.16.0-canary.eb790e49.0","_nodeVersion":"10.21.0","_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","dist":{"integrity":"sha512-+Vfeu/uRHqBQW5fa+ADc4cJ7GHC2hfD/YmNegSk8kfY46riiSgp1Aj4AXbsoMJpETet4R9ictLZXcI6yzqgTFQ==","shasum":"d10ddd6005e1c2cc8a35d8a39673fe220751b937","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.16.0-canary.eb790e49.0.tgz","fileCount":16,"unpackedSize":261203,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe9RS9CRA9TVsSAnZWagAA3lsP/3GgcCtAPlqQKMeebGx8\nLdwCr2olpnZlKO1DPSwQ++uHmA1AG8Adcd7r7OLf9essUMCeve0GrbyKTXGh\nXyP157veC8UNPmtesE/m+1DYMzErkoLGgkarohKcjEt+HAS4+yr49W87I4ns\nRUOKUzTGANGAZ3EpxiaPv+AHMFtDWwfIIvrfQDnrXXUMlbIE9bNtoxJHir2h\nmahl11fevYjKINGkA3gucUzUOLP86Q1eHQNm57CcW+h7xsEsdWSalIbrQ4kS\nDFxMyQvX9/BGRx6wlVtoeWT02UvfGHvd9GAeSpp1RyiRO40Dplv4XZpai4CZ\nElV7R09Cv2YMCZmBbleYJ4SdMlhuOoIDO5VE6FTmoWUi+ADEqOjr4x6dYsyr\nKF5zOc5SN2KSS8rjHX7p0THZ2tz25B73M0XpG/aj2hLyhrVOjnVaBF59X4L7\n8qBk/5Bs9wDvkuK3MY0MakN+xSvBvAaHXn4AfdV7ZXRAFwsCcIULppXG8m66\nlZkTlNU7hBg7ALTUd8WelACBvMBeAgQ9PwWrJIYGwTj/M67o11akfMhra+S0\ntXRBI0yDc5X/GzVOoTiHbZkFeHhg5wuDNYBegEyVKzzdl+Mi6mGeolh6o4/X\noksocTu5MrtsKNeWRPPUGOPr0wkJE55Ez8Z/CSkby/ZzIgttuDzLjfG5DUcs\nB5RM\r\n=4rgr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCSQ7RaQm6rB5tWG/OMDDmxpjkcp12xr2/zqBWfwwMuFgIhAKBDldula9xjf8ozx56WV5Nv1cTYJj9lvZU45wmGR0EG"}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.16.0-canary.eb790e49.0_1593119932765_0.011465177065409948"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.16.0-canary.9aa1a5c5.0":{"name":"@material/mwc-textfield","version":"0.16.0-canary.9aa1a5c5.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.38197b443.0","@material/line-ripple":"=8.0.0-canary.38197b443.0","@material/mwc-base":"0.16.0-canary.9aa1a5c5.0","@material/mwc-floating-label":"0.16.0-canary.9aa1a5c5.0","@material/mwc-line-ripple":"0.16.0-canary.9aa1a5c5.0","@material/mwc-notched-outline":"0.16.0-canary.9aa1a5c5.0","@material/textfield":"=8.0.0-canary.38197b443.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.16.0-canary.9aa1a5c5.0","@material/notched-outline":"=8.0.0-canary.38197b443.0","@material/ripple":"=8.0.0-canary.38197b443.0","@material/shape":"=8.0.0-canary.38197b443.0","@material/theme":"=8.0.0-canary.38197b443.0"},"publishConfig":{"access":"public"},"gitHead":"04b200e2b2832855ef5eca7e2000672e53739c05","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/04b200e2b2832855ef5eca7e2000672e53739c05/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/04b200e2b2832855ef5eca7e2000672e53739c05/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/04b200e2b2832855ef5eca7e2000672e53739c05/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/04b200e2b2832855ef5eca7e2000672e53739c05/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/04b200e2b2832855ef5eca7e2000672e53739c05/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/04b200e2b2832855ef5eca7e2000672e53739c05/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/04b200e2b2832855ef5eca7e2000672e53739c05/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/04b200e2b2832855ef5eca7e2000672e53739c05/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/04b200e2b2832855ef5eca7e2000672e53739c05/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/04b200e2b2832855ef5eca7e2000672e53739c05/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n### Fullwidth\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/04b200e2b2832855ef5eca7e2000672e53739c05/packages/textfield/images/fullwidth.png\" width=\"777px\">\n\n```html\n<!-- Note: Fullwidth does not support label; only placeholder -->\n<mwc-textfield fullwidth placeholder=\"Standard\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`fullwidth`               | `boolean`                     | Whether or not to make the input fullwidth. No longer displays `label`; only `placeholder` and `helper`.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.16.0-canary.9aa1a5c5.0","_nodeVersion":"10.21.0","_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","dist":{"integrity":"sha512-Wnd4zb7QyVBicei7KzTLmPxPztyuTuuy4qo2iBrLDe23B4niEXBFnMokoeq056L8zrvJqT+0IaHEXpNb73VdhQ==","shasum":"1c4c90157c0cf6939bcc2e38d8bc50d320e03b0b","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.16.0-canary.9aa1a5c5.0.tgz","fileCount":16,"unpackedSize":261203,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe9irHCRA9TVsSAnZWagAANmEP/0IbD9r7MWtp8aDRcvuq\n9UomSr1eNqlKsyCyNQWcvQtTbPmLudrP3+YyIfp8GmP4JxmHZloBb/zBw3gM\ng/GH2niKYq1vev8DFzOUo+M56zpPQMJDcjxxLpOlNOucoV+7ZnFX3v+RVe2N\nT4kB7D2bDHi4VnVRr/zYan1ux6II2ZtBBnyIvtv2h/VEaKmlPBQe3g1AlMfo\nDcjRWmtov8T6yv7F2MbMimUfGDzBwYQG4x3fMToKdkAVE0A6GsOm6aZ/tibA\nUkTo5TjcA6FVGC7lqmA/GXfT371/KM1yNUFouA4hYGeDaJDV+P/42OQ+r/Dt\nznyTO6GiPKWd11QoV4zVAcJTOwBvUdpaevK4puVW+wtowp19m9Y0Bz0QNc7X\nh1Ht77c8CsAB1AnJMNDASA8DEXriPiko+HF+2B+7ss0QO8oQNbqx+LFjjwDe\nk8Q07Xo3GxxgA7jFob5KCDk566cBxKK2eO1EuU+X+L84+WHamcGbTrX4mN9g\nr3TtFiHC2QJfGvH4AP86338Hqk+ytqyxJmiDIlHnYe8qJ15l6TyDCpztvGXl\nG1URB12N2D4oLXy5uN5PLyYrRNguWiVS6XdflruP2LSg0Zj8IM56wTabXa1M\nPTh+cLKd9gkSJGD1LMbE7SH6bjRcxQr/3s5Gbvd6+aZTAtbMFcjF+O3AE2/y\n8YiE\r\n=kjVw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHXp8zCXM9DvMZFRTZyAWIBOpupVAs1yTgahD2BT5tIpAiEA2wto6MSMcccaX1GY/xqM4+Z4RdfbOkBAt6NPDPc4Yn4="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.16.0-canary.9aa1a5c5.0_1593191111495_0.638892185153239"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.16.0-canary.d36e9861.0":{"name":"@material/mwc-textfield","version":"0.16.0-canary.d36e9861.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.38197b443.0","@material/line-ripple":"=8.0.0-canary.38197b443.0","@material/mwc-base":"0.16.0-canary.d36e9861.0","@material/mwc-floating-label":"0.16.0-canary.d36e9861.0","@material/mwc-line-ripple":"0.16.0-canary.d36e9861.0","@material/mwc-notched-outline":"0.16.0-canary.d36e9861.0","@material/textfield":"=8.0.0-canary.38197b443.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.16.0-canary.d36e9861.0","@material/notched-outline":"=8.0.0-canary.38197b443.0","@material/ripple":"=8.0.0-canary.38197b443.0","@material/shape":"=8.0.0-canary.38197b443.0","@material/theme":"=8.0.0-canary.38197b443.0"},"publishConfig":{"access":"public"},"gitHead":"06dd7e826645eff53f5923422d6024010828a4b8","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/06dd7e826645eff53f5923422d6024010828a4b8/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/06dd7e826645eff53f5923422d6024010828a4b8/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/06dd7e826645eff53f5923422d6024010828a4b8/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/06dd7e826645eff53f5923422d6024010828a4b8/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/06dd7e826645eff53f5923422d6024010828a4b8/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/06dd7e826645eff53f5923422d6024010828a4b8/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/06dd7e826645eff53f5923422d6024010828a4b8/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/06dd7e826645eff53f5923422d6024010828a4b8/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/06dd7e826645eff53f5923422d6024010828a4b8/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/06dd7e826645eff53f5923422d6024010828a4b8/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.16.0-canary.d36e9861.0","_nodeVersion":"10.21.0","_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","dist":{"integrity":"sha512-emJrB2t9+nWwIjJzPdUI6EmiCWp0M3xr90DHcxq7sZeHheVC9M1+Psg67jMjYcyi/HIX6oflhCdF7AJhTjClGA==","shasum":"1c4c32fa2338845bb48afd85dd6bcd8c69093492","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.16.0-canary.d36e9861.0.tgz","fileCount":16,"unpackedSize":259845,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe9jIgCRA9TVsSAnZWagAATCMP/1aAmoZrbrovFuCuj7qw\nYTOZqiNYGyENkMzx3ooXRGvjW0ZBWBY21MJ4gWJPsMbuEYVhIOPtThkb3RFK\nZynEwFpF3z8wn9rWdkxRkiQxOvTlKX9L/Rhga8WZ39F8IF/rSDRO6fRq9P7s\nL1g9sgzs5Op/RCYrxosdPndw3OYBJgMwxtlasQK44bIk7V+8nzJS/q/X3Z76\nh9XTWGZeLFUAUoFdXTU4elWzcuxmaHi7b4lAwTCdZidrkpmXXyWd6hEe5YUR\n1oZFLJ5UgcYDQTeX4PG/ssDR4RueCEV/FsKCHfpgOaV7EDhBO9g/g1Ef/T2l\nqnvlZSl6zCUd7schF7nYTsbgxYIssIBw+jbV9LcnIZTTm9uZAzYiuGL5Usfo\nP6ZmlSbyindO9+Srsz1i9ftsEai3Su9pZyX+if+77Y7qjG3xaIAwMQRZvwpE\nBfJSYPOUoiQfnJICcOeHVNoyTX+an48FUHn4andIAcaG7A3Xfv6rJHYf01UK\nIb7L9vgDymuWtqNXD3pBsV8FeUO6dDsz1u/qp0UtHdusM90kYoQufY/HKeZ4\nV/xZ8Xi25O40ZJ2hOBqr1M3j7cfIG1lP6YEf76KpGTKHQTb7WLD99VzV7FOU\noBs25QfjVA/Bq1Yrrtbi3znLDunovSoacpId3o3AFnyz1AvEcTqRakufImTx\nf6Y0\r\n=I7n1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDfwVBPL4nRx8vd6Lhw5fo2DMIq3zoMtUKi3kqZRwclPgIgR5Gv0a/SYO3UzpxICmt1vHpl3/rTq3HrwSvqvQQcpMI="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.16.0-canary.d36e9861.0_1593192992561_0.5805696434194358"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.16.0-canary.155c2f85.0":{"name":"@material/mwc-textfield","version":"0.16.0-canary.155c2f85.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.df7154fb3.0","@material/line-ripple":"=8.0.0-canary.df7154fb3.0","@material/mwc-base":"0.16.0-canary.155c2f85.0","@material/mwc-floating-label":"0.16.0-canary.155c2f85.0","@material/mwc-line-ripple":"0.16.0-canary.155c2f85.0","@material/mwc-notched-outline":"0.16.0-canary.155c2f85.0","@material/textfield":"=8.0.0-canary.df7154fb3.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.16.0-canary.155c2f85.0","@material/notched-outline":"=8.0.0-canary.df7154fb3.0","@material/ripple":"=8.0.0-canary.df7154fb3.0","@material/shape":"=8.0.0-canary.df7154fb3.0","@material/theme":"=8.0.0-canary.df7154fb3.0"},"publishConfig":{"access":"public"},"gitHead":"28a52966d069b05ddf3f845738ff3207532f05b7","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/28a52966d069b05ddf3f845738ff3207532f05b7/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/28a52966d069b05ddf3f845738ff3207532f05b7/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/28a52966d069b05ddf3f845738ff3207532f05b7/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/28a52966d069b05ddf3f845738ff3207532f05b7/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/28a52966d069b05ddf3f845738ff3207532f05b7/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/28a52966d069b05ddf3f845738ff3207532f05b7/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/28a52966d069b05ddf3f845738ff3207532f05b7/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/28a52966d069b05ddf3f845738ff3207532f05b7/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/28a52966d069b05ddf3f845738ff3207532f05b7/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/28a52966d069b05ddf3f845738ff3207532f05b7/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.16.0-canary.155c2f85.0","_nodeVersion":"10.21.0","_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","dist":{"integrity":"sha512-YQScDimPrYz5dzB2IvYCJv1JB/e1YN+mc7QLtcIK2+n04UjNGxAdUq5791PXZxWvQXSfRRSlN1f/B+zxji//iQ==","shasum":"ccc748b0e791e39173d42bd67f89444113b65a6b","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.16.0-canary.155c2f85.0.tgz","fileCount":16,"unpackedSize":256389,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe9oTdCRA9TVsSAnZWagAAFnYP/jZ8TJIJbZWTOWUmP6CU\n5moXjNshjVdX777qxLK+lON86nCF24ZeOtUsk/5E1MgSg7Y7DwUpgbWEsZ8y\ni2lM6lwxpv62d1Z9/JNQBbpZJovqiHyXrNwxqIzeltI62khIL5B0cZ9+CU2w\njSS+da74DjhokKTqcPfEGJrGJ644s+2iuiABISwBmXHR8sjJ8SQoP6/Hkwey\nGBujUDTYwNpIo4jR0442n69+bygsQ0SMy/o6HI/tZJ+6++SPAvQFx7y4y+Su\nT/Rzg58KU5s4s3hyNVKQSKPoD33M0WYLIZvIgBCs0RpWXdeHf7o9GAbXd+5Q\nL4Nb7rhbnmMMVyWpW9JzIx11zlzTXN8GjnGT5HSv1tX3J9zTZBhZmTNTN+wS\nfy3r/Xmz1oX1u+Tiz0g3/i7Y4ryUCyLc2QrifQSB4gUdWuSgVNSa4dWst9hh\no0Fy8e+XLN+gE5N4I/pbWIgtbJ5CIwE9Gz8fxrrwbNJiIWPAVPz400syGt6U\nQqfkEZVKth5O1fvpeaz+vrBbh2EO6dBz/a031TrHyJmSx/XxU/NEpptkpalz\nQkt2HF2oqblF93j3nSerJGU+KSM8AoUXEW0VenHdMQVvuYda0kVFbmSmr/ht\nHt3NFS5s7ZQ4YtGoeW5xHhQAuOf3XZXt4bvvZoQCwOxTHg2ZiiJWvYkB3Yk1\nHm8r\r\n=BEd4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDPXAJaADY3uApsS4dkcjpGMzaZo5ioeLNhr5JiSH1uEAiEA6IHBRYgWCRhyvHnQJPjkXvEnQyEEq4fWlaw20xyH3WY="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.16.0-canary.155c2f85.0_1593214172559_0.8440350617795662"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.16.0-canary.340c9c40.0":{"name":"@material/mwc-textfield","version":"0.16.0-canary.340c9c40.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.df7154fb3.0","@material/line-ripple":"=8.0.0-canary.df7154fb3.0","@material/mwc-base":"0.16.0-canary.340c9c40.0","@material/mwc-floating-label":"0.16.0-canary.340c9c40.0","@material/mwc-line-ripple":"0.16.0-canary.340c9c40.0","@material/mwc-notched-outline":"0.16.0-canary.340c9c40.0","@material/textfield":"=8.0.0-canary.df7154fb3.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.16.0-canary.340c9c40.0","@material/notched-outline":"=8.0.0-canary.df7154fb3.0","@material/ripple":"=8.0.0-canary.df7154fb3.0","@material/shape":"=8.0.0-canary.df7154fb3.0","@material/theme":"=8.0.0-canary.df7154fb3.0"},"publishConfig":{"access":"public"},"gitHead":"b65b8e518436cb4bcd2fd8c59ae2898f2715462e","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b65b8e518436cb4bcd2fd8c59ae2898f2715462e/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b65b8e518436cb4bcd2fd8c59ae2898f2715462e/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b65b8e518436cb4bcd2fd8c59ae2898f2715462e/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b65b8e518436cb4bcd2fd8c59ae2898f2715462e/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b65b8e518436cb4bcd2fd8c59ae2898f2715462e/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b65b8e518436cb4bcd2fd8c59ae2898f2715462e/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b65b8e518436cb4bcd2fd8c59ae2898f2715462e/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b65b8e518436cb4bcd2fd8c59ae2898f2715462e/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b65b8e518436cb4bcd2fd8c59ae2898f2715462e/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b65b8e518436cb4bcd2fd8c59ae2898f2715462e/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.16.0-canary.340c9c40.0","_nodeVersion":"10.21.0","_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","dist":{"integrity":"sha512-WOk+NptD+I4eFp7HKF6kq/JPQoBQmxRGkU0TaLZzqhhv+AVaHBj81ik2xc5DSSAYArbHPvgytVFyFHA/CCRMdA==","shasum":"405edbcd792b3b706e590d789faa246aff3265c3","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.16.0-canary.340c9c40.0.tgz","fileCount":16,"unpackedSize":256389,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe9obkCRA9TVsSAnZWagAAQSgQAIQZ2st0CtT0zGpX0zOa\n/E+mMBOZ4Dxw5t9DGk0yygWkgq9/DPkn4ibqmRUA37RTIpi7IsDX057epE0r\nM5hDZJn3RHk9qVFNERrjm056bXII4X3wa7Cx+vwdqs86WWcUG8QzQvzs1LHg\nTK6l9E6yiK9pwlsQu0X4t551T6/xJGUQJPxJEUcJePy15aKJQwDO09CNag+B\nAHpRSS5KzYbTCu5Tz3pQCn6Umq0rxCLZPWr7lutgOaTcsPgiXzn/7JnkKASu\nYkeB2L0APNBMr0d9TCYx2QbgGUtsxSUDxbWSkj3TF6Pvq61XZryo8SpetB5k\njMeLcdaIehqDHetGo/OWk2K4Vv1kz6LQjTmMBQhoBHXS28o47zCRJHJ5+x5n\nJjzdzt7S9OAvNd58gSa35FSuQp5htAyQ6egNcH48uSzx0lI8yTYz17bimbOW\n0aegSopQEAYorLzwkjei1+/APN5P33gkkL+sBw/CmwAMPlvVfZ0/OYe8pnO/\njDer4ZQn2O4H1X+oAG3tAjYj6cio64t2VOx2ReLdleBmCzQBWOWC2/h7pNyP\nu8pqCXlokOMQDdveYkIL74lshCS3wsWLYcWYZS0c/7l70jfjk7aHjycprTZG\nyFFze3ea3TSzXlGm7DRI95l55+m2JHTB1VcNOuF+ozxWSk+3eYi65qZ4lgoy\n+Xy4\r\n=Px5i\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDERcdZTkfJhoC0FDK1aeCUjAGBs9U2OBITWcoEpN7nagIhAIV3pqpOyCqkGX4RnyrrBIWvbGYPiO/OrNWwQzuz+vdn"}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.16.0-canary.340c9c40.0_1593214692364_0.4287081323749138"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.16.0-canary.a3384d2d.0":{"name":"@material/mwc-textfield","version":"0.16.0-canary.a3384d2d.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.c678a9d34.0","@material/line-ripple":"=8.0.0-canary.c678a9d34.0","@material/mwc-base":"0.16.0-canary.a3384d2d.0","@material/mwc-floating-label":"0.16.0-canary.a3384d2d.0","@material/mwc-line-ripple":"0.16.0-canary.a3384d2d.0","@material/mwc-notched-outline":"0.16.0-canary.a3384d2d.0","@material/textfield":"=8.0.0-canary.c678a9d34.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.16.0-canary.a3384d2d.0","@material/notched-outline":"=8.0.0-canary.c678a9d34.0","@material/ripple":"=8.0.0-canary.c678a9d34.0","@material/shape":"=8.0.0-canary.c678a9d34.0","@material/theme":"=8.0.0-canary.c678a9d34.0"},"publishConfig":{"access":"public"},"gitHead":"e09d50d940709441416a3ec78b0600a867285980","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e09d50d940709441416a3ec78b0600a867285980/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e09d50d940709441416a3ec78b0600a867285980/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e09d50d940709441416a3ec78b0600a867285980/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e09d50d940709441416a3ec78b0600a867285980/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e09d50d940709441416a3ec78b0600a867285980/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e09d50d940709441416a3ec78b0600a867285980/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e09d50d940709441416a3ec78b0600a867285980/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e09d50d940709441416a3ec78b0600a867285980/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e09d50d940709441416a3ec78b0600a867285980/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e09d50d940709441416a3ec78b0600a867285980/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.16.0-canary.a3384d2d.0","_nodeVersion":"10.21.0","_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","dist":{"integrity":"sha512-OII3nkWeDoPq6B7N/Np8Xz7ZRy04GLNWVjm6hZXDKzOP+ZGCOm8P0F3JDsOPccPe7fwn18tNVME3EFBlUjMFfg==","shasum":"5df1efcefa98d7d343e2af04d04a5968f3a8a1d8","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.16.0-canary.a3384d2d.0.tgz","fileCount":16,"unpackedSize":256389,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe+6fiCRA9TVsSAnZWagAAPSMP/jzChT6kNvl+T1LRIEdR\n5oVOab36MpZuYUWQUZucoI++nGnjkNTVoLp4wa7jhqil2dnSQuJBmbJhzeWT\nGqfBklxOhIhDK43MGQcW84da+sJeElF9vkPhkCJdVmlp7PYyX4d7p1Usa1Mo\nBpo624NLEwb2T2Ev1kTJfWShlAqDL7yDRlMDPUPggNCiESgkee/KDAu7u4Vn\nf0DEIL0G3/i8cXob+WqhDQZW9/BUT0WoFaS8tLRWkM1Vy+8dVDLHZliWb7bc\nGe3GsT9SmZHpeFLs6jkTWgenUc5cjnySQLD7wxvMZbQzKSqGbsMqrtKXsGik\nA+SgO9HoAftaodNNwL5fx0PeujP+PdTAQclu/ULpF41MMuQsR36oPwyr9tpx\ncsvdQQUwKkhPb6iQvICXJ/RlhPQsaxbDmSTQ/8T6dQnQW4athqljzapqgVyf\nFFiWIogj4mWY1LfSk6SikejbUyp5bL9uJHWbomNfAr2G25hrTE3rbSd/aD3g\nzWDUA9XlMT/tyO4bTebN23wJZW8pIHp0lzmG9rBq1vMTRfj4LhqLgb+L5jBh\nKNJ8STn07ffRNYN7ui1KU7cYQeGD3OS4KirtJElM6x7+TZscgS0JmaX//4vJ\nxAubiHnLphwHcwfnwYyeskfY4SoqdX+c3+RJ2npvR1GigjPUoNu/Qt+5mzin\nTLKR\r\n=GbXU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDoODXMAAYQmOZw29K1g/930WtLQS4rIRFhbLvAh6ye9AIgPBSP0f3NBrBgZlUFnJmrcnf2JqjvnDIkdHOypauRhvE="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.16.0-canary.a3384d2d.0_1593550818666_0.6648735934484997"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.17.0-canary.6d056c96.0":{"name":"@material/mwc-textfield","version":"0.17.0-canary.6d056c96.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.c678a9d34.0","@material/line-ripple":"=8.0.0-canary.c678a9d34.0","@material/mwc-base":"0.17.0-canary.6d056c96.0","@material/mwc-floating-label":"0.17.0-canary.6d056c96.0","@material/mwc-line-ripple":"0.17.0-canary.6d056c96.0","@material/mwc-notched-outline":"0.17.0-canary.6d056c96.0","@material/textfield":"=8.0.0-canary.c678a9d34.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.17.0-canary.6d056c96.0","@material/notched-outline":"=8.0.0-canary.c678a9d34.0","@material/ripple":"=8.0.0-canary.c678a9d34.0","@material/shape":"=8.0.0-canary.c678a9d34.0","@material/theme":"=8.0.0-canary.c678a9d34.0"},"publishConfig":{"access":"public"},"gitHead":"a0abcad0ecc43697e7c489d2c4ddebb257cae5e8","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a0abcad0ecc43697e7c489d2c4ddebb257cae5e8/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a0abcad0ecc43697e7c489d2c4ddebb257cae5e8/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a0abcad0ecc43697e7c489d2c4ddebb257cae5e8/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a0abcad0ecc43697e7c489d2c4ddebb257cae5e8/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a0abcad0ecc43697e7c489d2c4ddebb257cae5e8/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a0abcad0ecc43697e7c489d2c4ddebb257cae5e8/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a0abcad0ecc43697e7c489d2c4ddebb257cae5e8/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaping Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a0abcad0ecc43697e7c489d2c4ddebb257cae5e8/packages/textfield/images/shape-left.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a0abcad0ecc43697e7c489d2c4ddebb257cae5e8/packages/textfield/images/shape-right.png\" width=\"244px\">\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a0abcad0ecc43697e7c489d2c4ddebb257cae5e8/packages/textfield/images/shape-left-right.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield.left {\n    --mdc-notched-outline-leading-width: 28px;\n    --mdc-notched-outline-leading-border-radius: 28px 0 0 28px;\n  }\n\n  mwc-textfield.right {\n    --mdc-notched-outline-trailing-border-radius: 0 28px 28px 0;\n  }\n</style>\n\n<mwc-textfield\n    class=\"left\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n\n<mwc-textfield\n    class=\"left right\";\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.17.0-canary.6d056c96.0","_nodeVersion":"10.21.0","_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","dist":{"integrity":"sha512-6Qd3peggWXps4VdSezwgGenSEHFrqaBYajQvO69IrJdctVaYy+UUCrLDesQxN9xitmwjN9J/dRkUx/P+7Tf6Lw==","shasum":"36172e291d5676a5d92f3bf7e0fbcef94e93e310","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.17.0-canary.6d056c96.0.tgz","fileCount":16,"unpackedSize":256389,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe+6oZCRA9TVsSAnZWagAA8AoP/3snEpLeXU1SS7j7MkJS\nMv56hYXVOpFi6T+ecf3j8+4F2LXqZZ1M2YTQGLXL/898axKM2R5HTckfQ4qi\nMaeYtfJogkiOf0gUV9qP9syD4ckhuGT1w8TINboK0TCFkq2UMPPKv1zIPRPD\nG94tGOESYv99caSmjpxlM9+SDsQfCJljNjPzZcd7/Llvs4ojr0pkGwYXLuPN\nXX9RjN2we/3a0oX7opGMe052OBwP98itE4eVzXSg55V0RzISil8cxsu+L8Zu\n3DOl1T5bHtSpRsNFjkzA3oIgbyQFCxboDwuMYrTd6V/t1hRKnUlUaLQHhk4F\nJdHC6XuGqnmwvZDpuVHauVM4nK2+2oAbjv6Tjm20VSNOfbs7wX7IiCbIf3OL\nVYxa0vLClHzWTTSlpAMiGxhv445Jb6jnKJN8YSc3srViyiw2HOzgrmw29OVA\n6NEW12BpFDTfw+rm4QmVwpt7/KQWJ7no4FjUL8kEwJQCU/vMr48e8pQevpk3\nujSN0e4ZVFZiZ2SNlaea4trKYH2nhHqG8Zxij2xkhmnwxMmfA9WGLhafQMaT\nuaGsn980u2k9rY59wEsPwJ63+3ogBMcVXq80lYNF0Lg8b9So8zjvPHToDIXF\nznBWu11/01abLOB1qoDSH+lWXbWXfYU8zCmJ+RBv+cQCGS4MjJLFBA6bV00+\niITc\r\n=Finh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC6cMELFi6WL11fFWps3pg7A4slHf4deFeXABD/LwVcvAiEA8lQGIPwtW83q2XGoerRi8j/uSFuVX8ThbmqxvbE+0wU="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.17.0-canary.6d056c96.0_1593551385056_0.30082178794406245"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.16.1":{"name":"@material/mwc-textfield","version":"0.16.1","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.c678a9d34.0","@material/line-ripple":"=8.0.0-canary.c678a9d34.0","@material/mwc-base":"^0.16.1","@material/mwc-floating-label":"^0.16.1","@material/mwc-line-ripple":"^0.16.1","@material/mwc-notched-outline":"^0.16.1","@material/textfield":"=8.0.0-canary.c678a9d34.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"^0.16.1","@material/notched-outline":"=8.0.0-canary.c678a9d34.0","@material/ripple":"=8.0.0-canary.c678a9d34.0","@material/shape":"=8.0.0-canary.c678a9d34.0","@material/theme":"=8.0.0-canary.c678a9d34.0"},"publishConfig":{"access":"public"},"gitHead":"3b47995b0b098b9e7dfcc7b735eb23e892cbffcd","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.16.1","_nodeVersion":"13.8.0","_npmVersion":"lerna/3.20.2/node@v13.8.0+x64 (darwin)","dist":{"integrity":"sha512-uNaO12yvGgWRGoFT+079R8KpvcAQCNobldG1bqfakgLTkVA/jUCApThypgV5bpeYS2arVW2pIqnU6+q3r7DQbQ==","shasum":"cc4a6c50fe40c99f6f3d8f776b969a061d947c4d","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.16.1.tgz","fileCount":19,"unpackedSize":260334,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe+6tGCRA9TVsSAnZWagAANJ4P/iiZM2ftsPB05IS5UKIR\n4+YpFGowoEZV0JAKRVuIvWYPsNLYx++ZVsGyjeTNcNGvf1H/obh/qZPJRzBT\nKBPf0r+aoutsY3Mxp4q/oM240EhY1e90H9V0kK19LofyZYWmRxp6YdjPXc5s\nBWoH9VEaRqtWozEH/huNoKmmO3GWuvcaT5aMxImv3PnGCINHJy9L20KsQTGh\nF/N+NxrlNJoCh7Cxpex5ItxSOZmT3Lx9MHviOR0udgxyfnkFolV1c6quX9vm\nJJuAL7SrVn0UiL0KejTCOk9XpvJHNfBS/XxR2PjxffS/TI0WknPh/r437mlX\nbZOAUKPHfO6NNUzMNirtbbgHu2a9T9MOec7WPu+eZH8so8wF7KCuOtPKBva1\nY7M/f1OgcizemU5JkNSUd8IXhFnPFC/gCmBgNVXQWlbOgs1UVbi/pFZN1TsC\nzFzINscLXBFxt7WY8kCyuzpTKrX8+mVTOw9ATvrVtPum+oGimv8OWNkP7Mtt\nCPk6aDumAvlSjbQZAtZYcIGawLT7kbVVA9w6nvO0Nz84bj5emiosBayf2kcc\nG+PxmZ2gHNscnCO3XQDrFD9NQM9t4izloHo6huE2CSq/+6gA2iiyAKI4O3+u\nclppLE0oc9T2IJG+00nk9tebM/0efOl2cH/wFzq7zNyGVoEU57pTsb9NsgI7\nIMcM\r\n=6lRB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH5pQ/KcvPznoIPI3+rVT4nJpQbuKFj8keHLtf1PPtZWAiEAs7wHilyIrc35EhOJAu3NdiSNz56yqqvnp5OVcpZxhQw="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"emarquez","email":"emarquez@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.16.1_1593551686381_0.7999888543347813"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.17.0-canary.f7e37607.0":{"name":"@material/mwc-textfield","version":"0.17.0-canary.f7e37607.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.c678a9d34.0","@material/line-ripple":"=8.0.0-canary.c678a9d34.0","@material/mwc-base":"0.17.0-canary.f7e37607.0","@material/mwc-floating-label":"0.17.0-canary.f7e37607.0","@material/mwc-line-ripple":"0.17.0-canary.f7e37607.0","@material/mwc-notched-outline":"0.17.0-canary.f7e37607.0","@material/textfield":"=8.0.0-canary.c678a9d34.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.17.0-canary.f7e37607.0","@material/notched-outline":"=8.0.0-canary.c678a9d34.0","@material/ripple":"=8.0.0-canary.c678a9d34.0","@material/shape":"=8.0.0-canary.c678a9d34.0","@material/theme":"=8.0.0-canary.c678a9d34.0"},"publishConfig":{"access":"public"},"gitHead":"898d9ba1603fc85a0dd4f96b0dca134bf20f6b37","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/898d9ba1603fc85a0dd4f96b0dca134bf20f6b37/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/898d9ba1603fc85a0dd4f96b0dca134bf20f6b37/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/898d9ba1603fc85a0dd4f96b0dca134bf20f6b37/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/898d9ba1603fc85a0dd4f96b0dca134bf20f6b37/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/898d9ba1603fc85a0dd4f96b0dca134bf20f6b37/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/898d9ba1603fc85a0dd4f96b0dca134bf20f6b37/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/898d9ba1603fc85a0dd4f96b0dca134bf20f6b37/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/898d9ba1603fc85a0dd4f96b0dca134bf20f6b37/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.17.0-canary.f7e37607.0","_nodeVersion":"10.21.0","_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","dist":{"integrity":"sha512-hx6StJYKCsTNW7Ex2JwTCPp9AqBB4cJENVlUOMUwCAYKuqEC9TdCPt0flC+PUeuEoVcEGWOlOGUkCONSVCtUFg==","shasum":"cac9ac0422f04eff2b922a5720f4b112e8b5bb2a","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.17.0-canary.f7e37607.0.tgz","fileCount":16,"unpackedSize":255085,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe+7I0CRA9TVsSAnZWagAAmfMP/RYV2l9dCmtGfK8qMbhX\n9C4+acCXwXb4yBBfRJo33RR46WroccD0TNt+uOumj2e46T1qpSdnuqQtxYb7\n+5PseLYPvtNGF01+OHTuKjow6X3S39nl7Rr/TsGy1BxktFf18QvlNR/GjNtp\nM4tyyfXN6vLaAV7po7T9+N5XpGdz8cGzlUE5BhVGcd35P9DaVxJ5XM1UmQkB\n0/s8dwo10sed1MNnliDHaESeahhRuCq3PtHQSVZETSVECGI7pdMrvZXCCAw4\n/V9s/LbmODLliA/3nwMdg2uMHm+lyvcI+sRfeEnSRmA9K545wnfEGsKSwIXZ\nzd9mm7BxTBKt7AGxw56Sa12h+GtQZlOkAmWQxfApYmO9E1GC44/07yjBs26v\nlnc5C1NnzxelPbZevgeNM5ibre11qxTAMhXm0YNkXPb0J+JdlY6ZIbkUQpZY\nQn1p7UUIFeObUjIHSFoLb8rMWat6VhvU1j3yde9B8shiMLDPvpTTMKCCV6rQ\n60axdtB2va8qPeD1FUh30pxtW3nERUKqZZQaftdasU3Gz6DY1+CjPIf6wAJa\nHYR2+83S9mxTPF1j/+UfPpOMTWF0GxKeAanBg0gaWiqCcLfEBFOyikKaSbhg\nFpPyh+IlAECJnVjT2jTPEL0PW1rKGzRE1QBdBeVTEn84ovyQjviggwWwOp5U\n+GUQ\r\n=4KTs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBJFbJlQiYkvf2HueBJINCYJy4TRN7KHSKxKsEKe+SJxAiA5MrWIPTwow/2PqtWggJhQE5DlScYqTBtgFEgJrFy+cQ=="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.17.0-canary.f7e37607.0_1593553460137_0.21921905209641523"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.18.0-canary.0afbfef2.0":{"name":"@material/mwc-textfield","version":"0.18.0-canary.0afbfef2.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.610c26c4a.0","@material/line-ripple":"=8.0.0-canary.610c26c4a.0","@material/mwc-base":"0.18.0-canary.0afbfef2.0","@material/mwc-floating-label":"0.18.0-canary.0afbfef2.0","@material/mwc-line-ripple":"0.18.0-canary.0afbfef2.0","@material/mwc-notched-outline":"0.18.0-canary.0afbfef2.0","@material/textfield":"=8.0.0-canary.610c26c4a.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.18.0-canary.0afbfef2.0","@material/notched-outline":"=8.0.0-canary.610c26c4a.0","@material/ripple":"=8.0.0-canary.610c26c4a.0","@material/shape":"=8.0.0-canary.610c26c4a.0","@material/theme":"=8.0.0-canary.610c26c4a.0"},"publishConfig":{"access":"public"},"gitHead":"22b3cf02901c0c438f1e4150ce9513d5f45f21d1","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/22b3cf02901c0c438f1e4150ce9513d5f45f21d1/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/22b3cf02901c0c438f1e4150ce9513d5f45f21d1/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/22b3cf02901c0c438f1e4150ce9513d5f45f21d1/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/22b3cf02901c0c438f1e4150ce9513d5f45f21d1/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/22b3cf02901c0c438f1e4150ce9513d5f45f21d1/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/22b3cf02901c0c438f1e4150ce9513d5f45f21d1/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/22b3cf02901c0c438f1e4150ce9513d5f45f21d1/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/22b3cf02901c0c438f1e4150ce9513d5f45f21d1/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.18.0-canary.0afbfef2.0","_nodeVersion":"10.21.0","_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","dist":{"integrity":"sha512-PbOleCjEfcGBh0VyjVvR32KRqKf6IadqSFqwsVZWH+H3HG4NF7ACAFj7KcAT8XqGRsgul4i93cv+bdoF2GQxiA==","shasum":"62cd367f0c68969cb19dd827bbda9ac42f97e964","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.18.0-canary.0afbfef2.0.tgz","fileCount":16,"unpackedSize":262084,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe/OeJCRA9TVsSAnZWagAAhKAQAKLtLad5ZhCv94HSgT9n\nS190G9jrtGBYaKfLYXnnoe3sJ9jI1Udk4RaF0CKPiUsfdrCxE/hz3RP6B1Ql\nHn3fYCuOdCGi1RZt0DGLuDagV4Cbapi1otimivtyMqFWtL3QivYapQ4YUT8Z\nGFe6dCIvYPRXxdO9SIDQ/jV5sjtgeJtpvXAnR97ZwkjQFeRwCJffT0TdS0Dd\nrMUZyEQ/ml00EKbJdIsTcB3A9PWwPPP71SGR6pdWl7JvySP/PbkFwxkSiJMm\nrsTBN3IkSNsPH0R7bBv0WK8XfnUV2eT2XcPHFEUz29jen/cI7ZFkSnm1NDH+\nZbdCDvORRUi0IIXPBozQtd2wMTRb+VsN/pf3PEiOlUceMntcwBf10dXgRZDZ\nzhl2joV91QmfgmPFigRx3Vb/obhWllltU3K9SaV/PHJUsA0s4aTtL0k474vl\n99/d8xvPMdDnSw4LsAMQEPgtdaS/FDwUkd0dKP3WhwllS4kpmI9Y1bYc7saQ\nAlbAuK7K6Y9q1ZrS9ZZA4fO4FjeuB77noVGrKHhTB61YYa5L67v4pU10Ibj/\nFVRQuQEjd3hmJip+unKUHs9TvKvxsws6DtfmKsvA1Q8MkNYhzO/n0hEZ6Wao\n/FT5zWVxLVDDEsoQSNe+wCWfypODo3SRd1qO7BS1FBHnK7DK7EN7pI1llFro\nYNw4\r\n=1KaC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDUy6AsxjLP0hyGwjyfzoW/NDjuH3UCHBwsfqy8Nxf2wAiEAt1tn63CgaPjzvIx7IcefiRDBaeeaCKwkJKrCMWanwuI="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.18.0-canary.0afbfef2.0_1593632649261_0.05236795862289911"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.17.0":{"name":"@material/mwc-textfield","version":"0.17.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.610c26c4a.0","@material/line-ripple":"=8.0.0-canary.610c26c4a.0","@material/mwc-base":"^0.17.0","@material/mwc-floating-label":"^0.17.0","@material/mwc-line-ripple":"^0.17.0","@material/mwc-notched-outline":"^0.17.0","@material/textfield":"=8.0.0-canary.610c26c4a.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"^0.17.0","@material/notched-outline":"=8.0.0-canary.610c26c4a.0","@material/ripple":"=8.0.0-canary.610c26c4a.0","@material/shape":"=8.0.0-canary.610c26c4a.0","@material/theme":"=8.0.0-canary.610c26c4a.0"},"publishConfig":{"access":"public"},"gitHead":"0afbfef219df4add1912c90b8608ac93135d876e","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.17.0","_nodeVersion":"13.8.0","_npmVersion":"lerna/3.20.2/node@v13.8.0+x64 (darwin)","dist":{"integrity":"sha512-DJ8PNPIGQm4oUWKfdF3pOtbbJp4eIf746GlC7w5bgpvVMh35rCWtRD/+VWJNy9nokK9PDjPD3sLn5Chz8Bf9Xg==","shasum":"f72bcbe7e4cc8a23f7c7e7306a3b1d4b1c7653c0","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.17.0.tgz","fileCount":19,"unpackedSize":259030,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe/OecCRA9TVsSAnZWagAAJLgP/ix1X0XwrA4DQY2WClYb\nSFJrusCVpeWQQIk/dhpgv6vSJ2lKLfJ8T6trk/2gk5wEpzMbHrQv9oT1hw+o\ns4Ytmqu3nh83Un1MMojgFUkJNkFeDys2ar6zv2TTlrUAadBGLsm+K9ZQDQKK\nQ+wha8tbi3Y00yWEtMe0O1dokPRA5yzDTPkgxa3yS/ujj4JmFimEBYVcZlD1\nB1sZAT+pa8lZ1OydIezuiXPM5g495PCUwZ8wTP0SqgakcjX+nS86y+cI1CgC\nX01o7YXaXhrHNN5C6KNXSC8ShHCurS7yyeH4i4DXUu4QrnpdKTUAdUB3B/oR\ngeHHQQFKv3SFyVYnVmBf+E/ZAOmcnUaNzOPZFK/nVIpkRM2OBZgoww6vaKXP\nHz91ZKE3xHKj/pcata1SVASlH/YbRcys0QKIaNomuQcErlRHHniYDsEECdE2\nZoBchwWbd/W+/WDNYE8xqViprVODWqsw6twZN+oCLbo4TsPhlD1bcTBgQBNm\nifjwrbYW/NtYRSECHSliB9tb8EhW4SWLVDnME+SapbTZnpkMmfbzwswRo7Rq\nuC/aAK+u2xuZuNIQrsu+HIZ4RvQ+CcXromZgbgWf83DJMNkyqvK3Nn6AAlNo\nmhurbl+Ppc+PiMJLwkUwVOKAVcFnK1Rg/QVPg9ki1icss+rn/SpubaplRL06\nJUs9\r\n=zPz9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD+UT9SV7BZFItiw7siSMfzLb2vUOmvszo//plqyWWLDAIgCxJTq2yPSK/t8ioInheoHcJmjmbC60zzObWhLsQEk20="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"emarquez","email":"emarquez@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.17.0_1593632667543_0.8723770550787107"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.18.0-canary.fd970958.0":{"name":"@material/mwc-textfield","version":"0.18.0-canary.fd970958.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.a78ceb112.0","@material/line-ripple":"=8.0.0-canary.a78ceb112.0","@material/mwc-base":"0.18.0-canary.fd970958.0","@material/mwc-floating-label":"0.18.0-canary.fd970958.0","@material/mwc-line-ripple":"0.18.0-canary.fd970958.0","@material/mwc-notched-outline":"0.18.0-canary.fd970958.0","@material/textfield":"=8.0.0-canary.a78ceb112.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.18.0-canary.fd970958.0","@material/notched-outline":"=8.0.0-canary.a78ceb112.0","@material/ripple":"=8.0.0-canary.a78ceb112.0","@material/shape":"=8.0.0-canary.a78ceb112.0","@material/theme":"=8.0.0-canary.a78ceb112.0"},"publishConfig":{"access":"public"},"gitHead":"7dc6a8720f1d1adb0ed9ae03d2ee54b539251905","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7dc6a8720f1d1adb0ed9ae03d2ee54b539251905/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7dc6a8720f1d1adb0ed9ae03d2ee54b539251905/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7dc6a8720f1d1adb0ed9ae03d2ee54b539251905/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7dc6a8720f1d1adb0ed9ae03d2ee54b539251905/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7dc6a8720f1d1adb0ed9ae03d2ee54b539251905/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7dc6a8720f1d1adb0ed9ae03d2ee54b539251905/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7dc6a8720f1d1adb0ed9ae03d2ee54b539251905/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7dc6a8720f1d1adb0ed9ae03d2ee54b539251905/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.18.0-canary.fd970958.0","_nodeVersion":"10.21.0","_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","dist":{"integrity":"sha512-BDWfDGqyBVVAvogPfrcfl9KJt6hQkdo5QSfntFllLWAJa5QkAyFEh7ZnlRMl3VLvbcbi+eY9KVfDP3BsYCN9+w==","shasum":"270090351edcc243e4968c374052e980989c895e","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.18.0-canary.fd970958.0.tgz","fileCount":16,"unpackedSize":262084,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe/R1DCRA9TVsSAnZWagAAr+cP/j/0vf/bIWvm7kx8obFe\n6nq3vae+EHr9GNwHRDbMLXG/Hd+uGygEnDG7u6V4F8oIpiC8bZvg2JwENPjB\nIfI7k2zt9U7oTeX+V0lsahtz/UBpDY+KnDYKQvxfQMuMFZCADvw6Q3xv6Cba\nw6P0qg9NSgrZeQX4eyWfkTeaYJOYlUzdTPHNW+Sazc7ehD3uUNHeM+W36P0O\n4veQ9jySobIkPrjpyZmqiYEo1+we8vugoR4h7fgpJ4d4jbUlKuqnd3AOFIRi\nDeQhtpqXdnt1ItBjSJVdUAH87HC+2ea+tMP4/UZzEkKtE1a4pp0DSBWs3GiO\n4KKDX8xAq0+jz/M1NUAwS8G+aHGuDO2Kx13Sp33fgYBeTsUdpmpdlSRjU1I6\nqMOI+rKDPgIVw+eCGagNpQ/lbQ5OzP/iArD3RB4BtI9f5kRD+rW29sQaRe0D\ny19N5Fvlazo8gDHHGy5HdrF58VqcgwZbCJp5sODc0RvF2gI5fntNxYKBaz+Y\nBpjzRYpSJkAl5n24hyAj1kIZskGDIaWosdKBVoVBsanExPuLEhlD/jfC3SCv\nLHtHspABur9hmx/MhM7wTnfXSYF6zjiitcRS3ySJdKWk0VqsNU+4pAKbdYY9\nb06uRQRe32zwMhRHHlTteOatxhuffxZ+7QWvlZO1qHVKvuddvIfQxRIx1FOP\nH+VM\r\n=4/Di\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID+TQ+DGOUzW6TXrjortJbMTmckl9whARxRnotKMAlM/AiEAr+ffBVFC+TlxfhzP0f2Cl1+BXHfeJrV9AKb+hQPc3Es="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.18.0-canary.fd970958.0_1593646403599_0.622620717509339"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.18.0-canary.fd44be19.0":{"name":"@material/mwc-textfield","version":"0.18.0-canary.fd44be19.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.a78ceb112.0","@material/line-ripple":"=8.0.0-canary.a78ceb112.0","@material/mwc-base":"0.18.0-canary.fd44be19.0","@material/mwc-floating-label":"0.18.0-canary.fd44be19.0","@material/mwc-line-ripple":"0.18.0-canary.fd44be19.0","@material/mwc-notched-outline":"0.18.0-canary.fd44be19.0","@material/textfield":"=8.0.0-canary.a78ceb112.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.18.0-canary.fd44be19.0","@material/notched-outline":"=8.0.0-canary.a78ceb112.0","@material/ripple":"=8.0.0-canary.a78ceb112.0","@material/shape":"=8.0.0-canary.a78ceb112.0","@material/theme":"=8.0.0-canary.a78ceb112.0"},"publishConfig":{"access":"public"},"gitHead":"19ed8b1c754f72137cfbe305df2c3a6be32c041a","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/19ed8b1c754f72137cfbe305df2c3a6be32c041a/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/19ed8b1c754f72137cfbe305df2c3a6be32c041a/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/19ed8b1c754f72137cfbe305df2c3a6be32c041a/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/19ed8b1c754f72137cfbe305df2c3a6be32c041a/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/19ed8b1c754f72137cfbe305df2c3a6be32c041a/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/19ed8b1c754f72137cfbe305df2c3a6be32c041a/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/19ed8b1c754f72137cfbe305df2c3a6be32c041a/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/19ed8b1c754f72137cfbe305df2c3a6be32c041a/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.18.0-canary.fd44be19.0","_nodeVersion":"10.21.0","_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","dist":{"integrity":"sha512-glVGt17wgn5AxDoS4TxaF/lLEDMXmxYXSDF7ab395kGnPelrtSiHDQrYNdEl+v9NNcd4puU8NJK/gLDMyiTiTg==","shasum":"8316cdf34a5ff332cc259081a0297f1cebfba4ee","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.18.0-canary.fd44be19.0.tgz","fileCount":16,"unpackedSize":262084,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe/XUvCRA9TVsSAnZWagAAhpMP/0DeQ8D7u29IXPzDOWCG\nwrumN1eqg3zRB3AHvK0WF1JS/H+ESMB7uE3ztTx41qte/LXlJFacsryVYtqo\nVoLAYWZh+xN8o72TnI/9b8SsyZRSiAs7FtaIrpixCFtVWQTvfVhgp9N18QbH\nP/DNl32VN+kyeEbzUARFsFrwjwluN645TohHlsX9GEaWZW+y40sMFsT7v5MM\nbz3PYIzuLxeE0kOBESK0tCW0ohKh5RgpVSzYliiuIQXfIaL/k0tV8eUtkxiT\nedy24guYKV3s0FZjJjk1mkMht8efmAsYZ2s4eZLVCcKi8iuNQIeq7Wvfx+PX\nflitIkzgAkB1T8A8O5mDHcLburVr0sKm4O6hOORnOsia1nPPY1belQGtvwiM\n/ITlf87nHMl8nPeZGc5S9yM/aFiIJMrfxB4GtGGFOpcwxvnfBnp9WJlkMMxV\nN6EGbIDdJeee5ZJuZWz98xe+LSL//6UeTJDvs7NRKg/7PkIl3fjbTgvZtlBU\ngY98tvBCafJgHXzVpa9+Pi8wuWLZaaXpYVuI2rMxI3EzRxQ9YghBBVc+CSOX\nx8LzidNqXfbgG1rsnEsHe2lODlhBkSK/mo5OAblCEGpQosECge81BJYJ3AFe\nbALJRKSlsTnYyirR3+8oQQQI1WLXrnI9OKTvf3xoMuVXeWI92C+3+qC96U3e\nXIXL\r\n=be7a\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDxk/9Z3V+9Gmjbdx68MORVPoDYfZTdwNPjRlYQvb2gDAIhAL8U1x6stcyYWysn5hNAMt6w4SrO+Bo4K3D36CmVss+c"}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.18.0-canary.fd44be19.0_1593668910359_0.9554360871638707"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.17.2":{"name":"@material/mwc-textfield","version":"0.17.2","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.a78ceb112.0","@material/line-ripple":"=8.0.0-canary.a78ceb112.0","@material/mwc-base":"^0.17.2","@material/mwc-floating-label":"^0.17.2","@material/mwc-line-ripple":"^0.17.2","@material/mwc-notched-outline":"^0.17.2","@material/textfield":"=8.0.0-canary.a78ceb112.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"^0.17.2","@material/notched-outline":"=8.0.0-canary.a78ceb112.0","@material/ripple":"=8.0.0-canary.a78ceb112.0","@material/shape":"=8.0.0-canary.a78ceb112.0","@material/theme":"=8.0.0-canary.a78ceb112.0"},"publishConfig":{"access":"public"},"gitHead":"ca6fc6de0c0461ca30684d96cbb98b8885c8cc6d","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.17.2","_nodeVersion":"13.8.0","_npmVersion":"lerna/3.20.2/node@v13.8.0+x64 (darwin)","dist":{"integrity":"sha512-La3IYUqb9JsVsBwbIneL4ypbMdCfQ8YPBc4uId1F+j+FHZnkGhv/rIuHiys0fKUp2rv5LenHFTMDYuw+/O0gqw==","shasum":"4ec172320253970d031477b66c0a6437a0db2d4a","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.17.2.tgz","fileCount":19,"unpackedSize":259030,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe/XeCCRA9TVsSAnZWagAAm94QAKFFu6w9F6fIEJXSVi2F\nNi31wlgD22rFr71FBD8PuBxg2QUuqC9R3y3DDQd1BubqhN452bfY3aQ1ynrO\n9EkPM7KLICV1VFMdfdY0zzPFGx3VZSk7I/b2sDH1YnJ36kNYTlQTXmGp+bcK\noqxjyoNhtktPvlt8D08N6JRo+cODoa+GT+Z8OUGUIo3UQQJWzDldJ/CxiJpZ\nydhaOB2cZwLY/dwotQkYGTkBqVr/GnRjXPFG637Lt7qSxcVvxwW6A/V9cymi\nEN5RlREkYyUis5L6bUYo6L3XNpTChefuKvsa5lI0Ul9mFyyz890QhDLMh3sg\neVir8VKUU+ZISKAxDVULO5e6CfP/iq0amiSkVUKVjgGJqO07iH9RHLZfqKHm\ngy8N73a39SpfOHybXDlG6stDhwUj2uDRC8nJlnKM+wG3ZIn+A0mVGGHInME1\nw7ByrvHVgvBFBaRBacjNur5dMowSkjAMpTAzFaYCR3aqdIAStNnQlmgDvhQi\nraFuMRbnuXiI9re0P5g5c6ia+T6QFDHx6uid6ODcorqW8NpGXlmGlL1EmGeH\nw7NbZyvTykDYlAIzgCoIzfpj0BHO4dw5ikUbFNnJf4rF5NZ+BfVZZXB7CuGC\nCLaBwfrpwv7J4u/2ddveL/8Kh+DAzzINgyWepyBRShTTuDTUNJGkrqh42cXJ\nWIrV\r\n=PTKG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCyrwbsslGuKJAfTK5P8X7dsy0S0ujhMHkmBmVLZNn9pgIgbNDMTS4X3zFOTitjzY2C/Uyck80znCmSGMcDt/K6TX0="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"emarquez","email":"emarquez@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.17.2_1593669505706_0.6805575625478633"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.18.0-canary.ca6fc6de.0":{"name":"@material/mwc-textfield","version":"0.18.0-canary.ca6fc6de.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.a78ceb112.0","@material/line-ripple":"=8.0.0-canary.a78ceb112.0","@material/mwc-base":"0.18.0-canary.ca6fc6de.0","@material/mwc-floating-label":"0.18.0-canary.ca6fc6de.0","@material/mwc-line-ripple":"0.18.0-canary.ca6fc6de.0","@material/mwc-notched-outline":"0.18.0-canary.ca6fc6de.0","@material/textfield":"=8.0.0-canary.a78ceb112.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.18.0-canary.ca6fc6de.0","@material/notched-outline":"=8.0.0-canary.a78ceb112.0","@material/ripple":"=8.0.0-canary.a78ceb112.0","@material/shape":"=8.0.0-canary.a78ceb112.0","@material/theme":"=8.0.0-canary.a78ceb112.0"},"publishConfig":{"access":"public"},"gitHead":"ff7df8fd7df07e908061e32938ae550315d255d5","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ff7df8fd7df07e908061e32938ae550315d255d5/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ff7df8fd7df07e908061e32938ae550315d255d5/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ff7df8fd7df07e908061e32938ae550315d255d5/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ff7df8fd7df07e908061e32938ae550315d255d5/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ff7df8fd7df07e908061e32938ae550315d255d5/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ff7df8fd7df07e908061e32938ae550315d255d5/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ff7df8fd7df07e908061e32938ae550315d255d5/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ff7df8fd7df07e908061e32938ae550315d255d5/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.18.0-canary.ca6fc6de.0","_nodeVersion":"10.21.0","_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","dist":{"integrity":"sha512-i5+5kIpbjVlKRnBKvgh5S3/2yMTVmLJ6vLJ2Vs5+fz+cOudoS0yuBCzcW1QoFiOYMztK/VcTUv9GQtsUt7rncA==","shasum":"8f073c46c17a96fdd372a375e023f84538906eaf","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.18.0-canary.ca6fc6de.0.tgz","fileCount":16,"unpackedSize":262084,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe/Xe4CRA9TVsSAnZWagAANyoP/125FE/lRbZ1wO0om1G0\nXbZOMErRuGQVJYmy0JnaQgj5o4M03vciPRfFZ+pm8i1hC3fZKni5efvQrcr9\nMpZ7D9b443/dPszpgfrx5e/YZ5h23sZhCh+e77DKkdQgIXsbIubjvDnJKG/g\n2ZNXc8bojwrKa8kGtOlHMY5FxiHLdoNN0SSiosZPiJFP+FV6N6dWwF1sAdlz\nUu3clyifXH8RWZNRD3MwgfnTT4Nw6L9oyDpwt65YpIFxn0gABbOdYCWQKpIN\nRwB/nQqc+mgSn49SjiB7TTZNzNFE60MDpBtod5p+EIzl3uH8WAD5oQIbatIU\nM9kmJ72pYerLxFpchgnvW6lVXmvWVIiuDSWpo59EAC3XDlR3CeEoEZ9mRPu9\nCf3s6G2LO+nOWBwunwlgB3CS/AHhQ1f+zSn+icJMCfTyOiECg7d+uIw5NMgd\nBLqVgYxak9GSZfhJeHld9TMJ1Tckb0n+z/MA304BzNJ8zFBTQlJ2R7yO/g7Q\nqrc74Y1/Y64q/l25TjhrZlmo6YEoQiiPkPvChx9iSRTKh94b0SHKDvwhJR89\nIF9ot+hfaAR4q8cViTIsXlFaSDGytRFChn2BgGgO6QbQwONu9vSsYMx3fVF+\nZI56APCw6IRMx+DAZEHP+doFdI0FAcdmfeoSzsfs3AzkqtwPIP5CuZVkj32Q\nv9ht\r\n=ZSxW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICy655eUeOdZk/yjY4hjQwOhapnuouQ+5Px1G6hPdVTDAiBkG9xtiLXbA7lFztZ7hq5JhG3Rv9/ayityXhECgMi3wQ=="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.18.0-canary.ca6fc6de.0_1593669559586_0.9135386100050198"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.18.0-canary.79f1ec2a.0":{"name":"@material/mwc-textfield","version":"0.18.0-canary.79f1ec2a.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.a78ceb112.0","@material/line-ripple":"=8.0.0-canary.a78ceb112.0","@material/mwc-base":"0.18.0-canary.79f1ec2a.0","@material/mwc-floating-label":"0.18.0-canary.79f1ec2a.0","@material/mwc-line-ripple":"0.18.0-canary.79f1ec2a.0","@material/mwc-notched-outline":"0.18.0-canary.79f1ec2a.0","@material/textfield":"=8.0.0-canary.a78ceb112.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.18.0-canary.79f1ec2a.0","@material/notched-outline":"=8.0.0-canary.a78ceb112.0","@material/ripple":"=8.0.0-canary.a78ceb112.0","@material/shape":"=8.0.0-canary.a78ceb112.0","@material/theme":"=8.0.0-canary.a78ceb112.0"},"publishConfig":{"access":"public"},"gitHead":"28823685e1aac950044fe1d868c6233ae753ba7c","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/28823685e1aac950044fe1d868c6233ae753ba7c/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/28823685e1aac950044fe1d868c6233ae753ba7c/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/28823685e1aac950044fe1d868c6233ae753ba7c/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/28823685e1aac950044fe1d868c6233ae753ba7c/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/28823685e1aac950044fe1d868c6233ae753ba7c/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/28823685e1aac950044fe1d868c6233ae753ba7c/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/28823685e1aac950044fe1d868c6233ae753ba7c/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/28823685e1aac950044fe1d868c6233ae753ba7c/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.18.0-canary.79f1ec2a.0","_nodeVersion":"10.21.0","_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","dist":{"integrity":"sha512-rdUCdw8oRqWW34mujYUAR1A8FWsubUjlzQxn9uZwJk3jMiSoUQVmg+XfGtZYOEnITUbr4TI9MjZB4P5ThI2JkA==","shasum":"9e2b5fb7d99bbdb98dcf529989deeedf8b9b84e6","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.18.0-canary.79f1ec2a.0.tgz","fileCount":16,"unpackedSize":262084,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfBLGsCRA9TVsSAnZWagAAJYIQAJYd5A2AARJwm1D9Kcmb\nB7SuFyMO6d8Pilcy45cD2hBYznGhwC2EoNYqHfx96CQ771zoFH/z7vQ4Who4\neUGgsIZwyZhjZ73QBtyZxtnofpVotzAH+gNDE5OrccfEwvNEmdnGL4Em2IbW\nvn8cBQfpgVMDR0Kum29PDSD4nBlSVVSRpuK1q2Jinhe2H/Yliv5YcPGtNJAx\nHLxiwGet8ANTXC3d85xdftj4wRSlQ49+SMZINdULqL2dBCCYjjfwOCvp/o04\nRoAD7zYcm1EdRqeiCsxi1YH5uZhQpOLkOE4K+Bq/TPHO14JvbNxhvnN7BBzf\nw7zTFFquXkaFHGVXhz/2S1lqe4XGyywgOHTJtRCqB/bqvnE5Jitz7w0QMuQ0\nQvL3igwaIw8OfosNJJRbYMOT+94Eee29NSBkG2iI9dEhuWRgyk7FcbS0sPUz\nbfYbp9IZxtc6wKVcXFvuMwcPoOt4VwUumNUeQK6O6I+c7Jltky6HSnEuy0S4\na7gSsBv471vwFTcR2j1fDt2g3ASDfJYCNQSlZIjwMtMPT+4T+WkzPEZ1NrTi\nolN4PnS4XcQ9kmb6gtBWScPnSGuxAB9mDCyeQ2dZpx4NUcUFsqBTZtpKM3sv\n5RL/tDJfHJ+0LfQ6bhBU403XD6ExMGMLmiV2pKPoXOABPAZTOKSwczMjy98L\nfgAx\r\n=fOyA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDC0vcEKD/x5+5xYSdgKH55QqCJgFHkCKtK39GWzd8eqAIgU7tfDrdlVzEBtlBbhQHAaXNcex56dYE+9FJnbOe/GwY="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.18.0-canary.79f1ec2a.0_1594143147794_0.5751698774269154"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.18.0-canary.a7bc45ae.0":{"name":"@material/mwc-textfield","version":"0.18.0-canary.a7bc45ae.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.6ed717ddd.0","@material/line-ripple":"=8.0.0-canary.6ed717ddd.0","@material/mwc-base":"0.18.0-canary.a7bc45ae.0","@material/mwc-floating-label":"0.18.0-canary.a7bc45ae.0","@material/mwc-line-ripple":"0.18.0-canary.a7bc45ae.0","@material/mwc-notched-outline":"0.18.0-canary.a7bc45ae.0","@material/textfield":"=8.0.0-canary.6ed717ddd.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.18.0-canary.a7bc45ae.0","@material/notched-outline":"=8.0.0-canary.6ed717ddd.0","@material/ripple":"=8.0.0-canary.6ed717ddd.0","@material/shape":"=8.0.0-canary.6ed717ddd.0","@material/theme":"=8.0.0-canary.6ed717ddd.0"},"publishConfig":{"access":"public"},"gitHead":"fe14f2ba9c3850967039fb923e6ca39978290d3b","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/fe14f2ba9c3850967039fb923e6ca39978290d3b/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/fe14f2ba9c3850967039fb923e6ca39978290d3b/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/fe14f2ba9c3850967039fb923e6ca39978290d3b/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/fe14f2ba9c3850967039fb923e6ca39978290d3b/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/fe14f2ba9c3850967039fb923e6ca39978290d3b/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/fe14f2ba9c3850967039fb923e6ca39978290d3b/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/fe14f2ba9c3850967039fb923e6ca39978290d3b/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/fe14f2ba9c3850967039fb923e6ca39978290d3b/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.18.0-canary.a7bc45ae.0","_nodeVersion":"10.21.0","_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","dist":{"integrity":"sha512-RvW1PAcwlKfNchVFEIUl3TAko0CRcxrtAB4VvwEfUtktyW0SCdRAEP6KTwFEHbUyQFLx26uq3kZLn//GPc3duQ==","shasum":"b0d0ccd85b4956e09c51f9755d39e0116ecfdcb9","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.18.0-canary.a7bc45ae.0.tgz","fileCount":16,"unpackedSize":262084,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfB1J6CRA9TVsSAnZWagAAF+QQAISUYbho46TqBJJKmTQM\npOfPJNHlljA86CKwDJtEWzyF5tuqgcndzHRMlkLH0K/17aVpbV0QQhCNR+qC\naaP0XJyyjTHZYLhG2x9SF8tZeHAO5KX9VQkSy6rel0p+5USaiEzo8UrSVsgZ\n6Jt6U67Dm66u1HoAwkSgGjiCfmhy84/tGDFXTeXhEQAZERWcwFvGld8o/aS8\nh9otX81YqYTWa0w4Rmo9Ertt8ToBenl9ynWnahcJdk+3bf3Wnrsd37+Unbqe\nFOOC7gZvCvqU3lyP2paEewIRL8w4po7Mz5+4NLuOCeRJ7lxjtLWPFgq/85rq\nWhoT0EVUuSSdGwZzDzR3EAoI3fSz1CzEdU0umvHkPU9bf8230dvKbdHHiApk\n/VYUwvrEar4J55gPakZnLJvg8iFORtE6nYI+zlrs5jq0U3A7u0DFhuRI5a2c\niyet4L6dgfW45O7zVItOrU/idtT59YZGDQrMC7GZcbq5EZErj+l9G5vzxJ0F\nu/Ihy+smxgEnZvJacp6H+Pg2KHh4VYklbiLFiTmcCA6XurCtfSoLdpMKzeHu\nrS1aEclj3l8xBkO4iiEwmpApiIC284Kr6K04TYtpL7BPmr6cXOchwOkKH4BZ\neQL3CrXvi7jq7v5X3c1+zWPhFaGJs7Yaax3OF+/beAiZJl3PkzTY9bIy+VV9\nh5v8\r\n=F4ce\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGk6PVmj28vyOvBtcqtPKxpVjIrZYo71Jcvr2XHE9h5WAiEAq7wPz6qihOrYHFw03KOYtTTFfpR4W5qU5+M4T4kXo0U="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.18.0-canary.a7bc45ae.0_1594315386341_0.9481681186405801"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.18.0-canary.b184bc1c.0":{"name":"@material/mwc-textfield","version":"0.18.0-canary.b184bc1c.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.6ed717ddd.0","@material/line-ripple":"=8.0.0-canary.6ed717ddd.0","@material/mwc-base":"0.18.0-canary.b184bc1c.0","@material/mwc-floating-label":"0.18.0-canary.b184bc1c.0","@material/mwc-line-ripple":"0.18.0-canary.b184bc1c.0","@material/mwc-notched-outline":"0.18.0-canary.b184bc1c.0","@material/textfield":"=8.0.0-canary.6ed717ddd.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.18.0-canary.b184bc1c.0","@material/notched-outline":"=8.0.0-canary.6ed717ddd.0","@material/ripple":"=8.0.0-canary.6ed717ddd.0","@material/shape":"=8.0.0-canary.6ed717ddd.0","@material/theme":"=8.0.0-canary.6ed717ddd.0"},"publishConfig":{"access":"public"},"gitHead":"ed045f87cb3f1a4ba70a20cb1f586b80a1aa928d","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ed045f87cb3f1a4ba70a20cb1f586b80a1aa928d/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ed045f87cb3f1a4ba70a20cb1f586b80a1aa928d/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ed045f87cb3f1a4ba70a20cb1f586b80a1aa928d/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ed045f87cb3f1a4ba70a20cb1f586b80a1aa928d/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ed045f87cb3f1a4ba70a20cb1f586b80a1aa928d/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ed045f87cb3f1a4ba70a20cb1f586b80a1aa928d/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ed045f87cb3f1a4ba70a20cb1f586b80a1aa928d/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ed045f87cb3f1a4ba70a20cb1f586b80a1aa928d/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.18.0-canary.b184bc1c.0","_nodeVersion":"10.21.0","_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","dist":{"integrity":"sha512-pQZc1VPuwpTiK37Q72zFUdJmqQIyox+nffhy0hofpTWsDdHldUHVJouuq9TcmoW6c+u1swMPGjJ1fcik4BSMRQ==","shasum":"fa07543991601b85f31e2c649cb3a668cc068c70","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.18.0-canary.b184bc1c.0.tgz","fileCount":16,"unpackedSize":262084,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfB1SjCRA9TVsSAnZWagAA+BgP/3r0Hair3CQ5g5e8Y9iG\nQVGipydIy6h++SZV8GtZA8dzCUNT46gKeOg9UxHFHZ7c0RoQ3BMpNSYVaNdh\n3Nzaycmuq1KwmhMel6f2zsD57niYn/BYB91kJV5SH4REHGxlePRsM/Vrb1V1\ne8DwgbM6hEM3EoyLqpVBjSSWkQp3YzxlmungW1b68ZyxXfRWhcyWrfpG5JNn\nupiMpNDEKBCO0ZyeXi3vyr77XzlvhgBIU2ufkAs1HHitwNtuX+v6Su/f9luh\nzWqa3X0Scqb3ljhd/JksBeGGa41EevJqxrl8Wxr5b2tS9Fdra8wNc9ndhPhK\nFxNwQu6NmSD7Wk0eSna62XxymFwH9s6AILmK5tKUzbrsU39sxONe09Zv+jMs\nUErKqJTieSeBY1AenRAlPnbD2eRUjTFdlTWTa8/NsCDke0tFl1LRqbrTmaIO\new2vDLBNm7oog9czSiLMe2JYA9UIiMeeQGNTjXlk6N0zEdUGr+QHEd+VtHdh\nTU81k068GoxB5R95Q1lHnrARYIRAZorlW5Q36GuiRKnYogcT3xWEtYP9lzGm\nhnG8sP6KPIZbz4d+GzY/MZjNjz6lFqGBXB10HSszz+XdAyW5pHPOzjO7zJJT\ndPJJoibZqDSQ/DDUgcVBfZtEIVLR3v90z898Vep6dtenj6YAUbNrUCG3Ik7k\nYoQa\r\n=SCL/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICkRWahEMYM2MEwZeKf2KItmH6ZhxuqN6qsme9CmR88nAiEA/FUDeH7DqjdXr1xcuco0MGB9SsKFBdZSVpYB7ZWrNl8="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.18.0-canary.b184bc1c.0_1594315938967_0.233159229381938"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.18.0-canary.b39fde62.0":{"name":"@material/mwc-textfield","version":"0.18.0-canary.b39fde62.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.6ed717ddd.0","@material/line-ripple":"=8.0.0-canary.6ed717ddd.0","@material/mwc-base":"0.18.0-canary.b39fde62.0","@material/mwc-floating-label":"0.18.0-canary.b39fde62.0","@material/mwc-line-ripple":"0.18.0-canary.b39fde62.0","@material/mwc-notched-outline":"0.18.0-canary.b39fde62.0","@material/textfield":"=8.0.0-canary.6ed717ddd.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.18.0-canary.b39fde62.0","@material/notched-outline":"=8.0.0-canary.6ed717ddd.0","@material/ripple":"=8.0.0-canary.6ed717ddd.0","@material/shape":"=8.0.0-canary.6ed717ddd.0","@material/theme":"=8.0.0-canary.6ed717ddd.0"},"publishConfig":{"access":"public"},"gitHead":"561ab4c73d80c73f9b95c39655b7057d622fa2ee","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/561ab4c73d80c73f9b95c39655b7057d622fa2ee/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/561ab4c73d80c73f9b95c39655b7057d622fa2ee/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/561ab4c73d80c73f9b95c39655b7057d622fa2ee/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/561ab4c73d80c73f9b95c39655b7057d622fa2ee/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/561ab4c73d80c73f9b95c39655b7057d622fa2ee/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/561ab4c73d80c73f9b95c39655b7057d622fa2ee/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/561ab4c73d80c73f9b95c39655b7057d622fa2ee/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/561ab4c73d80c73f9b95c39655b7057d622fa2ee/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.18.0-canary.b39fde62.0","_nodeVersion":"10.21.0","_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","dist":{"integrity":"sha512-ZV0coAf7BW1zRwi+VoRRIxtLNRVkfwBlOW/0O/K9aqxUuN0HeSEa2idwpNrvd7HnL7TnYNlOD2BJ/sFNQvk+aw==","shasum":"1acd281c78c50b3ed610c86f6e1d8d1cac3cc5f3","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.18.0-canary.b39fde62.0.tgz","fileCount":16,"unpackedSize":262084,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfB1XdCRA9TVsSAnZWagAAFhIP/RU3MO0EBalgzlBQBZIB\nO9BuGVAm8IItmmIhLTyavgMsaksH5pGMc6VR7owQbySmTkxaq9DtmYYQTxJy\n2I1LpoK3dcriYZE2O08SSJJi56RObZtpWOIs3rg0uKu/HGmWiVZbyzJwyO92\n923VO5vbX3ciIHumaPjXqe17xul8ZGPZfyDjrnH4dkNdWdo+8XWW7XrbzCwe\nJDWK89SQ5J5lhrwuZyZ3Rt+ztKKTSKGP7WQBppiZwTANnJ8Rwf+xFt0dI0Ut\n7G8cQfLtUuTT1CIoFhZd6+E6fEkDyqcP+lmV2+5nSYeUjR5n8+d48ssBWPe5\nmRBMWC6xrmfcp7qduaOGd37HI4+wYGPS7tIas9wu8jtInNb3DG2evimd0Ryl\ntyZHOYgidd4VXgnzyNE6vvJcQ9cBHDnpJodwAOIsExktAdSAYy+b0FyRJV5S\nXr7rzWI0DwX3z7U20SPoSoFVLk1aDa5EqPk88s99KsbmZyrG0XRhzg1arR++\nuLDUpkWKQagwuQpFTYDRRpnHt6XOOQMlKcHtMWOY7Tqpir5MSmQS4P8iD80U\nfWEFFtk+xj+YPWh/PJmtLUdHb4YGw7XBIhSTWM/mmlhfnZAU6u6vvkmjuzfp\nSOGKCkLCnkdsilSOMPX1Kr3+bFI4Ia7y48isc/S+nhlUBnpcC4ptTcWeWsV+\njJRj\r\n=0q/+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDnxWNGRDmadX0SSsoPBZzNLNxqOGTO3zRJ8kN4sOHdZAiB4kkuDkkGDbiS7/7gn1OhJ6Epj5399Ti7J2V5lj5BUhg=="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.18.0-canary.b39fde62.0_1594316253201_0.477123755269073"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.18.0-canary.dfdd8d6c.0":{"name":"@material/mwc-textfield","version":"0.18.0-canary.dfdd8d6c.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.6ed717ddd.0","@material/line-ripple":"=8.0.0-canary.6ed717ddd.0","@material/mwc-base":"0.18.0-canary.dfdd8d6c.0","@material/mwc-floating-label":"0.18.0-canary.dfdd8d6c.0","@material/mwc-line-ripple":"0.18.0-canary.dfdd8d6c.0","@material/mwc-notched-outline":"0.18.0-canary.dfdd8d6c.0","@material/textfield":"=8.0.0-canary.6ed717ddd.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.18.0-canary.dfdd8d6c.0","@material/notched-outline":"=8.0.0-canary.6ed717ddd.0","@material/ripple":"=8.0.0-canary.6ed717ddd.0","@material/shape":"=8.0.0-canary.6ed717ddd.0","@material/theme":"=8.0.0-canary.6ed717ddd.0"},"publishConfig":{"access":"public"},"gitHead":"f0aaeb4b52155318bdfca32a9cd375c7cf8b0ca0","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f0aaeb4b52155318bdfca32a9cd375c7cf8b0ca0/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f0aaeb4b52155318bdfca32a9cd375c7cf8b0ca0/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f0aaeb4b52155318bdfca32a9cd375c7cf8b0ca0/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f0aaeb4b52155318bdfca32a9cd375c7cf8b0ca0/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f0aaeb4b52155318bdfca32a9cd375c7cf8b0ca0/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f0aaeb4b52155318bdfca32a9cd375c7cf8b0ca0/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f0aaeb4b52155318bdfca32a9cd375c7cf8b0ca0/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f0aaeb4b52155318bdfca32a9cd375c7cf8b0ca0/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.18.0-canary.dfdd8d6c.0","_nodeVersion":"10.21.0","_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","dist":{"integrity":"sha512-lL1rQAgBzkHZGyX9dvklbQPD4iunkBcqL2wHage8+CO8fxGkjbMNanVNc3lIiQUoBZbn+j6cTqgFOErtp5NPmw==","shasum":"b87ccdb31350d5e3c8d93a56050261e55276fc81","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.18.0-canary.dfdd8d6c.0.tgz","fileCount":16,"unpackedSize":262084,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfB2EmCRA9TVsSAnZWagAAbHIP/jv1tlYeJzSQ1ouFHMVf\nccv+hnlOElKCk4cBdQDWcZTGAYmtGPZK439scSSANK1pGIDhctZkD7x9NDSK\ni+Qurc1xyeYJeIJinrGHsObeikIzc7EiPojGjHJkfOUysNRebKC6G3qKlljl\nxCQ8Ve1AahgCgD3w3DxBkdlhfCqSNu9S4pooq9nDH9+YJWQBSIB7S9RCAEZn\n2JXZW9e/1svOP4mxuJp4Eh6CrJBQ5xN+t8b6fmSIBUNrdL//mra0+rw9UprU\nEB3Sbid7G7aUMCY1heiH8Tf0V7qCwoRD+oGX0NuGfmB8SfSNTskp0TAh3tCY\nAqzRvor+ndeVtRkXAfqqjHgWVUIsaHP3MSKSOa1gVBrdEXGE6gWTIYfNj3VK\nVNe8MoS640vD3OPJIMttmI6jY/TPVBxmdDfoHjHrKj3zbWDeomAk0q2z4/hj\nbBN9dY9QIjXn9DoSpZoOFhBf1+FnOKr+Hdo/XA/Tq4xcDa234faQX0FkaxKB\nlEq+ITAm9yXIisUiZ9jwik2km31YFlNA/ZKxgZj9KTg7Vgac+jQ3u1bwEyff\nu2Hbw/eivh+bHc7SuLR1M6iItBncToTadE0/iGTFSeNwsMHzZB/G65kJZ6rH\n6o2JM4EsvaRmq5Ivn9uw1w1jUSXpyVJP8O9FZBLxjrLqbVE7YE9grHjN52vZ\nqk5m\r\n=jWAF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEthmKWEpyPqIrrZfgnBshcoMgq3nwSYshD5c1A+iW8MAiA2qPiFT6qAk1yXVDAfC3OlMu/lhRch0SxGb7FaE/6iaA=="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.18.0-canary.dfdd8d6c.0_1594319141865_0.9602950093571889"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.18.0-canary.11cf2694.0":{"name":"@material/mwc-textfield","version":"0.18.0-canary.11cf2694.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.6ed717ddd.0","@material/line-ripple":"=8.0.0-canary.6ed717ddd.0","@material/mwc-base":"0.18.0-canary.11cf2694.0","@material/mwc-floating-label":"0.18.0-canary.11cf2694.0","@material/mwc-line-ripple":"0.18.0-canary.11cf2694.0","@material/mwc-notched-outline":"0.18.0-canary.11cf2694.0","@material/textfield":"=8.0.0-canary.6ed717ddd.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.18.0-canary.11cf2694.0","@material/notched-outline":"=8.0.0-canary.6ed717ddd.0","@material/ripple":"=8.0.0-canary.6ed717ddd.0","@material/shape":"=8.0.0-canary.6ed717ddd.0","@material/theme":"=8.0.0-canary.6ed717ddd.0"},"publishConfig":{"access":"public"},"gitHead":"652e6b8d96cc6adfa62d59e09d264defbb4f259b","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/652e6b8d96cc6adfa62d59e09d264defbb4f259b/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/652e6b8d96cc6adfa62d59e09d264defbb4f259b/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/652e6b8d96cc6adfa62d59e09d264defbb4f259b/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/652e6b8d96cc6adfa62d59e09d264defbb4f259b/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/652e6b8d96cc6adfa62d59e09d264defbb4f259b/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/652e6b8d96cc6adfa62d59e09d264defbb4f259b/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/652e6b8d96cc6adfa62d59e09d264defbb4f259b/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/652e6b8d96cc6adfa62d59e09d264defbb4f259b/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.18.0-canary.11cf2694.0","_nodeVersion":"10.21.0","_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","dist":{"integrity":"sha512-vAF7V7QZ/a5aoFbPS2CAMA9vjRsiIYgcmU7SEXz3fXAQvcr/v5jemir3jMPkBC2f+Mc2vBiVaMXahz/Px5HV9w==","shasum":"627866d77a1d625097623c0ac01c05ff00782d1d","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.18.0-canary.11cf2694.0.tgz","fileCount":16,"unpackedSize":262084,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfB4FuCRA9TVsSAnZWagAARfoQAI7KH7M4xSQenfvvjmG6\nBMvp97SNSPeoBSTKWynIxakpOZBTbDx0RtHjjrFt10tlCmm24w+cNitw1iV0\nTtiJyUv8/4hpYul9uQJcbtUIyvRI+TizSEm2x2NyoouQOX1F+GQz+okM4HNW\nk3IS2kHMgeZ5WYxovV4TZja5huzxvh3IGPh4ZxtNWTfHaXs3kWOT5J+qo55U\n9oQ1cminsl7GT8BhQbVVob7HPn4ybKntUnThZYLvuqDevHgFzkO2Fr3pmAKl\nNUNd6cEeaFq9Pl+H5qiiLwtLmSP4RtmG0866KpKAubW14G6EzRjw/FGc9ZW5\nf/z6bqzt0N1wLrWD0u6BACIrzidOnc6KTHd22/tMUTFeMX6eS2hDGiRSIJ7Z\nnXLLcQl8VnQg00SNtKQpqM94j/ZzNROY0aRvb6pQF7NzAdE79TpoUlCkrmdE\n/AtNe4vIP5E8RsYgmrDEzOOA5xFxbJIW2TiFOL1wyJAPlEnCGjdGWZ+2v+VL\nyjUrnJVQki08N5D+oJFIu9ZhwE8Xer2wP40hTLTxzbF4M/NJGr8EPnRn5pyc\nyd/72ji1+utBomyVTOAVGc4RsTb0WTX4Cz8VVXhATPsEz5/Tj4wCz+UzQTAq\nqa75hBXNB8VL3xNSErbGKQBRry9thCrNaMolvuCF8D0NWpbuDc1T3Af/IBQu\nr7fa\r\n=4CvR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD+zMXPAVifO+khIfxjaIh3c5PJQgYb4y7wWL7lrcgMNwIhAOQcLbm1JBy2kI6BbdFT2ntoadIzV1nKA9ruu3qEYU4S"}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.18.0-canary.11cf2694.0_1594327406024_0.48817686874847865"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.18.0-canary.436d66e9.0":{"name":"@material/mwc-textfield","version":"0.18.0-canary.436d66e9.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.6ed717ddd.0","@material/line-ripple":"=8.0.0-canary.6ed717ddd.0","@material/mwc-base":"0.18.0-canary.436d66e9.0","@material/mwc-floating-label":"0.18.0-canary.436d66e9.0","@material/mwc-line-ripple":"0.18.0-canary.436d66e9.0","@material/mwc-notched-outline":"0.18.0-canary.436d66e9.0","@material/textfield":"=8.0.0-canary.6ed717ddd.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.18.0-canary.436d66e9.0","@material/notched-outline":"=8.0.0-canary.6ed717ddd.0","@material/ripple":"=8.0.0-canary.6ed717ddd.0","@material/shape":"=8.0.0-canary.6ed717ddd.0","@material/theme":"=8.0.0-canary.6ed717ddd.0"},"publishConfig":{"access":"public"},"gitHead":"95b44ecddb7a4ad5662751540e79c58656790fa9","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/95b44ecddb7a4ad5662751540e79c58656790fa9/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/95b44ecddb7a4ad5662751540e79c58656790fa9/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/95b44ecddb7a4ad5662751540e79c58656790fa9/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/95b44ecddb7a4ad5662751540e79c58656790fa9/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/95b44ecddb7a4ad5662751540e79c58656790fa9/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/95b44ecddb7a4ad5662751540e79c58656790fa9/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/95b44ecddb7a4ad5662751540e79c58656790fa9/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/95b44ecddb7a4ad5662751540e79c58656790fa9/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.18.0-canary.436d66e9.0","_nodeVersion":"10.21.0","_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","dist":{"integrity":"sha512-qmIR1TDH61bfQ2vgUZYlDbAKxkg3AQqEcMFPE3L3LfjUpvum2X+qaThY1syWWJrv+NTHdOD+fWaSV0mFRiQO4Q==","shasum":"d5c8d431794073261ee0ede8929ab001ef2c435d","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.18.0-canary.436d66e9.0.tgz","fileCount":16,"unpackedSize":262084,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfB4KQCRA9TVsSAnZWagAAgqUP/jaX7ddYL+GCJLc1ws8t\nscHduE5dsH1p0C2/0PDIj7vRapp19a8ByiaiTEn59IfU1JHF0UDV4iRVyj3P\nCIu3IUdtkYjsf27Jn5l68WFimbyaTUq5e3HeSYwrVAY6ciGz5qz7x8tYpwTk\nES0KpykuU1dQiDPasmUWPBu0oEj0uf86Z2qWnxjpe43QHt6eDC/E+OGMrBcf\nJ3+s8oo4DXTlNKBT79tfgZlZGAiyhHsYLEkYybHNMxdIbQA6Wg0K0iiCBEil\nzqL8HKlBEXJrmO0GYjbMvsu73DgACaG4MYa6p5QqXTPoIlBXJeWJ0YJmAFzN\nDjMSb3U/eVHr+NMlUJh+IGAARZjCrS7e81T6Cf6J7SxZdKh5gSNkMz4LA8Hs\n+Owzf9J/5m1Qvz0RXihgwJh60E7wa/rtO+IUZ/km7NCOUaQfyxDalrGArnNc\nfgoykxyMgJxQm9eGkUsPFl1aID29kDu3uLpYmLUXVQWZ3WA+RWjiphq4GNEM\nDJh0OqrxF333EtKyLAxxY45R+zQruT7ghBZwvZGh+ocMhI8gmvPA4VHpUKVj\nhPfzNh/Gpmdj3xew+3qeiUPD/azad72YC/z4Tj1cA2l6X/dLcm71W1lCjtVQ\no7xEw8kaDNwoj2LLmdWVEHotnJXSeojbmkdBvaUNDAgapKq4eUUPaQW12hPZ\nB9f3\r\n=mI2X\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEVhiYiQo3Te2iQLNrasar+axXMi/mP5XBCNu6ujCn8FAiEA9Oq6dCaKdVgDMucvtlxDRT59LviCF6xn1Xjc7YiEuHU="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.18.0-canary.436d66e9.0_1594327696150_0.28390379872388194"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.18.0-canary.3a44d36b.0":{"name":"@material/mwc-textfield","version":"0.18.0-canary.3a44d36b.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.6ed717ddd.0","@material/line-ripple":"=8.0.0-canary.6ed717ddd.0","@material/mwc-base":"0.18.0-canary.3a44d36b.0","@material/mwc-floating-label":"0.18.0-canary.3a44d36b.0","@material/mwc-line-ripple":"0.18.0-canary.3a44d36b.0","@material/mwc-notched-outline":"0.18.0-canary.3a44d36b.0","@material/textfield":"=8.0.0-canary.6ed717ddd.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.18.0-canary.3a44d36b.0","@material/notched-outline":"=8.0.0-canary.6ed717ddd.0","@material/ripple":"=8.0.0-canary.6ed717ddd.0","@material/shape":"=8.0.0-canary.6ed717ddd.0","@material/theme":"=8.0.0-canary.6ed717ddd.0"},"publishConfig":{"access":"public"},"gitHead":"2cc46bce7534ef7046c58891f32fd054a1fa8b3f","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2cc46bce7534ef7046c58891f32fd054a1fa8b3f/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2cc46bce7534ef7046c58891f32fd054a1fa8b3f/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2cc46bce7534ef7046c58891f32fd054a1fa8b3f/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2cc46bce7534ef7046c58891f32fd054a1fa8b3f/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2cc46bce7534ef7046c58891f32fd054a1fa8b3f/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2cc46bce7534ef7046c58891f32fd054a1fa8b3f/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2cc46bce7534ef7046c58891f32fd054a1fa8b3f/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2cc46bce7534ef7046c58891f32fd054a1fa8b3f/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.18.0-canary.3a44d36b.0","_nodeVersion":"10.21.0","_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","dist":{"integrity":"sha512-CBuA/8UQpjf+NbqnlmokozMZE/zWKz+qPcD4hdljqMt3x8HcyoIWiHqhPKjk1pAUwKhgs/5l/Rt2a7jwX3Hpew==","shasum":"51b414345861616fc62deb0bd8500c6188657f7b","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.18.0-canary.3a44d36b.0.tgz","fileCount":16,"unpackedSize":262084,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfB7hACRA9TVsSAnZWagAA8CkP/1LKGPhe3h73EVURHzYZ\nAHP2F5Cp7Zar79V+dbXxvMA8nyjwyipsInWsb2wUcSq/UH5ngizYekOWR9zA\npB3niZ7I0VORatjfy8kPH/B3bdpzibJ7iPTwQs3wl8Fz8SfVulyMJsQGJt0l\njHCYDulUOkI7Vsqg4I7vx8joupLjA8OTwnBsM09belkFp/dCXDrLcPkdKO8t\nIU1N9Ut+H64w0Fu95cU1f3zvW8bJ3i2ZCLj62X7DlEPNnALYnbYgW/7oqKET\nxowkYInCbDPDPsF7l2/HSIWl/j+Kk99N0J5wQP4UNlwF2YHsoPeXe7l/X7Q6\n7xw1XsXFfnLhbEA0mMa2ctwkw2+PJral3rkViN7w7+iCKbqdHHWJRVi/ypkG\n4iwrc5DtlY8Qju7PfdCiuAgSToxM9D0p4fz8QyC3iGfO4KC4+emJ9vM1uHLw\n7HsNcvUgvdgK8TWwJknwmitj/MaPNTbh4fcUyQZomGG4CBwN9tjDXLyroE27\nxfdEM7qTE8ky4eTqEv63h+0p4paagEksgT4LTQUP0G2tqi/51dvda6ASj8/A\nnCWUF1ajtFgqvVdzTVoQuj/xdlX+OPftiDZ+L2ofR4tjVStUv1pUmBykrSqo\nZKEG3+JGCI7P8cn7PIfgfo4qKb7Hz1/MBFRu1qCKUp8dyRcJriN99kq7SwE9\nG0sG\r\n=1QD8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBYYkiHzfqgNgJD1zbDinFyuajVwNOT7eceDmKVrxv77AiEA//t5RXyrup4JRsMYQzhWNh4fKWy9gBVkiCcmJVDYO+4="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.18.0-canary.3a44d36b.0_1594341440504_0.04286971162390274"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.18.0-canary.ec11ae6e.0":{"name":"@material/mwc-textfield","version":"0.18.0-canary.ec11ae6e.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.1e7cb6198.0","@material/line-ripple":"=8.0.0-canary.1e7cb6198.0","@material/mwc-base":"0.18.0-canary.ec11ae6e.0","@material/mwc-floating-label":"0.18.0-canary.ec11ae6e.0","@material/mwc-line-ripple":"0.18.0-canary.ec11ae6e.0","@material/mwc-notched-outline":"0.18.0-canary.ec11ae6e.0","@material/textfield":"=8.0.0-canary.1e7cb6198.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.18.0-canary.ec11ae6e.0","@material/notched-outline":"=8.0.0-canary.1e7cb6198.0","@material/ripple":"=8.0.0-canary.1e7cb6198.0","@material/shape":"=8.0.0-canary.1e7cb6198.0","@material/theme":"=8.0.0-canary.1e7cb6198.0"},"publishConfig":{"access":"public"},"gitHead":"e68c3fdbbceeb46e346d694dad4b236fc74713cf","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e68c3fdbbceeb46e346d694dad4b236fc74713cf/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e68c3fdbbceeb46e346d694dad4b236fc74713cf/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e68c3fdbbceeb46e346d694dad4b236fc74713cf/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e68c3fdbbceeb46e346d694dad4b236fc74713cf/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e68c3fdbbceeb46e346d694dad4b236fc74713cf/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e68c3fdbbceeb46e346d694dad4b236fc74713cf/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e68c3fdbbceeb46e346d694dad4b236fc74713cf/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e68c3fdbbceeb46e346d694dad4b236fc74713cf/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.18.0-canary.ec11ae6e.0","_nodeVersion":"10.21.0","_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","dist":{"integrity":"sha512-r4YaNXn7nK5qKPzEsDj+Uo4p8MIyNSRQSkao8iDHfph2oesn3tlN8P5MYPFe9YG4fGVjMo5yx0qB6xUEmgpn3A==","shasum":"4a4529513dae6184bbf60ffe0bafdf5e206a7633","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.18.0-canary.ec11ae6e.0.tgz","fileCount":16,"unpackedSize":262084,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfCKr5CRA9TVsSAnZWagAAo+4P/jSgAQmPUhgDSJs2aQ6u\n0QTTe/C0CpsXhTmdsyVy8/NfKxuQJKGTeAI20Quf3cV92K8snB0RVGzZX3NA\ncg36I5Z2gRHR3mj8bTYGif1ThEvWAq01fyrXh7YsJEYm+pL85N7MlNdRAQRi\nPpccwHOza7tDoMTTIuDBB+/Bj/EzgD8zg4CtNhz2GrYEyX/WCT78KQI8ppVy\nvQrMeRwyekvXFd5QNK1veXBAqV6zPp+OCe3TRzPtWIcKDLvHTeXxB57pcVnI\nI7hmd83FPEdAFLMXYnaVTkJykC3j2bcUJKKQBGvarG7ayzWBXd+b1sAi+9Wd\nlgV6UU9ZZdTnAhoJLK8EZl4OS1AX9H7xdrmp0UsGrb1umKRVsjCi4q2u+bJ+\nYAPHLhu9a8glPbIjo0BW8GlNBNFJba9bNB3DU+pqxq89l9Mm2DeBH3Y+jPPa\nPP0z2Og5KYLpCMwWpLbXT/wpG+NcTwUHiLOiUH4/AG/IxTR+RjG/gmf32d2T\nmbJBfgKdp6OihJf3wRmaqoXsbFwltAXOETDO6X6Mx0kiIxSQ/ks2cxXf1h50\ncxyTR67nJGchFyvpjwEVRIrObtviBPPNHqAqr4pyJq3/sI+MA/C4zD1/leqP\nihU/avrXWqYfm0cIdrx96haEnOePknQeF5T0yxgYkt/pLBPwFSSMVWVtb/0y\n8r23\r\n=71Yd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD9TH8mXeukVOPJijfZvqFd+Eiv9JlcyjLRtv/VCc9DKQIhAO2mF9kU6UJVwOeDomxgF3ZFydtblOD4WgCivGqo+xyw"}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.18.0-canary.ec11ae6e.0_1594403577207_0.7597041726737708"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.18.0-canary.17f6cf27.0":{"name":"@material/mwc-textfield","version":"0.18.0-canary.17f6cf27.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.b2edaeead.0","@material/line-ripple":"=8.0.0-canary.b2edaeead.0","@material/mwc-base":"0.18.0-canary.17f6cf27.0","@material/mwc-floating-label":"0.18.0-canary.17f6cf27.0","@material/mwc-line-ripple":"0.18.0-canary.17f6cf27.0","@material/mwc-notched-outline":"0.18.0-canary.17f6cf27.0","@material/textfield":"=8.0.0-canary.b2edaeead.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.18.0-canary.17f6cf27.0","@material/notched-outline":"=8.0.0-canary.b2edaeead.0","@material/ripple":"=8.0.0-canary.b2edaeead.0","@material/shape":"=8.0.0-canary.b2edaeead.0","@material/theme":"=8.0.0-canary.b2edaeead.0"},"publishConfig":{"access":"public"},"gitHead":"a622acf92b818bebef7c3f77eb5296521068d267","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a622acf92b818bebef7c3f77eb5296521068d267/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a622acf92b818bebef7c3f77eb5296521068d267/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a622acf92b818bebef7c3f77eb5296521068d267/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a622acf92b818bebef7c3f77eb5296521068d267/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a622acf92b818bebef7c3f77eb5296521068d267/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a622acf92b818bebef7c3f77eb5296521068d267/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a622acf92b818bebef7c3f77eb5296521068d267/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a622acf92b818bebef7c3f77eb5296521068d267/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.18.0-canary.17f6cf27.0","_nodeVersion":"10.21.0","_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","dist":{"integrity":"sha512-Fq1qefvVdvRTNEpz+NAf8tq2jChdgYkJKR3SRq2uBqw9PrtBv1gZenO25E6XBmF/0LKG2dpKEJuLXtOhX+OMEg==","shasum":"c812130759b6b265c08384cf0f8178ba2a30afec","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.18.0-canary.17f6cf27.0.tgz","fileCount":16,"unpackedSize":262084,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfCLROCRA9TVsSAnZWagAArtUP/2mPvkDcaX40s5DG49X5\n+jRbhusuJhRDB81xCtAu/gsbpGgFX48jaja9TU+8IEZcMvJ+GZCu7vDQdyOC\nn6kii0dyWreh/NpfqylDLxANG+Ay4BSd38/SP9O9tGQXCfiJ+O+DqAq+/VgN\noX/Su0E3W7lOgg1rgK+sC4kpO9+fKIH0NiAfktb0xQAAB9YFITyxAcGKFNIg\nHeBRzWITO0Z/rqnhUfDPL2bJANW11DsqEUoirJJlOnoXCAueJIE7eS741s+H\nHLU5S1EaXJvcs76SvgNlQuGZOEgZiwmR/V3405Uo/AZVoupLt8IA2HQqqfWT\ntY6rojxvP47lB/CStDd/h73zl8pCPHX8ybpgIzrcXsPo6R6BJBjFtT0Ve4yF\niJ3/mWulCi8y87uVwU6i8aZUluyR0dPw44HRyZjfYjUkTXusaez39aRrJwyX\n+ATbw4NKDAM2di0ZPyGojvyNHCqFd7p+w1eAtvsv2dtIkupbmJuLv/llD+EU\njvSBtOThZ3oa/domnXtssEyeef88rw/7RErW86FGYLHcU3x8PVBGosNOs1hy\nzmaHBlliATaxVvOWcPPWG0C32fMsIJ9qXfWyiinLWDowIfaO3YEqerw6T9Ab\nU8pufOCemBUWaMkyt/U1ruTLNyDZdGyv/3/23teqcBaJc9v7RkKoywrL5gJ4\nmhbI\r\n=3Axj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE21ufH/ExuptnpAY3WyRAaT3G+mTWQgojWooZkJH9C7AiEAmCPU+TG/fIaft490gu+KcPDLxp195M62C19tUjhPj1c="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.18.0-canary.17f6cf27.0_1594405965653_0.7332593110413801"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.18.0-canary.efdfbc21.0":{"name":"@material/mwc-textfield","version":"0.18.0-canary.efdfbc21.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.b2edaeead.0","@material/line-ripple":"=8.0.0-canary.b2edaeead.0","@material/mwc-base":"0.18.0-canary.efdfbc21.0","@material/mwc-floating-label":"0.18.0-canary.efdfbc21.0","@material/mwc-line-ripple":"0.18.0-canary.efdfbc21.0","@material/mwc-notched-outline":"0.18.0-canary.efdfbc21.0","@material/textfield":"=8.0.0-canary.b2edaeead.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.18.0-canary.efdfbc21.0","@material/notched-outline":"=8.0.0-canary.b2edaeead.0","@material/ripple":"=8.0.0-canary.b2edaeead.0","@material/shape":"=8.0.0-canary.b2edaeead.0","@material/theme":"=8.0.0-canary.b2edaeead.0"},"publishConfig":{"access":"public"},"gitHead":"d0c5bf147bc31e55a775562b113790bac6052eed","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d0c5bf147bc31e55a775562b113790bac6052eed/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d0c5bf147bc31e55a775562b113790bac6052eed/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d0c5bf147bc31e55a775562b113790bac6052eed/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d0c5bf147bc31e55a775562b113790bac6052eed/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d0c5bf147bc31e55a775562b113790bac6052eed/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d0c5bf147bc31e55a775562b113790bac6052eed/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d0c5bf147bc31e55a775562b113790bac6052eed/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d0c5bf147bc31e55a775562b113790bac6052eed/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.18.0-canary.efdfbc21.0","_nodeVersion":"10.21.0","_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","dist":{"integrity":"sha512-KDJFM+75/8mFFhiiPVWpU+zEWRJQ/14hBdakNJvcdKBl88H8p9RraAhunIlpex/ifCCpSQDLZGUWNhgwT+xMUw==","shasum":"4e4f8b6919d31962cbb4ac54df70e20581fc89a7","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.18.0-canary.efdfbc21.0.tgz","fileCount":16,"unpackedSize":262084,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfCLcLCRA9TVsSAnZWagAAvvAP/2vIjqDaXT2DnkMUwzIp\n/oioy7/NA74M+9a4T1DEykay+p5SCbpPqWHs+Bkr2qejNV7PSdONiPvnurZX\n//yvhWD8OujdD113Eio5dZ9Zjm1ycqS6uNb11Cim7cXoPoDUNb1fWNvblPzD\nsHLh3UNpM2gSlR+q/8wbSrQjGghwlWFPVM6sXpfm7fwm8GY0vT2O2eMNmo47\n4hL2xFMyFR01XceH6Wr2qLXkPdmVMJiMquIL1kUDYmLwaY4ml5N8ljBt7QCZ\n/pbhDOVa9WPz2HDjkdruS41wdallaNIzvGZbpOvQ9US6zr2QAIhDkQVY0Q+I\nJBEb3JNvWYQXjdPR5ITyVuTqTfyqfFFZQcaZmZyCwd3323wg2swBiWbIz294\nw+MpknojUYscZSKbe1y1d03OY1efJjXmewSZl9EwAzrEXt2ooiFNFho5jwDk\nrG1NmSNZdmmzLLpsLoyIBhFRDLdYJN2E9yucthHNTA1tyFZP54NzeZ+hGrL+\nUwbmkM/y4tF6VRZQ6mGtUi2ba7i4+M3PmDr7BAryFm8UoXpdYzSnxruAM68b\nm7rrP0sPn2nVFvZj60DEMURoy7nX7leCRS//+ZiwsTS9QLMpPXdeMVb62XDj\nWa/oka0Tq3wQwkXjKvEwRS3Rw5iZcA92mB31/OP4CiQL22heuqNWz7rjAuRF\ngtv4\r\n=1eRY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDXAzusBVocZdJEeQ2/WLq7uUbXeDq5z4iL7Oa+tElJbgIhAKyuSAwQOp/U68+LD81enGSDShcAAN8+0a00VW4hZRRY"}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.18.0-canary.efdfbc21.0_1594406666908_0.3357062149087455"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.18.0-canary.bae4339a.0":{"name":"@material/mwc-textfield","version":"0.18.0-canary.bae4339a.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.5dac1f624.0","@material/line-ripple":"=8.0.0-canary.5dac1f624.0","@material/mwc-base":"0.18.0-canary.bae4339a.0","@material/mwc-floating-label":"0.18.0-canary.bae4339a.0","@material/mwc-line-ripple":"0.18.0-canary.bae4339a.0","@material/mwc-notched-outline":"0.18.0-canary.bae4339a.0","@material/textfield":"=8.0.0-canary.5dac1f624.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.18.0-canary.bae4339a.0","@material/notched-outline":"=8.0.0-canary.5dac1f624.0","@material/ripple":"=8.0.0-canary.5dac1f624.0","@material/shape":"=8.0.0-canary.5dac1f624.0","@material/theme":"=8.0.0-canary.5dac1f624.0"},"publishConfig":{"access":"public"},"gitHead":"3b615d0a523f0cb1bc5f7f0c0f7ca6eb5f52ee63","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3b615d0a523f0cb1bc5f7f0c0f7ca6eb5f52ee63/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3b615d0a523f0cb1bc5f7f0c0f7ca6eb5f52ee63/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3b615d0a523f0cb1bc5f7f0c0f7ca6eb5f52ee63/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3b615d0a523f0cb1bc5f7f0c0f7ca6eb5f52ee63/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3b615d0a523f0cb1bc5f7f0c0f7ca6eb5f52ee63/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3b615d0a523f0cb1bc5f7f0c0f7ca6eb5f52ee63/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3b615d0a523f0cb1bc5f7f0c0f7ca6eb5f52ee63/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3b615d0a523f0cb1bc5f7f0c0f7ca6eb5f52ee63/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.18.0-canary.bae4339a.0","_nodeVersion":"10.21.0","_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","dist":{"integrity":"sha512-mhvRLbf18CW4gKM5G9T09B12f4l/Auu3BqFfsZOK2AWLZXq4/GN39N8sU8UyX36ApLFxkT0YVY7EM4RQaOgAcw==","shasum":"984084f295fa22df74a72ee0e71de37883711b1c","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.18.0-canary.bae4339a.0.tgz","fileCount":16,"unpackedSize":262084,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDeBMCRA9TVsSAnZWagAAdeUP/0hs7C9ibtix7OXwa+Et\nmbQVMVLALV+N4QCRo/75iNN+J+QrfwF92U2aZ9Hno14VOjksnfyQ2z2uejyN\nD3GlZGky5N8yUu8pFmUvuVGSgnr62fT78qxpUNLHtbJ2R4gW6hzlCf6hT3dr\nDjtQH4nmVcxQJ+0B+efk1h3g5IVIG82krhc+yLAr7CuUd8Mjw14Fp/xNDymZ\nNNDbKXSoh8LRVXKrFHHutDt0hdQ+XeBBsDd7nfIDn/OETRAezKYFD/jpGVAE\npxes3WZ+FNCT9WnVtxXu2CujbHjK3YxerZVrk+BA/i4umHYTurxliYC2reld\nP3WOVTDHgPT4QqVvanlKjJb9UWaNDA6Gh+Vp3GrNJkn9AIhx0NHxst3K6rXs\ncBd9NMGa5TrYPeKdv2lUEht8ixwWsGZnb6gLssuvYvtKkwyzG4iCkLqT54gU\nmXxqpfoCnqFLeWGtbs95p+KG0NwQGs9HaKAtNOKq9AMtiKIthILVUiE3e2Df\nYQyAzlTH8j1OkGvRbwAATOYBZMvs0Dt0/2UL8RKzCTNn4Nc1nTijaXb4QiEG\nwWhZHiWhsJ42vUZXj4/g3IuqCf0xbQbwSaneBamAvMox4fXPzx3yCHqNtoj1\n0o/rAqbWqXJHnmYSN83o5AxNdh07I9L8iA8aXz76B7P9n390FzqLV3G9vccx\na1wj\r\n=+pon\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFwTxmxKGINYi7MhBQ/SlBu8YU+guFa1oAWwfft58PWBAiBbZRkYSXU7FGdng3KfMyzwep7VZu6VI5NmTK0lh79f6Q=="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.18.0-canary.bae4339a.0_1594744908434_0.3082440131206945"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.18.0-canary.28eac13b.0":{"name":"@material/mwc-textfield","version":"0.18.0-canary.28eac13b.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.e6e23019d.0","@material/line-ripple":"=8.0.0-canary.e6e23019d.0","@material/mwc-base":"0.18.0-canary.28eac13b.0","@material/mwc-floating-label":"0.18.0-canary.28eac13b.0","@material/mwc-line-ripple":"0.18.0-canary.28eac13b.0","@material/mwc-notched-outline":"0.18.0-canary.28eac13b.0","@material/textfield":"=8.0.0-canary.e6e23019d.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.18.0-canary.28eac13b.0","@material/notched-outline":"=8.0.0-canary.e6e23019d.0","@material/ripple":"=8.0.0-canary.e6e23019d.0","@material/shape":"=8.0.0-canary.e6e23019d.0","@material/theme":"=8.0.0-canary.e6e23019d.0"},"publishConfig":{"access":"public"},"gitHead":"26d5b26372c667630c62d9894c9825aec9e06f60","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/26d5b26372c667630c62d9894c9825aec9e06f60/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/26d5b26372c667630c62d9894c9825aec9e06f60/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/26d5b26372c667630c62d9894c9825aec9e06f60/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/26d5b26372c667630c62d9894c9825aec9e06f60/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/26d5b26372c667630c62d9894c9825aec9e06f60/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/26d5b26372c667630c62d9894c9825aec9e06f60/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/26d5b26372c667630c62d9894c9825aec9e06f60/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/26d5b26372c667630c62d9894c9825aec9e06f60/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.18.0-canary.28eac13b.0","_nodeVersion":"10.21.0","_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","dist":{"integrity":"sha512-QgPfc89QEx1GwCyQVP0boHc1ezHbyilnFCbpVvJltyApGVc8WOOx3TL/CsPBmx7Kyh8tKo6jA6ZH9xT38wGsTA==","shasum":"1bb20e2ffc6b7d1b5d124216aaa495fd68a1033d","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.18.0-canary.28eac13b.0.tgz","fileCount":16,"unpackedSize":262084,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDjBbCRA9TVsSAnZWagAAfbEP/j30b/HYiORvA+ML1YkA\nQ/90YthP1PLcCgZl/uex4qhl2uC4UsUkkjZHgFeiUl71j+yk3P5VpoktS1Ui\nahY0k3efU/95enFYiBcVliWb6qVoMFnG34+EMBtyXZWA3gehORVCLWvVgfu+\nW6e/XJEElS2WxCnozdYv9w/eWkGMeGU0lRKqFmPaeO/LiLkKYH0LgKSJTksq\ngW3c8bRFtetPniPEugIEdrx+O8JQsnjiEho5K0woGk1iEQdxQTEmNbP/LkNC\npBagGmoUPGpHyFi9YxhZZw8aLBqzHVVqKFT1sljyKzxrkWAwtXniiHlKRg9e\nttxzEXemjGxdF/CN7S4UbzLjqZIg8J2xwKfMq9MqdMc9bShdsiHHrQ8a5kVg\nyYbHhcQ+5oQrWctW8+bFp069F6WKWRfzot22yOf8jIwi/bEUhxGHCGsKVlgZ\nzKDzk3HNZxwyiMhrKoxyyqTFGd5VBn1UaPTcEvr8QBZcof8YidPLloKf2UC7\nAbKxPJgsG2Z+lMG69CxSlOTOrp3UD+F9fKHtUif36N+BPKpazLre45K0jSoG\nx/5z4KCz0FmoUWRoJA8YU1HHKqO0SJNIXxBzC8HF0rKnMwKNE/ZYHFyzTNOR\nfq8NWeO4IECIJELJSlYkzRKENpK4XUaA3xf0rOwQ7YaOS4ddiM6KWsednhoE\nIi0m\r\n=8zxY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDJCQH/vQEgCUlJEHNiXXbTBC5pNay3/dXnD8Q0LvpwhAiBjkDhwKGU4l8481z6dJ3NdllFGiU0y6XAwM6WtADBSOg=="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.18.0-canary.28eac13b.0_1594765402934_0.27721689673644523"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.18.0-canary.44966b65.0":{"name":"@material/mwc-textfield","version":"0.18.0-canary.44966b65.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.ad4df58c1.0","@material/line-ripple":"=8.0.0-canary.ad4df58c1.0","@material/mwc-base":"0.18.0-canary.44966b65.0","@material/mwc-floating-label":"0.18.0-canary.44966b65.0","@material/mwc-line-ripple":"0.18.0-canary.44966b65.0","@material/mwc-notched-outline":"0.18.0-canary.44966b65.0","@material/textfield":"=8.0.0-canary.ad4df58c1.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.18.0-canary.44966b65.0","@material/notched-outline":"=8.0.0-canary.ad4df58c1.0","@material/ripple":"=8.0.0-canary.ad4df58c1.0","@material/shape":"=8.0.0-canary.ad4df58c1.0","@material/theme":"=8.0.0-canary.ad4df58c1.0"},"publishConfig":{"access":"public"},"gitHead":"e431cd0a71967599b61ba4219d726819807947ae","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e431cd0a71967599b61ba4219d726819807947ae/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e431cd0a71967599b61ba4219d726819807947ae/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e431cd0a71967599b61ba4219d726819807947ae/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e431cd0a71967599b61ba4219d726819807947ae/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e431cd0a71967599b61ba4219d726819807947ae/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e431cd0a71967599b61ba4219d726819807947ae/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e431cd0a71967599b61ba4219d726819807947ae/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e431cd0a71967599b61ba4219d726819807947ae/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.18.0-canary.44966b65.0","_nodeVersion":"10.21.0","_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","dist":{"integrity":"sha512-vVxN3SLiH9e+6F2CaUbDT/OzPbGOBRGnUKIxRxtdQIgyhoXQNzq2iNSKLt8xtPrvYt2ePQWtjbfrflMZf/N2HQ==","shasum":"0c101138ef20a715da6607d4f8d194237bad2359","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.18.0-canary.44966b65.0.tgz","fileCount":16,"unpackedSize":263065,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfD0VCCRA9TVsSAnZWagAAYXUQAIOo9lQS0znP9S7u3b/O\nXDhHg/7lvt22MnrP9YATwhaQCFVK57WiFEFbS1fdJ+xqX0j0ydqPXR5boy1A\nQymLsKytwK+4s3+yAlFpQwR7ujCDGt1VHAC4M3nCo1Xrg6J6sRVcQiLfd9mW\n6mmqRneCuZ6iXWrnXFCS7VbCdL566FPQ31vSJzqTVVg7SSXuk3SfBM3ku71i\nuIwTvgtsLQlmAKDeLKVuMugHFxNnqkBIPlPn2+p6Hc6m/65RT7ys+G7VnEFp\nmZN1sBhiRwcC/l5rtLPhNLbC0y81zCrTOJlslh7dCXcskRd7MUHwoGeRaxLp\njvW7ydzdu3dtU6W2BkV5SGsNnptM3rAT4w0p6dH87cJn2Tj6lUOQMBAC/GLD\nO7Uxm944hvnG6OZ55YyGRVKFy+I3qXww9UcAC3L0r3MNYXFo3Xf5gz0PtU7o\nVRPNEzhZYSO6rZcp+xeiJNUTq15oMahe9+DwuQF9/3DjMXhEW8xS5fP2E08K\nG3e0pms+oqsI5Oi3w+QerXS72hLjtXp5X7vNPIFD13412HWQIlMMj+bqsDiJ\nfOJdcd3xyuJ1o3eVc2GEN8UMDvH3ch/LnwuzbT4e+gQmblpaz+w0x9ZkPiks\ntebz8R19Dd7pKR0g/DOQAyPDdHe14dSV7wEnOjzikJOeNAxRF1hbHCjYws/z\nRJL5\r\n=Qubk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDm3X7toqBNWWj4HrjlvnmwxC24MpfxXJGVOTXfO1NVGAIgI8LChtRNW+yc4VtLQECF6+QhmSwkNV0h53T41SQq9sI="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.18.0-canary.44966b65.0_1594836289943_0.857134828680985"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.18.0-canary.3ef0ef60.0":{"name":"@material/mwc-textfield","version":"0.18.0-canary.3ef0ef60.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.01db89053.0","@material/line-ripple":"=8.0.0-canary.01db89053.0","@material/mwc-base":"0.18.0-canary.3ef0ef60.0","@material/mwc-floating-label":"0.18.0-canary.3ef0ef60.0","@material/mwc-line-ripple":"0.18.0-canary.3ef0ef60.0","@material/mwc-notched-outline":"0.18.0-canary.3ef0ef60.0","@material/textfield":"=8.0.0-canary.01db89053.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.18.0-canary.3ef0ef60.0","@material/notched-outline":"=8.0.0-canary.01db89053.0","@material/ripple":"=8.0.0-canary.01db89053.0","@material/shape":"=8.0.0-canary.01db89053.0","@material/theme":"=8.0.0-canary.01db89053.0"},"publishConfig":{"access":"public"},"gitHead":"6fd176476c86425b826862155a44202aed930407","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6fd176476c86425b826862155a44202aed930407/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6fd176476c86425b826862155a44202aed930407/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6fd176476c86425b826862155a44202aed930407/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6fd176476c86425b826862155a44202aed930407/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6fd176476c86425b826862155a44202aed930407/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6fd176476c86425b826862155a44202aed930407/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6fd176476c86425b826862155a44202aed930407/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6fd176476c86425b826862155a44202aed930407/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.18.0-canary.3ef0ef60.0","_nodeVersion":"10.21.0","_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","dist":{"integrity":"sha512-C/2dpMZXcugGBrQu0hwDUGEgSZdnxqIyg54tf8nL0/KWBnVzn19ZMWJ/ZpMFRzmqvQkBrmvWCDZLYJc/r3Ti6g==","shasum":"ea554438d0db59b8e29d028cf67465ca056d18ea","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.18.0-canary.3ef0ef60.0.tgz","fileCount":16,"unpackedSize":263065,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfEIZKCRA9TVsSAnZWagAAoOMP/AybOA5JqWFbC0uI7Mn1\n3W90DaTeKd1ZChG8GH7IsuPDqWM0G0sjDfLENW3j2Vd0lNrPzyskxbwMente\nF+HDHqIv4VenTgY8FIIIrA51PZ73zWMtU9uJgz2qcUkuMzCpJ36sBwAaSf6y\noHVvJ+9EQVn23e0Yd7UQoKPEQOv6KPen69S6vumk0wYSVrsTYQ6OWbXgRkAf\nbY1XTHfLATQpQX4ygqa+IKs6BWMgL46LLE9djpKjHk2Z4HkVzfUO26Q3KXdN\ncDh+/lUzJaRhtBSf13SyD8PbwQudabSXBUdjCoQB3XeMM9MF2Zz5DfXQld4Y\nTDUxEne6nSKgCwY0ZGnrWL+Oj8iQpaw0zB1xPnr36rehaNOUSwcsmXQjiFG3\naxF8zqZqghkmtqpwNR21TniaTJMqXPAbKLkU2M5G65NAgRh/dRaXd1HvLlUz\n0SFFvc02OstTh2b4MCkHVhutM8Ma3ia5uyfdTFinO033LbKTW2sK8ImLLTXW\nUnZrRMLeBB3bKHtiWIwcoGvYqEsgRGE4aHCrj6TLIoT4bRJf9G28HYtlXhEk\n1jrvgbziond/b1c4P6iycyvf20cTtO7cjO/LFFfi4vKEOB66FubkD+Xv9mZp\nfI7ZI8ZAFyUFGLuFREzxFIE5BmZsZzhFnSkaOq4pk4jDTR9/eAdYiHE6jhrb\nNwNI\r\n=qxu5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC4JKCaMI4coBPquDNg0GKC38/1vXoYBiOrvwoStb3KOgIgSgYItgVjEQ4+v+xYh2GGoDgiBcgsM1UP+NKF28UuCRY="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.18.0-canary.3ef0ef60.0_1594918473986_0.9168020021134662"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.18.0-canary.fcebf9e6.0":{"name":"@material/mwc-textfield","version":"0.18.0-canary.fcebf9e6.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.01db89053.0","@material/line-ripple":"=8.0.0-canary.01db89053.0","@material/mwc-base":"0.18.0-canary.fcebf9e6.0","@material/mwc-floating-label":"0.18.0-canary.fcebf9e6.0","@material/mwc-line-ripple":"0.18.0-canary.fcebf9e6.0","@material/mwc-notched-outline":"0.18.0-canary.fcebf9e6.0","@material/textfield":"=8.0.0-canary.01db89053.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.18.0-canary.fcebf9e6.0","@material/notched-outline":"=8.0.0-canary.01db89053.0","@material/ripple":"=8.0.0-canary.01db89053.0","@material/shape":"=8.0.0-canary.01db89053.0","@material/theme":"=8.0.0-canary.01db89053.0"},"publishConfig":{"access":"public"},"gitHead":"27c24842ba1b663ca72b52321d89d72fc7ef34ff","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/27c24842ba1b663ca72b52321d89d72fc7ef34ff/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/27c24842ba1b663ca72b52321d89d72fc7ef34ff/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/27c24842ba1b663ca72b52321d89d72fc7ef34ff/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/27c24842ba1b663ca72b52321d89d72fc7ef34ff/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/27c24842ba1b663ca72b52321d89d72fc7ef34ff/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/27c24842ba1b663ca72b52321d89d72fc7ef34ff/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/27c24842ba1b663ca72b52321d89d72fc7ef34ff/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/27c24842ba1b663ca72b52321d89d72fc7ef34ff/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.18.0-canary.fcebf9e6.0","_nodeVersion":"10.21.0","_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","dist":{"integrity":"sha512-iz1/8ZXHh+1ZoKQiEED0aVonTQaTBBgxJ5enmyD+KJKu4kqyf7OChY1TqR1su8x35/NeX3WSaS8Mf6JrIFdRNw==","shasum":"d049e45ef33f220c25bf41ad055f1a15338692ec","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.18.0-canary.fcebf9e6.0.tgz","fileCount":16,"unpackedSize":263065,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfFeZpCRA9TVsSAnZWagAAeG0P/2SDQOBzFZ+GpXJEpQK+\n6/lioys49OhalQiA0ZQG9lpUVSp+ceta3VdR3K7cQcSXXRwBL+wm0E4u38lG\n3076DFygujyIGuEMl7Rse7YhJB52jv3mH2heeydp0O1lpNR9bEzeD/DRQJBw\nsU/2okzyPBZRs5Pt0ojVwVlXDOJYOEMlR/+D03SB7McvUvxGO5N+Y0Qm2w6A\nFkQF1LA6kw4cQ4+FzeSJ97f9o8lk7b2zaVbRNvcWRXWnnIU5mX6aNyK6alJW\ncIveQT7iOsORE/Xskb4K0jl3KubdztJGYZA4EXwboKPZbeWWBgxfOZxv/lPz\ndFmvHqOkcUlqwx3aNi6+/Tj19T7tg0K1Ztv+0JikJQ9PvcNFthQvkuSJlq1c\nvYTj6FW/CqH8X27zgdoI1Z0rKbRLrpTsVVGeOxywTy6BPCjffx5BlsHs07pB\n4HJtMYkhOLVcLN8TxYTJa2CQebHz098qyp+XjQOk3gTd3qahD7C0uccmrg0V\nFOG93jDSafa/HDYlL76HFTUz7Z6SpSv7Ia7DBVpogoZJh269l1e0rXjgHCYp\n71soKgrutlkRb5/AJ1QM2ExYOVDiD1DQZbm6nDLCirm5Nnc/TuNsQYq8GoZ8\nVZvZHlc2XU8K0i01glAVYwXIx9KJLL8+RxVcoSifj2Ad+EBIYrSVdwCG2o1f\nDyPY\r\n=ea6w\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCbf+5QFS+0FRQ4zBy/53dYNeVr7QxFbs3ObrmSweqDiwIgF99bmrftELiVdVyXBWGxDXI6wy9QT8qn+8keqn6ce4Y="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.18.0-canary.fcebf9e6.0_1595270761371_0.34247829314596534"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.18.0-canary.b6a772df.0":{"name":"@material/mwc-textfield","version":"0.18.0-canary.b6a772df.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.fb5a4cdeb.0","@material/line-ripple":"=8.0.0-canary.fb5a4cdeb.0","@material/mwc-base":"0.18.0-canary.b6a772df.0","@material/mwc-floating-label":"0.18.0-canary.b6a772df.0","@material/mwc-line-ripple":"0.18.0-canary.b6a772df.0","@material/mwc-notched-outline":"0.18.0-canary.b6a772df.0","@material/textfield":"=8.0.0-canary.fb5a4cdeb.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.18.0-canary.b6a772df.0","@material/notched-outline":"=8.0.0-canary.fb5a4cdeb.0","@material/ripple":"=8.0.0-canary.fb5a4cdeb.0","@material/shape":"=8.0.0-canary.fb5a4cdeb.0","@material/theme":"=8.0.0-canary.fb5a4cdeb.0"},"publishConfig":{"access":"public"},"gitHead":"aff69a9137a8578f83238c4b15f6ef6447db7c80","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/aff69a9137a8578f83238c4b15f6ef6447db7c80/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/aff69a9137a8578f83238c4b15f6ef6447db7c80/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/aff69a9137a8578f83238c4b15f6ef6447db7c80/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/aff69a9137a8578f83238c4b15f6ef6447db7c80/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/aff69a9137a8578f83238c4b15f6ef6447db7c80/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/aff69a9137a8578f83238c4b15f6ef6447db7c80/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/aff69a9137a8578f83238c4b15f6ef6447db7c80/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/aff69a9137a8578f83238c4b15f6ef6447db7c80/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.18.0-canary.b6a772df.0","_nodeVersion":"10.21.0","_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","dist":{"integrity":"sha512-aK6qf+JHedV3UA7VF2ic+YMlpGQR7mvk85RtK4uj3f+Bm0HPfN62jwxBoi704IWnvOJJZ2xSQyoXcBlf+MsPkA==","shasum":"f459a3af8d7a52c870df3acf9f1afdfb494ac1f8","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.18.0-canary.b6a772df.0.tgz","fileCount":16,"unpackedSize":263065,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfFh7CCRA9TVsSAnZWagAAgBwP/iesAMkmsFdB2fPkC6MZ\nlT5UQMboPWB5Axwldn42rnoYnSIx/XOVJjgCI+motjQfPA4eUCZ/p+ryXzRD\nFzUWorrZ7arR/jF6kM7iu5stitWm2qrzeDzv+GGhyLak9HkOAVDWba6pPL2A\nXi5tRP3EaeygQZ0OGUbNwpXB+Y1yhuo6gUL5Z4nX+1D5344gKjoCYVSPBntG\n7+vo/djQguVJlqiVeZmJh9rKWxdQBQvhCx/SErTj56BEYMfg8ugujJGDH/xo\n5ktJAZT/pabyfinW/ygmcMUnZDOR/exL9Yn9DLEMsuTu/4HS9mR8zJi0YPVR\nXnEOKjTFXn3gaiLcKsWvIdx5BZ5lyohSva97erh1jZXjwoPVDKywnI40RoY4\nKb0BfQ//kbVjMbnTRGAkpFaEL3AQQdaHJvy/aprl66F1N6TMVKao8FFEWQ1b\nP1yFj5uioz2xq0kMXgmxRoaOanox5PZ5L0nqegvcpp1sDBxeXX9aJGpU2kLH\nJ+/kSX8eLFQlblC8qFs56q3ivMhtFDJDd2Sz/ggOvwS1IKbkBh9I7cyD97qv\nTrjG/kDueSd9wnxP9ov2tmB7EVLTMKI0naaMdGLFH2h+LHsLMjujSQugzU2d\nHDfct/aMftn2+RK87IUnPTYl8mGtEgjqess7W/8qblm8iVIRczMyy3K7noWO\nh7Qd\r\n=+/DA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC/rV/+HGs6AYu7spVGPkq246PJt8XaKNeMkZvc9i2dxgIgGIBZpjDVUGCEQCsoCiKfFPwKn3SssgJztZMbFsoN6Cc="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.18.0-canary.b6a772df.0_1595285186517_0.6634248438926256"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.18.0-canary.f6a6ca38.0":{"name":"@material/mwc-textfield","version":"0.18.0-canary.f6a6ca38.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.abcdbcfeb.0","@material/line-ripple":"=8.0.0-canary.abcdbcfeb.0","@material/mwc-base":"0.18.0-canary.f6a6ca38.0","@material/mwc-floating-label":"0.18.0-canary.f6a6ca38.0","@material/mwc-line-ripple":"0.18.0-canary.f6a6ca38.0","@material/mwc-notched-outline":"0.18.0-canary.f6a6ca38.0","@material/textfield":"=8.0.0-canary.abcdbcfeb.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.18.0-canary.f6a6ca38.0","@material/notched-outline":"=8.0.0-canary.abcdbcfeb.0","@material/ripple":"=8.0.0-canary.abcdbcfeb.0","@material/shape":"=8.0.0-canary.abcdbcfeb.0","@material/theme":"=8.0.0-canary.abcdbcfeb.0"},"publishConfig":{"access":"public"},"gitHead":"44166a768d79b9da90f97e27d954aa263d27b4b5","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/44166a768d79b9da90f97e27d954aa263d27b4b5/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/44166a768d79b9da90f97e27d954aa263d27b4b5/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/44166a768d79b9da90f97e27d954aa263d27b4b5/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/44166a768d79b9da90f97e27d954aa263d27b4b5/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/44166a768d79b9da90f97e27d954aa263d27b4b5/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/44166a768d79b9da90f97e27d954aa263d27b4b5/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/44166a768d79b9da90f97e27d954aa263d27b4b5/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/44166a768d79b9da90f97e27d954aa263d27b4b5/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.18.0-canary.f6a6ca38.0","_nodeVersion":"10.21.0","_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","dist":{"integrity":"sha512-l9gzUqaqtwZRUwjB5xWM9Dnli+oMn/A4KnZxNaBUKRehZmZMLe1uDxhqDVoX7IKy50jbANzcJ43UuP6KVoYRkA==","shasum":"c672bf4f8360b5f8721b7e9efead9e808e43b207","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.18.0-canary.f6a6ca38.0.tgz","fileCount":16,"unpackedSize":262540,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfFxqRCRA9TVsSAnZWagAApPEP/0nJH7OfdRUUsKoiHAhI\nz871EQecpaFrqVgkleo4BSY9PuTCtcUbfulkcMAvjE+wIkboVWy8+Xr5nNAy\noiYXtz5uZ1FqUFAak1rw2imxhkmxoNDyKsqdRmgPs5LqDyA4iE0c0c+CH9xt\nzL1uffLVaHwmO/d1ycz23vX/Yp0dhp6zqNuptisgvVwkFGU3oVLkEfjkDL4X\n1CVXglHV5vdCzvBDXJR4VAlklrd/4t8eZsFDnwDtoWj2lSi7P7Bw6CuTOg9b\n9Y6pfRBll6XJGsJ7Fry2oIml5E4k4LnDzAzfLzSpt6deJ/qGViAzMJRltKqZ\nmLtUD0MupsdFNwMxlVajrpmexKjGe8Kb6s6iygcRLfwigg+xlvr5UzwK0HW/\nAFB9eHfZXgWDr0SX1IG2FElIj3HtNGnP8QfEev0e+nEM/KSqE4N9/L8lXUtg\npUP3nRK1JqffslIC0z8K+yXmIBoiaX9jRASI5Ezxcq80Qh3yrxMkaeyiX/nA\nNbqI4PZnuqzn0Ccv4DYYUTut5V33+PBt43LiC/fGAMy0FljhQoOGZsx6aada\nrDk7/cXjpqxxqPLycTTKsVa/Dejd+jPyMpmrLcK5+jhxHLrhHe02haiR9ul0\nnGt0BqWfzqHgTKuYySn2p1XqeP0zsR9BMfbqCSqPy81DOoblYdkMYN2Two2d\ns0AP\r\n=9ahg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDLDJLtz9vrpUN81jjvOvWXZ2lWb3XtnKfjVtmXpF7CowIhAIwFLbdD7C9xBMuF+2XU7ppoBkYT6Ut7B45FRRtBtGNx"}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.18.0-canary.f6a6ca38.0_1595349648945_0.07717975103365804"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.18.0-canary.647dd6b7.0":{"name":"@material/mwc-textfield","version":"0.18.0-canary.647dd6b7.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.abcdbcfeb.0","@material/line-ripple":"=8.0.0-canary.abcdbcfeb.0","@material/mwc-base":"0.18.0-canary.647dd6b7.0","@material/mwc-floating-label":"0.18.0-canary.647dd6b7.0","@material/mwc-line-ripple":"0.18.0-canary.647dd6b7.0","@material/mwc-notched-outline":"0.18.0-canary.647dd6b7.0","@material/textfield":"=8.0.0-canary.abcdbcfeb.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.18.0-canary.647dd6b7.0","@material/notched-outline":"=8.0.0-canary.abcdbcfeb.0","@material/ripple":"=8.0.0-canary.abcdbcfeb.0","@material/shape":"=8.0.0-canary.abcdbcfeb.0","@material/theme":"=8.0.0-canary.abcdbcfeb.0"},"publishConfig":{"access":"public"},"gitHead":"ebb4e6346746ba552191ef32f6686136b75b1a6b","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ebb4e6346746ba552191ef32f6686136b75b1a6b/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ebb4e6346746ba552191ef32f6686136b75b1a6b/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ebb4e6346746ba552191ef32f6686136b75b1a6b/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ebb4e6346746ba552191ef32f6686136b75b1a6b/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ebb4e6346746ba552191ef32f6686136b75b1a6b/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ebb4e6346746ba552191ef32f6686136b75b1a6b/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ebb4e6346746ba552191ef32f6686136b75b1a6b/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ebb4e6346746ba552191ef32f6686136b75b1a6b/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.18.0-canary.647dd6b7.0","_nodeVersion":"10.21.0","_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","dist":{"integrity":"sha512-wVdFzZI50H+RvVFHRG6OfK87zjtomGs7eLkSFdtvCwcwvr7xBSBKQgyyl6sesb8RZRRVDaz6mLrghaYFqEk3Bw==","shasum":"14c100c18eb95a512f9712471abe69ae5bd28aea","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.18.0-canary.647dd6b7.0.tgz","fileCount":16,"unpackedSize":262540,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfFzdyCRA9TVsSAnZWagAA+scP/20NyzA32cPlkwLxL1vx\npVSJC/DBglBzX/1+IgMhvE+1F/5Yhg3OlmoRtTrQadjzPwqDG014QcjZgDNF\nYl8dvbzkKf3u/rYEi3KbJ6b9EM6V4c05qsRAyaNjyCu9OhbVoIJrvyRGrWV9\nOLaETB9S66Dq+Y6VV1gGNNNZEJVn+6EHmKZWiaLGtFDmY8RvwomyGvSx0Beo\nOAUg3tu3y7tG7137awMhVhsvaHRXn9eYiBteWPr7W6pxyITk6n0S0+l7xWgI\neniDyGHi2p+JBqgj/88kqw6pp3xmFvEyy7JjPLizPfUkX2KA0nM7V9uxkfMR\ncBOj2VSrQ5NtncRbX7QOKtUp06QbPH2F3lzDwIc0a9XusqkYOtV3ocKKwfoh\nv0NhIzaaQGmXBreUvQlH9awUdPLhr7OHM7eOkuK6RYKxgztuvoOgmCT83Z19\nmGhDhS3g2CMC377vfzUR7G3FwbWhTxErrw9KY/oD8lP+J3nkkDWZaqeeGJ+c\n6V9mT1fKArB0avN6clkwSFXI4VOf9GFrJAP4HIQqtO0PqWKz7857aFYaq6Lu\nxSYoJM+9Imszkq8yE1aAqsYrkNUDNap2jv9RdhtDc6Fc3FFVmxQCqq/hk1wL\n8s7nVurP3J4FeF+PM9NK9drcT1CVIbxmiI5kvDX32OAk0F1MgDrpJdZ0pSrc\nJohJ\r\n=qcPO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID/Cwejjrai9544bKG/UI87qWr4ZWaN1KF1gozqXu7s9AiEA5Z27T4FcIBo1yYY7ZgmZW8Z/kc+luPF6E3Vx5r9yTJo="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.18.0-canary.647dd6b7.0_1595357041593_0.7696526705592195"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.18.0-canary.3cb7406f.0":{"name":"@material/mwc-textfield","version":"0.18.0-canary.3cb7406f.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.abcdbcfeb.0","@material/line-ripple":"=8.0.0-canary.abcdbcfeb.0","@material/mwc-base":"0.18.0-canary.3cb7406f.0","@material/mwc-floating-label":"0.18.0-canary.3cb7406f.0","@material/mwc-line-ripple":"0.18.0-canary.3cb7406f.0","@material/mwc-notched-outline":"0.18.0-canary.3cb7406f.0","@material/textfield":"=8.0.0-canary.abcdbcfeb.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.18.0-canary.3cb7406f.0","@material/notched-outline":"=8.0.0-canary.abcdbcfeb.0","@material/ripple":"=8.0.0-canary.abcdbcfeb.0","@material/shape":"=8.0.0-canary.abcdbcfeb.0","@material/theme":"=8.0.0-canary.abcdbcfeb.0"},"publishConfig":{"access":"public"},"gitHead":"18d8050825886f251014bddc9658829794a0010c","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/18d8050825886f251014bddc9658829794a0010c/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/18d8050825886f251014bddc9658829794a0010c/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/18d8050825886f251014bddc9658829794a0010c/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/18d8050825886f251014bddc9658829794a0010c/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/18d8050825886f251014bddc9658829794a0010c/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/18d8050825886f251014bddc9658829794a0010c/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/18d8050825886f251014bddc9658829794a0010c/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/18d8050825886f251014bddc9658829794a0010c/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.18.0-canary.3cb7406f.0","_nodeVersion":"10.21.0","_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","dist":{"integrity":"sha512-OMsrBNRL/SZTHfxEFuHg0i1GOUnlNMu0AoOHKxNjmUlUV3q5DlHiRhCCtXF8dgiRi2V8g2P+yfi+JnG5XG/lHQ==","shasum":"60800b57b77efafa6ba8dad6ae6428aa11eda765","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.18.0-canary.3cb7406f.0.tgz","fileCount":16,"unpackedSize":262540,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfGIwYCRA9TVsSAnZWagAAAF4QAINgmutVb8gMNC4kMqTa\nLPYGI+EL218QyHuxYkVyKJRzmvwiG4c/jmKNXhbQbGVOTCNAW+/4Lg5OBRMD\nCVuLZN3HWrxrIqom+j0ZJBMxnsT/rbJyvsYHqHpWb+am5KFQrQxu0aCRf7QM\nsBWnthKWUh+nFdu+POqPc30XSlOhvGwZoAsx+ezVBgHQc6mGIX8pdn643n3l\nUA8SS0GxiFs3X09tcRGeB1YrJjbI7bcRP5lswGe8YRfcCkuQHRf0Qbic0b82\nOsOHf1ea/wrc7vj0GMYslluLCppfbhLE1I1JO6rfFrpqTXs6sowc/jLrXJVH\nbpJtXqKiwUy67yFrvMVrExg2P5M6WVGMf3jgSJZgVyzhbHGOS8dttYP5gWI8\nzD9AmKNjCicRFT+C56VuYSndMrWZiGUek3ZS4anqBNF+61Qpt39kySY/rmPd\nRgqGAQoXzzK+94kzS6kKLm7wZnqrJhZez+Bdwb/GzubMeeKbcx4YTxL8akHE\nihBLaSGYz/LFGxXxdcEm4hBtTuPaKziKyOrZyxVTyUB7Qa2RPys7yUts01qZ\nRDdmaNB5YYlktqwqrhnAbr+1b3RUrLO21i2i6KlOsVVo8Oko9dl4B2AaJofJ\nUyEN1Ff8Ziuf/dHl3/mA2+NLsSMNzP4Vxn/uV17zbEf2ZpceMtAJbrGj5YNk\nqRvT\r\n=FXSw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDVS6DuFe6y28y0XCpNgs62U2ZtT5InDvfAn7C0/Ba/XwIgZzuOb0BIAB4Z8HaXGxhIManJhi+gMYH5G2ql/DWoxn4="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.18.0-canary.3cb7406f.0_1595444247517_0.929720534892861"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.18.0-canary.5717a5a1.0":{"name":"@material/mwc-textfield","version":"0.18.0-canary.5717a5a1.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.abcdbcfeb.0","@material/line-ripple":"=8.0.0-canary.abcdbcfeb.0","@material/mwc-base":"0.18.0-canary.5717a5a1.0","@material/mwc-floating-label":"0.18.0-canary.5717a5a1.0","@material/mwc-line-ripple":"0.18.0-canary.5717a5a1.0","@material/mwc-notched-outline":"0.18.0-canary.5717a5a1.0","@material/textfield":"=8.0.0-canary.abcdbcfeb.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.18.0-canary.5717a5a1.0","@material/notched-outline":"=8.0.0-canary.abcdbcfeb.0","@material/ripple":"=8.0.0-canary.abcdbcfeb.0","@material/shape":"=8.0.0-canary.abcdbcfeb.0","@material/theme":"=8.0.0-canary.abcdbcfeb.0"},"publishConfig":{"access":"public"},"gitHead":"80cfd9e67c10918291b4799451796c633cec6f96","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/80cfd9e67c10918291b4799451796c633cec6f96/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/80cfd9e67c10918291b4799451796c633cec6f96/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/80cfd9e67c10918291b4799451796c633cec6f96/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/80cfd9e67c10918291b4799451796c633cec6f96/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/80cfd9e67c10918291b4799451796c633cec6f96/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/80cfd9e67c10918291b4799451796c633cec6f96/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/80cfd9e67c10918291b4799451796c633cec6f96/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/80cfd9e67c10918291b4799451796c633cec6f96/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.18.0-canary.5717a5a1.0","_nodeVersion":"10.21.0","_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","dist":{"integrity":"sha512-grqUFDXKMOs24eF5qvjrhs28eqrPhLqieN/+PKzQmboE+i46gFmpATTyJ6g7cj6KzqQJp+FRHzMKWzOf5bTyIQ==","shasum":"1c3f54e3552df9d40151bf6cc924a8f051b116dd","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.18.0-canary.5717a5a1.0.tgz","fileCount":16,"unpackedSize":262540,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfGLIpCRA9TVsSAnZWagAAN1IQAKKG0IV9vZS0zlJEghV9\n30SJxMrcgRuye52q4+QbF6qUwsC90y35A8rmgPJR5DIebl7GLgSuuPh2BHNW\n9uzXgP4NWubAVjE4cIomg3dBEeLi63XaGYuhK3aQvSjc9cD5hBbP5sQ66oXA\npD/cm1nVzc0yd05o8IVAXqA0SwkWN5f99bSTEMp+TVbOBV3cOvKCyR2CfFN3\nJzo1W0vvDTn2qXuAWriqkZ/cFdABy9WxESn7I3VvzC5++QI5iTkxVmuP5mtJ\nqe2hgXXDXKiYc+dgk/4u78tCLNMJqPrPddsMZkb1ps6yN0cBl2/gekqFsa0w\nmn+Pj9AO6Z710QHAz3Y/RYc5PaI46ICfZbkdJmM5NqOB5rcKDQ1it+TPH+lh\ncCbTAiB+AKRwA/sYf+FMln3HTD+kKjfFsVqBqGfkfhyQjpJwdne6CYnMjRjq\nrOIq2RWJ1IkyKgiii/ITTDJyHPdxMhFTf8oXHvSAjTagc9G1Su+rdmU9NpWS\nBqgJiMfkOm9DjgjzG42w/iAZglwF77uTYy8Bsu/6zCRxiPQ+the1OwtOfVIa\nrFpEPZmtNRt+5dtBOyneTmQDTA99hP5apvaBAXgQodiZeGC6L/3Aq8o+gZ11\nks9yWQfH5890tEMfHljZ/8gT1N3Ry2jxiZjnkVuVJ5vz0IXXjCBLmlbWcMbB\nSFEc\r\n=ehls\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCPSjcPfttV+EPxw7d/Ozq6sW04pAIQAyJJnOIXSC3xhwIgBIkmkEMbVOZ0paXmMxcAY1JcVqrJY+CmEOwrskaR1F8="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.18.0-canary.5717a5a1.0_1595453992785_0.9695213652252928"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.18.0-canary.d84cd4b2.0":{"name":"@material/mwc-textfield","version":"0.18.0-canary.d84cd4b2.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.7bd5075de.0","@material/line-ripple":"=8.0.0-canary.7bd5075de.0","@material/mwc-base":"0.18.0-canary.d84cd4b2.0","@material/mwc-floating-label":"0.18.0-canary.d84cd4b2.0","@material/mwc-line-ripple":"0.18.0-canary.d84cd4b2.0","@material/mwc-notched-outline":"0.18.0-canary.d84cd4b2.0","@material/textfield":"=8.0.0-canary.7bd5075de.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.18.0-canary.d84cd4b2.0","@material/notched-outline":"=8.0.0-canary.7bd5075de.0","@material/ripple":"=8.0.0-canary.7bd5075de.0","@material/shape":"=8.0.0-canary.7bd5075de.0","@material/theme":"=8.0.0-canary.7bd5075de.0"},"publishConfig":{"access":"public"},"gitHead":"c90ecef90fa937fc0931100e4f1d3627211865dc","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c90ecef90fa937fc0931100e4f1d3627211865dc/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c90ecef90fa937fc0931100e4f1d3627211865dc/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c90ecef90fa937fc0931100e4f1d3627211865dc/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c90ecef90fa937fc0931100e4f1d3627211865dc/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c90ecef90fa937fc0931100e4f1d3627211865dc/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c90ecef90fa937fc0931100e4f1d3627211865dc/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c90ecef90fa937fc0931100e4f1d3627211865dc/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c90ecef90fa937fc0931100e4f1d3627211865dc/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.18.0-canary.d84cd4b2.0","_nodeVersion":"10.21.0","_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","dist":{"integrity":"sha512-z0YIXiNx+MtUFZCsFbXwOT73XaCe0JxnhREub76+YhZWk22RGO0zGZafgMIUxaPlWZQiMA93GB63iH1NeUQe5w==","shasum":"c593b73e579d9f38e94a75f1bccb17f4e483fa5d","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.18.0-canary.d84cd4b2.0.tgz","fileCount":16,"unpackedSize":262540,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfGLKgCRA9TVsSAnZWagAAonwP/RSQlwLq3B+w3W4ir/Nt\nWr9u5AIgTxZ/txGtu3nHr0j5PVhHfQIch4wG5b1xitnAGWJBiOIMR6Az66nB\np6ihw/QWtPDDOF+6LTjZDYtYIUXQxADRZQ3SSBikqUXUl4qCQGe991rpSIjw\n2J5+3kMl1IUnoKnLR+QkNDhd7ZXDBQvgeThezNqX7BazSBNCRrZXjFu3ODlw\ncpvVVZAhgUGjOxxIwdA589hjIql/d21VwUH2qqUzcV9nNtblqm1k813nNd+T\n4fguKDFdlxQfNeswSbw5QOBhzg1i8cjsiOb8v1DD7UWUrfOifVPj3NecI5xA\nq9g3aLhJoyxk5Ut2gNyy20sBtgP+5+n+mLzulzzbIYOqYIfQ1tqrlBv+VM2i\n21H6HkZ0darPnDLToswlt4dq9VTHXx4SVRlZcXDt8ODYdAwg/FO5L7Tqnydg\nukB1FCSyUmiWNnSA274oZUANtdGoToTgCWhsi1PbhLXo3vTA88nfdOg9yM1v\ncOi1HKFkC9mkPwx2fDbwhfnyesGein8qTHRXN5E83iPP5+g9CmcotzfIHDdA\nGjNVesnZuuTc6iygJZuzAL7We8eTBIToxeNLCRr4dG3wHwwGLbN3w532XMBE\noSy+Cue8tYJDOYPXR0DDKAR6ZbqcYHW8giMZEQJhPsb7qP6PEwQQfkzKmI2y\nX1Hp\r\n=I8A0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC9rmyCVboHlQgHvJF53QabJt2whxKxh3toX+rbV9XkLAiEAszIQmt12OcWvN+wgQvit8fuOmTLFlKi8Jl854cV+wMM="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.18.0-canary.d84cd4b2.0_1595454111842_0.11181032518482326"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.18.0-canary.f279e7fc.0":{"name":"@material/mwc-textfield","version":"0.18.0-canary.f279e7fc.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.7bd5075de.0","@material/line-ripple":"=8.0.0-canary.7bd5075de.0","@material/mwc-base":"0.18.0-canary.f279e7fc.0","@material/mwc-floating-label":"0.18.0-canary.f279e7fc.0","@material/mwc-line-ripple":"0.18.0-canary.f279e7fc.0","@material/mwc-notched-outline":"0.18.0-canary.f279e7fc.0","@material/textfield":"=8.0.0-canary.7bd5075de.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.18.0-canary.f279e7fc.0","@material/notched-outline":"=8.0.0-canary.7bd5075de.0","@material/ripple":"=8.0.0-canary.7bd5075de.0","@material/shape":"=8.0.0-canary.7bd5075de.0","@material/theme":"=8.0.0-canary.7bd5075de.0"},"publishConfig":{"access":"public"},"gitHead":"73c3335df275cf5fb17f3b990df9c4b8184ce3ed","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/73c3335df275cf5fb17f3b990df9c4b8184ce3ed/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/73c3335df275cf5fb17f3b990df9c4b8184ce3ed/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/73c3335df275cf5fb17f3b990df9c4b8184ce3ed/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/73c3335df275cf5fb17f3b990df9c4b8184ce3ed/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/73c3335df275cf5fb17f3b990df9c4b8184ce3ed/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/73c3335df275cf5fb17f3b990df9c4b8184ce3ed/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/73c3335df275cf5fb17f3b990df9c4b8184ce3ed/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/73c3335df275cf5fb17f3b990df9c4b8184ce3ed/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.18.0-canary.f279e7fc.0","_nodeVersion":"10.21.0","_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","dist":{"integrity":"sha512-hyWUz55+MrK0NyJiQWWSPWtpwyxwIU1+FJjWCzoQ+DlFAK2T+j+8sG9TBEIE32jsmKqN4xpWyggGD4i24bFNeg==","shasum":"1ee03bfdbedbc6dd4205adba33d4280e2e1da839","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.18.0-canary.f279e7fc.0.tgz","fileCount":16,"unpackedSize":262540,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfGLcYCRA9TVsSAnZWagAANM4QAIS1KYO6VfUHC30Lf9j+\nfZtVh9AU4/N+FPjKhLmVipKGKubp2zD6dC41xrLiPxPYXNBcMtsECqUvaZD7\nQspMFbtQUT8znGYm+A0LXvrD7Z+FjdBNh+GwmTuj6vjx3A6LFZBQWpazsSL8\njmv+w9BBizVEGBQQwk0DLQAabOWfVdWwWE8+Tk6loL6HggHCQOhQhPhTyDsf\n7Y8GJ3dW5/vtKD00RYWDGczJf1nNN50jCwMmD2cHu+VYDpB9m27Nq4AH8tPr\nxowAH971AtHqgyH3PrqsepSggQDUEhwdDoAs9rn+2PZy9/mUoQpsOyTNGMho\nHaq09eqn5ZFd6v+iRY2EII+pVV+G0K8hgeLnhoXvUpE9zAOAlNOzPnEv83Oo\n2yQ+I6P9nB/9xMctDAcsDj2LlOuom08A91KHDaeee+rji/y12ovMALEN+Lax\nD2nVhAY28T6XpZvX8Jg4n3/vObdIV8LUcDVEIQ2yJhpquNo4VAW1fPrnTqd4\nVlPIiQrcL3w1+NgFmAGyia7XwdwwCikK4Vd6qsBLUWGpuW4HKPbdCUZm8LqD\nU2V3Y4LhxpVQtQNishWVBzvEO9nsqE9SFdUI07OMkMralUu4xg/JKm6VIqrb\nZVHEurNQUKCziovpBk7g06Z9DJXwn9PPO0yGggYddpji5Zjm7q7TvrR918sf\nqQl2\r\n=59uy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD+j0ptvO23TUTLyLmq9twydSHqiy+q73WGhMmR+elwowIhAKwaZFKzZYItNr4e/rb16lswHttTy0r94S4eibsX4df2"}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.18.0-canary.f279e7fc.0_1595455255961_0.8656251888850517"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.18.0-canary.f181e3bc.0":{"name":"@material/mwc-textfield","version":"0.18.0-canary.f181e3bc.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.7bd5075de.0","@material/line-ripple":"=8.0.0-canary.7bd5075de.0","@material/mwc-base":"0.18.0-canary.f181e3bc.0","@material/mwc-floating-label":"0.18.0-canary.f181e3bc.0","@material/mwc-line-ripple":"0.18.0-canary.f181e3bc.0","@material/mwc-notched-outline":"0.18.0-canary.f181e3bc.0","@material/textfield":"=8.0.0-canary.7bd5075de.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.18.0-canary.f181e3bc.0","@material/notched-outline":"=8.0.0-canary.7bd5075de.0","@material/ripple":"=8.0.0-canary.7bd5075de.0","@material/shape":"=8.0.0-canary.7bd5075de.0","@material/theme":"=8.0.0-canary.7bd5075de.0"},"publishConfig":{"access":"public"},"gitHead":"33201638ca11f3c34598273b4ab4ec40bb019951","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/33201638ca11f3c34598273b4ab4ec40bb019951/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/33201638ca11f3c34598273b4ab4ec40bb019951/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/33201638ca11f3c34598273b4ab4ec40bb019951/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/33201638ca11f3c34598273b4ab4ec40bb019951/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/33201638ca11f3c34598273b4ab4ec40bb019951/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/33201638ca11f3c34598273b4ab4ec40bb019951/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/33201638ca11f3c34598273b4ab4ec40bb019951/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/33201638ca11f3c34598273b4ab4ec40bb019951/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.18.0-canary.f181e3bc.0","_nodeVersion":"10.21.0","_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","dist":{"integrity":"sha512-UxmGe02gdOvFU1yy4p0KT/snQ4gvlBpFL0c3nGRXBL4Bml/p8hdaaDYC5giQAXilGG6w32/rsNVpUn004L2Jog==","shasum":"35f9bff468da913b50e24a736bac4ed6fb0fdc5b","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.18.0-canary.f181e3bc.0.tgz","fileCount":16,"unpackedSize":262540,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfGLd/CRA9TVsSAnZWagAALhsP/22r/g4TMW562FQA7Wrn\nCZgW5u7yww1jkYo4oVKtHMO68uG4hFmG/5BoDw5d1SKUDZjbOF2s9wG5/XMo\nQW9+8oQ3kdwnKY1/vl8uCi1HAK9E964c/8r3JZp/c4mI4mk615227BA/ht7H\nfJ9LGF0SFbnJpFOdJxWrAePoCYYgHaxbfOecG9WhTHouXdRGwL8IZ1HfNyun\nCHe4U+UZtqGEByXRzKjqIQRV8eEpCQQbN6xv6f3+t5FvDGVZFbvD2tb9ojrK\ncqnzz9dlk69yEKCVSyAQwzf6imLiZqGu10PZK96NXyPIofPTTn+ZECNhrgRH\nqrZt0pTL54rO8otrpkWnbmOPkAevbpXDN2h9FSs5FhD3ECi3cQ6/pOCFssYj\nlhYpWmpu+rrt89+aNM42ytDJCoNDULyp/VdnVUGynyEJYtD9FoFHQjyvbkuO\nlFTlFs0wC8VLFEXC9HGya56FAWXVRoq/FIlAu12X9wZ7R7BPZpdh9gUaIm64\nJayUKoOa+5AEeGqVrNFf/EO9tRL3f6xwEePWMWB/rOz5dV4ZuxCyMbXZo7n3\nKghjIGFbUjXknBFxsbWFZVYNDM9USl1Qe6vD/lnXx9KDauiyM3MgD84D6/1S\nmGHkX0Wj9vdt1OH/03whAo4ZJZz5w81WAQvgCZ/vh3S3vfIwjK0FPPFx9HoN\nyqPM\r\n=cHyf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDTCkmukoDQgMDi0vU4d6+Ne7c04i0ied0JVHInyM+iWAiEAjx6oKh3I+Gcq1cXeXhXbXTfjNxhl0nDRbqTq4mbi7rk="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.18.0-canary.f181e3bc.0_1595455358626_0.06601014392058024"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.18.0-canary.346a622a.0":{"name":"@material/mwc-textfield","version":"0.18.0-canary.346a622a.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.7bd5075de.0","@material/line-ripple":"=8.0.0-canary.7bd5075de.0","@material/mwc-base":"0.18.0-canary.346a622a.0","@material/mwc-floating-label":"0.18.0-canary.346a622a.0","@material/mwc-line-ripple":"0.18.0-canary.346a622a.0","@material/mwc-notched-outline":"0.18.0-canary.346a622a.0","@material/textfield":"=8.0.0-canary.7bd5075de.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.18.0-canary.346a622a.0","@material/notched-outline":"=8.0.0-canary.7bd5075de.0","@material/ripple":"=8.0.0-canary.7bd5075de.0","@material/shape":"=8.0.0-canary.7bd5075de.0","@material/theme":"=8.0.0-canary.7bd5075de.0"},"publishConfig":{"access":"public"},"gitHead":"03c5331dce90f41a530d3c8569d87c9569257d13","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/03c5331dce90f41a530d3c8569d87c9569257d13/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/03c5331dce90f41a530d3c8569d87c9569257d13/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/03c5331dce90f41a530d3c8569d87c9569257d13/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/03c5331dce90f41a530d3c8569d87c9569257d13/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/03c5331dce90f41a530d3c8569d87c9569257d13/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/03c5331dce90f41a530d3c8569d87c9569257d13/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/03c5331dce90f41a530d3c8569d87c9569257d13/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/03c5331dce90f41a530d3c8569d87c9569257d13/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.18.0-canary.346a622a.0","_nodeVersion":"10.21.0","_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","dist":{"integrity":"sha512-P/f25cfxS9twY8uaP9aoJlv/T22Wtfvhvp6fEURbzUzhzSizn7qOCs+KWJCJ5AUChcAzYlLpcoobnY1y2VvISQ==","shasum":"72ce19f94f69b56073edc7f310dfe3047d20453d","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.18.0-canary.346a622a.0.tgz","fileCount":16,"unpackedSize":262540,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfGM5LCRA9TVsSAnZWagAAL1UQAKReCG+CDTRgXtA5Jnld\ncf4pyeEFWNYtOS7eESYZaxEmkZ5bZJJppzmm9iVLQ1qMREoWbkEdgvbBSfNb\nZiT9MjIGA3E1g3hIVkL8dnBfI5QEd1ovNjgX2AUCMTUZeHnGAoePVFJdkoek\njz1HzgE4+//vHnrwtlG91fdgINRfcT3D9saKR3ddWmGFmXc4IjGUKnA0bkQi\nBbX/8Et1vvLHqmbxV8QFhSLPWTNXM55XEiVsFEx9h8vJVSluflrsDeRX/+Gi\nE8/VMfIbr/vfl9Rh7vSpmnKr1LFUguo7Qkw7DxnsP5Xpkq/MVczdX82NH7zB\nhMJ28TI9Z8B6QkDYolxpOWAFTkHW89gadobRQwn+/YeVo55g2HOmXyzA23nr\nE0M32FHx4eq96NGS5stisOnzlTsfecJyv9EyIsuMg1bzehkWmuvvRsOe4C7S\n1TvPbAZbVsUCY5PBspoI8X1+wZ43AMZ/AiqsXn1Dl8PsQXXdFY2dAhSDybeW\nT7WDGerHAcIBRE3dU+otmgmRBBu4s/0ecxmxEnEuFSbcz+6VYUQ9spvGfd/c\nBLpJmX09m85DyLfWvI/GC1neV6AZq8VGtz+/mnOaW00+b8M64iECpYOSXYKy\nqizqQ2WD8y+ce++s1iP62ng0OzW+TOJfyf1zCq/rSeoXqypTdSwqYL2suO2u\nv7UI\r\n=pDVK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDHl1Nw8OXGw1f5+zgw2seCJkEjbxZ/Ejmwz5XZ2npMZQIhAOZMZkygza4E1zrIZxc9utKU4LYDZv1oBFE29QX1fNWa"}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.18.0-canary.346a622a.0_1595461194812_0.08599584610408484"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.18.0-canary.c9e8a848.0":{"name":"@material/mwc-textfield","version":"0.18.0-canary.c9e8a848.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.7bd5075de.0","@material/line-ripple":"=8.0.0-canary.7bd5075de.0","@material/mwc-base":"0.18.0-canary.c9e8a848.0","@material/mwc-floating-label":"0.18.0-canary.c9e8a848.0","@material/mwc-line-ripple":"0.18.0-canary.c9e8a848.0","@material/mwc-notched-outline":"0.18.0-canary.c9e8a848.0","@material/textfield":"=8.0.0-canary.7bd5075de.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.18.0-canary.c9e8a848.0","@material/notched-outline":"=8.0.0-canary.7bd5075de.0","@material/ripple":"=8.0.0-canary.7bd5075de.0","@material/shape":"=8.0.0-canary.7bd5075de.0","@material/theme":"=8.0.0-canary.7bd5075de.0"},"publishConfig":{"access":"public"},"gitHead":"bdd3a24691563386cbeffdb8824ffa26a3c03ba3","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bdd3a24691563386cbeffdb8824ffa26a3c03ba3/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bdd3a24691563386cbeffdb8824ffa26a3c03ba3/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bdd3a24691563386cbeffdb8824ffa26a3c03ba3/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bdd3a24691563386cbeffdb8824ffa26a3c03ba3/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bdd3a24691563386cbeffdb8824ffa26a3c03ba3/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bdd3a24691563386cbeffdb8824ffa26a3c03ba3/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bdd3a24691563386cbeffdb8824ffa26a3c03ba3/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bdd3a24691563386cbeffdb8824ffa26a3c03ba3/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.18.0-canary.c9e8a848.0","_nodeVersion":"10.21.0","_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","dist":{"integrity":"sha512-QEGZRmngI7C/Zu7dnarn0SHIMkCddw8ryK+zEa9ljvPo/xnhit/zkwfYoPYWRToVJN18atKrl1gru4fdjIAwKA==","shasum":"27bbf0e5262f3c61e12b70bcea8ac26229b6b9e1","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.18.0-canary.c9e8a848.0.tgz","fileCount":16,"unpackedSize":262540,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfGON7CRA9TVsSAnZWagAAO1IP/0Ak6qi5sMGZxNDdFmzX\npacWyf5n0Va6Y3zkFAl3G8Ai4zHRzVKAZ1u6wPnTy9Ox1prBc/CtzYv+yXw1\n34b/flQpszgxEtImrQ8b5PAKj0hDoMNHRY8vZAWlDldu4VyZDjon4OEpHp4w\nMr3whp30qECy3deHlQ1w3AYkC2T69lxaKOvU+upjc9sgS7lVUgol8Ih0f71f\nfxiefIgrivOQkEWshoGXz460WsIac9iVdYpxeFko9cCY4v9F23ecxkgzznB+\nr9DzbkbNJaguSjDCXo8BGmiYNSfKscHlgNM8Yljf52zb83BPsyQ/MtSPAdSC\nff8EaJZlR08LTCCoqrXS9FC9CyI+QyXd7K/+SozvGLX+amgaYaC3FGjkqE0E\nzqO5Q4IqdUC48vZ+HvTluE+EQo78sHNrBcNCdjKBEWcvpV1yr1cDbt/j0k7d\nPLkGN1eJ3VoX4KkXTsaZV58EJtnNnj8bpje9P35JUqCFMFyulMOP9nHJ1mWe\ngkdjURoPNJbP5O5tF9AFDh7oqAo5QbyWity3xqXjnYeS8Tu5SGPAYp6yHFl/\noASCwSDFiKYSf6T6/BBKiHKA5effW5y4z3SmaRxDE4Q+Tv/4WoxHDDrdfbPW\n09elGp3qulpxLxg52kJBvDV5LTTKblU6Q+FAHJ65u1EG0Y2CrZlHdTs26m24\nUDLx\r\n=SpTI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDqXmqCesGpmSAtn77urwNqGdhKFbt6KTJaH0OfFEk1DAIgPdfyLOmsLScbd1vWun5PImDQng5RyKk81w31Gt4WSz8="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.18.0-canary.c9e8a848.0_1595466619388_0.5584481387920011"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.18.0-canary.718c385c.0":{"name":"@material/mwc-textfield","version":"0.18.0-canary.718c385c.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.7bd5075de.0","@material/line-ripple":"=8.0.0-canary.7bd5075de.0","@material/mwc-base":"0.18.0-canary.718c385c.0","@material/mwc-floating-label":"0.18.0-canary.718c385c.0","@material/mwc-line-ripple":"0.18.0-canary.718c385c.0","@material/mwc-notched-outline":"0.18.0-canary.718c385c.0","@material/textfield":"=8.0.0-canary.7bd5075de.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.18.0-canary.718c385c.0","@material/notched-outline":"=8.0.0-canary.7bd5075de.0","@material/ripple":"=8.0.0-canary.7bd5075de.0","@material/shape":"=8.0.0-canary.7bd5075de.0","@material/theme":"=8.0.0-canary.7bd5075de.0"},"publishConfig":{"access":"public"},"gitHead":"dbfbcdf25eee8ad94b581e3e4da50e65b4ebce74","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/dbfbcdf25eee8ad94b581e3e4da50e65b4ebce74/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/dbfbcdf25eee8ad94b581e3e4da50e65b4ebce74/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/dbfbcdf25eee8ad94b581e3e4da50e65b4ebce74/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/dbfbcdf25eee8ad94b581e3e4da50e65b4ebce74/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/dbfbcdf25eee8ad94b581e3e4da50e65b4ebce74/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/dbfbcdf25eee8ad94b581e3e4da50e65b4ebce74/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/dbfbcdf25eee8ad94b581e3e4da50e65b4ebce74/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/dbfbcdf25eee8ad94b581e3e4da50e65b4ebce74/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.18.0-canary.718c385c.0","_nodeVersion":"10.21.0","_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","dist":{"integrity":"sha512-8W0sfLbQzQjzj7imnBOR4oiWiUm0/r+W5ebWTu2IJONmKVbJ66O+5b1RQBI/pZMhFLTYsEbK15mYvHS8Te69sw==","shasum":"ebc96480448119ba4c46f1487ba3c80a75a047e3","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.18.0-canary.718c385c.0.tgz","fileCount":16,"unpackedSize":262540,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfGe3ECRA9TVsSAnZWagAArx4P/2bPUNsSYFYMhCmD7Taf\ntDJb9NLThgw38KJzBcvZ29UFS2DJhO3YckSFptqprd5geOXVpPmNolmH8L3Y\nitTnPTphxHrQZ9XNOryCecFUm29BPVFyp8JW0Z5+ogLbP3wlXOVE6uJ2NhZe\n0hDUmGi0xpo+8jV9SaMQXT8v+Ixx6dBYA+Xu7sHAukTJXGbbbCLSq79kB3Fw\nxCISlkW7SmKp+XdARFKkk41+JrWf1vXlt4c+z1jg5KQ/F2GFQJYg06dayDkB\nrJCI83+S5J3H4ZoRY0y36aF+0ImlPacr37uUgmYcu7JybU5zzT0hj7DBaP4w\nlfioDzSlXz1EAZ6x9tLUAr4kxlH0h+aPXDUjAg1kl3djcql328vGKjQS7eeS\nJ2B5O3lSGQyJWEdBTm3CagdNK2bGXI04Qbp+iRKRYv+XkUukYaWOvqGwWAKR\ndfnayFcZ6nj+5SkGkSqe/F9NbsPHvnFYavydr/tx6PABU1cqEnHeNQP8/WFt\nCrBavhJqnoS3RzzHKTK8MPUb3/D+YGfbV6J6yIQhsHKdFegJEEfWRamO4pyB\nLtBWFzgWonCdlLTEgQEqErmrnzNMaHcbUk8EQDzBs5libWgLGPquJFUcDD4W\n4dMHxlPFeKC1WpQ2yGs1KN7J7ZGy6MYoTTw+ZARsWhEpoycVCNwcPBDQ8Dn7\nRCRe\r\n=1e5F\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA0C71phrAJO71lWArILW8I2xLxqXnfNw739MB2fOQtJAiApyNMsqSBcs4W9RaEzGuFJQ5uFbkakUP3kqHxyFU12ZQ=="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.18.0-canary.718c385c.0_1595534788173_0.5636563721999686"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.18.0-canary.cd516a27.0":{"name":"@material/mwc-textfield","version":"0.18.0-canary.cd516a27.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.7bd5075de.0","@material/line-ripple":"=8.0.0-canary.7bd5075de.0","@material/mwc-base":"0.18.0-canary.cd516a27.0","@material/mwc-floating-label":"0.18.0-canary.cd516a27.0","@material/mwc-line-ripple":"0.18.0-canary.cd516a27.0","@material/mwc-notched-outline":"0.18.0-canary.cd516a27.0","@material/textfield":"=8.0.0-canary.7bd5075de.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.18.0-canary.cd516a27.0","@material/notched-outline":"=8.0.0-canary.7bd5075de.0","@material/ripple":"=8.0.0-canary.7bd5075de.0","@material/shape":"=8.0.0-canary.7bd5075de.0","@material/theme":"=8.0.0-canary.7bd5075de.0"},"publishConfig":{"access":"public"},"gitHead":"e3b4c123ab8be0eaab91697be67dab225c8ea378","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e3b4c123ab8be0eaab91697be67dab225c8ea378/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e3b4c123ab8be0eaab91697be67dab225c8ea378/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e3b4c123ab8be0eaab91697be67dab225c8ea378/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e3b4c123ab8be0eaab91697be67dab225c8ea378/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e3b4c123ab8be0eaab91697be67dab225c8ea378/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e3b4c123ab8be0eaab91697be67dab225c8ea378/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e3b4c123ab8be0eaab91697be67dab225c8ea378/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e3b4c123ab8be0eaab91697be67dab225c8ea378/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.18.0-canary.cd516a27.0","_nodeVersion":"10.21.0","_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","dist":{"integrity":"sha512-E/3MAXOcj7+rv35204S1dk7Pa7vIlqakv0N60j7sVVjoWQm6oYkfz7Rw+Zz5wqeqXyBI1K3Pu6UTrhPt42pCUg==","shasum":"75795f0f5067e7c59d86139d53799a3d90619777","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.18.0-canary.cd516a27.0.tgz","fileCount":16,"unpackedSize":262540,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfGzI5CRA9TVsSAnZWagAAlUwP/3NdGigAcU1cRk5PH5WA\nS6hLN2x0aOKu2rMxbT4rJ4BoqlNoUvpPdIZMOlW0QZzM+vrzb580O1w08vK/\nU6MFHXyCacr+PlX4Ii/QsjuchDHh6tVNW4dEuR4wMFNs+4KOUI1U7ISxJqW8\nUg/lVYh/PBFAAY23iFf8/cuGaafYYznXneQzpp3ULkv8d5UXSVP4ofp5zPjw\nar32HqsNTV3RSiPxGVmmICOUX8jbc1frNIYTzYwsR1oYmNAGEM048q2uBG0A\n3ik1UEWoeblU1QijsWMNVK0rUSHmVbaRpUWY05TjdU7vx78s/7Y4nhiNOj5e\nap5rwPIt3X7fmcNWXuYKMnMokMp95TLdVM3aBfUTYRCFSFU1YGcUpBvsbk9W\ndEKFqzwlBYOlJ7y3CMCRyuN/cicaiagRgKAwZcjUr0MvFLejS6/eDs+A26wm\n7ctsCH6/Lsc8JdQ/PpoUXsuaYfidThDaqRS/Oso5Vl8EznKfg7UnDM2Rx183\nsWsKlswWbQOJHV2gQb8NgpQ3jkatLgU0FomahrNXRgbQ0zpfNu4de3OHmueO\nYWoe854eW9HNCQMRnwmiKn1PEi9MrF7K2lMg0aMmOlTVCr5fzFDAza3CVktC\n7GZsgaj5PBvM2gIH7tz825ZmRkk5q9DzkqmJpiSaxMSW6EvXp+i7MiRmm1va\n7G4Q\r\n=WLPH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEbd7eJY6PzDZSVrhz1szHwVRra5Y6kwkMr5ZlC245kEAiEAhBvCRB3TG5RJxnw6z0GN+Xr9YTwJD4iJ39sX7J5UpP8="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.18.0-canary.cd516a27.0_1595617849071_0.9467306873871726"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.18.0-canary.1f082191.0":{"name":"@material/mwc-textfield","version":"0.18.0-canary.1f082191.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.7bd5075de.0","@material/line-ripple":"=8.0.0-canary.7bd5075de.0","@material/mwc-base":"0.18.0-canary.1f082191.0","@material/mwc-floating-label":"0.18.0-canary.1f082191.0","@material/mwc-line-ripple":"0.18.0-canary.1f082191.0","@material/mwc-notched-outline":"0.18.0-canary.1f082191.0","@material/textfield":"=8.0.0-canary.7bd5075de.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.18.0-canary.1f082191.0","@material/notched-outline":"=8.0.0-canary.7bd5075de.0","@material/ripple":"=8.0.0-canary.7bd5075de.0","@material/shape":"=8.0.0-canary.7bd5075de.0","@material/theme":"=8.0.0-canary.7bd5075de.0"},"publishConfig":{"access":"public"},"gitHead":"ac40081dcdf0df5976402e0f1f63b1efef1f945c","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ac40081dcdf0df5976402e0f1f63b1efef1f945c/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ac40081dcdf0df5976402e0f1f63b1efef1f945c/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ac40081dcdf0df5976402e0f1f63b1efef1f945c/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ac40081dcdf0df5976402e0f1f63b1efef1f945c/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ac40081dcdf0df5976402e0f1f63b1efef1f945c/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ac40081dcdf0df5976402e0f1f63b1efef1f945c/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ac40081dcdf0df5976402e0f1f63b1efef1f945c/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ac40081dcdf0df5976402e0f1f63b1efef1f945c/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.18.0-canary.1f082191.0","_nodeVersion":"10.21.0","_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","dist":{"integrity":"sha512-5JH0OQMer02j/hyKGf4rt4c3gJWPscdX29czuy97GCPDwIK0Vu0BufvUQSw568DLmKoe8bo2i3mNQUPYwFChew==","shasum":"03ef7156e39dc9876e3f0a7aa809b8c71943617b","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.18.0-canary.1f082191.0.tgz","fileCount":16,"unpackedSize":262540,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfGzN0CRA9TVsSAnZWagAANGoP/j29BpZm+Gn9Quf8IJ8t\n5NPiqOUCK3h9xb7I7+z1RYs/OgydFipNWGQGwep8FqfmL2aEoNFmH9zNay2J\n7Qga9BCHlwP9KnWxEwGrDjoA8X/6mxV691M8t2tYFxJG02xCwVhKkiqmozgB\nqcfev8OyrTRyoJFJvO6iLsFXINyMzNUh3ovxhS86Do+bW7tfHtvmQou8SLBV\nxteYa/bMFmkGTU5gLmA8Txi8a5TV8PIvCZiJ749qscUpE7pk1gZiYepB7bac\nEWmwzCdBUYRj0VM961rEayA+U7l3gLivZ662nAadgRkF/xaLuSQwwIx9Wjd1\nkLMhxdqC81z1DBtfX+80450HpXnlI+cRQr2EmC961G2Wq8U1OFMw7A1zPO3P\nlhWfG4StWuJbZQRmP79XzXoH9W7ajm3Dn9+ehEuo9xujgFvohVCUahK9K03F\nlR/NpjZjDDtSJjzeVHj+KBYGH4eaDLy+p4ThDEFjD7bSDXt3ij9RmNHTRBIi\n0o0YCZYmj0ncv0XE7g5QA2VPJC6JH0zXS+UQZCuofLChL9oYcCMr/K5LNs8o\n5X9np20eOvCnO+i0f/oVQYawC1MXwicj85Tfd/0+wYneko3WhhQ9qxnswPCa\nxgbMUiGZvd1/vDnzwMjRqqUvWhDsU600s1Vfvp3tcz2wu6GDEJzGj7cCM8rz\nudKc\r\n=mpkz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCXzobMrfkbGg9fJbLs3oBbmv9dfByAK/93jKUhw/UqPQIhALf4bUh1b2eae8+vaEKCbvVDiIbsn5IJo1X1zqbMGlo8"}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.18.0-canary.1f082191.0_1595618163831_0.6942544814577813"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.18.0-canary.ea3e82dc.0":{"name":"@material/mwc-textfield","version":"0.18.0-canary.ea3e82dc.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.7bd5075de.0","@material/line-ripple":"=8.0.0-canary.7bd5075de.0","@material/mwc-base":"0.18.0-canary.ea3e82dc.0","@material/mwc-floating-label":"0.18.0-canary.ea3e82dc.0","@material/mwc-line-ripple":"0.18.0-canary.ea3e82dc.0","@material/mwc-notched-outline":"0.18.0-canary.ea3e82dc.0","@material/textfield":"=8.0.0-canary.7bd5075de.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.18.0-canary.ea3e82dc.0","@material/notched-outline":"=8.0.0-canary.7bd5075de.0","@material/ripple":"=8.0.0-canary.7bd5075de.0","@material/shape":"=8.0.0-canary.7bd5075de.0","@material/theme":"=8.0.0-canary.7bd5075de.0"},"publishConfig":{"access":"public"},"gitHead":"acc963dd578ca338baf9c6d33a6a341a215c42a4","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/acc963dd578ca338baf9c6d33a6a341a215c42a4/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/acc963dd578ca338baf9c6d33a6a341a215c42a4/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/acc963dd578ca338baf9c6d33a6a341a215c42a4/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/acc963dd578ca338baf9c6d33a6a341a215c42a4/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/acc963dd578ca338baf9c6d33a6a341a215c42a4/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/acc963dd578ca338baf9c6d33a6a341a215c42a4/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/acc963dd578ca338baf9c6d33a6a341a215c42a4/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/acc963dd578ca338baf9c6d33a6a341a215c42a4/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.18.0-canary.ea3e82dc.0","_nodeVersion":"10.21.0","_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","dist":{"integrity":"sha512-MCnXuMj42uKQ+kxjv8TOLIFcjW6fO0x0XxB/U/KjpjmYvmCbAS1B8x0pNihL+OfykoliznG6jwNg7JwFd/uqgQ==","shasum":"4ef89a288ce332e6f49c78d6aa9664071f64bcee","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.18.0-canary.ea3e82dc.0.tgz","fileCount":16,"unpackedSize":262540,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfGzStCRA9TVsSAnZWagAA9iwP+QBkuk958BnAk62uw5pW\nUTgj12n3DG6XgmOCUfN+ql8sOqm/zK/VkR8TtvVRgn1DJBoCP3ECp9bLrpgG\nWpGGM8AbTCCUoFXEKLd5mVQB9nUWvSkmTqXZyZN91vKu7axL7QDWa2y+9JtJ\nPWfXbLQgK8elq3wn/4uBqtSIPIuQfc8fhLcHMEjQaQGy2b60KvaubXFwi5DG\nw/ERYZ5T1ripin/1nMDSNh4pg76+8foRRgkhG9tbEoU2sbqzGLVyztoeLDzi\nK9/9VffhAABjAt3q+Wl0dWIDbuXP14Z/W5Ao0qof9Qym+s/lRM2wXB5ikh77\nPBuy+Wlfh2+Vjil3fVPBAj3p5nQELFFZBtLVaUxamYl0e+OEZllCQqWm4WzS\nQ8/TBZS6sf7Yrp1TfTq9HUnVSeM1eGr66POpbYdLHLqqAOZD9MvrWhDKUSiV\nntKg+PGIAFpTdGElGPfrpLmt1g10g6DqDMuq3GQQS733kXPjgmWPO/KXUGPQ\nBmf4Bz9r6cxi1lZ7EY9MmhEOaoCOkfyZqtyU9HMvMfWthrW3tjX6MYOoUVwM\n6ryubNdzmC+E5jgXsNUIQ9IuE/eU4wH5sBEyA8uifaLOZNxgXftcxpH5WzwZ\nEhWPu3FeyHnBJ9dNGRhHXhVnojeM6DwloLfmytk2wsAaynpiZ5gxCZhki5iC\nJIeq\r\n=9qKR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHVlg5+NrDEbu2BRdnBR9v/ZUk0bcnf3Y+nMBr35JuFkAiEAmoPq0ZdWJuWovs6sQXDBtymukxWyqcg32uvg1jRISNA="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.18.0-canary.ea3e82dc.0_1595618477477_0.2983174321098294"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.18.0-canary.94987b64.0":{"name":"@material/mwc-textfield","version":"0.18.0-canary.94987b64.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.5511e0aeb.0","@material/line-ripple":"=8.0.0-canary.5511e0aeb.0","@material/mwc-base":"0.18.0-canary.94987b64.0","@material/mwc-floating-label":"0.18.0-canary.94987b64.0","@material/mwc-line-ripple":"0.18.0-canary.94987b64.0","@material/mwc-notched-outline":"0.18.0-canary.94987b64.0","@material/textfield":"=8.0.0-canary.5511e0aeb.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.18.0-canary.94987b64.0","@material/notched-outline":"=8.0.0-canary.5511e0aeb.0","@material/ripple":"=8.0.0-canary.5511e0aeb.0","@material/shape":"=8.0.0-canary.5511e0aeb.0","@material/theme":"=8.0.0-canary.5511e0aeb.0"},"publishConfig":{"access":"public"},"gitHead":"53896e3bba08752d5bf8b9c64423a52c96fc448b","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/53896e3bba08752d5bf8b9c64423a52c96fc448b/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/53896e3bba08752d5bf8b9c64423a52c96fc448b/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/53896e3bba08752d5bf8b9c64423a52c96fc448b/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/53896e3bba08752d5bf8b9c64423a52c96fc448b/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/53896e3bba08752d5bf8b9c64423a52c96fc448b/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/53896e3bba08752d5bf8b9c64423a52c96fc448b/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/53896e3bba08752d5bf8b9c64423a52c96fc448b/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/53896e3bba08752d5bf8b9c64423a52c96fc448b/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.18.0-canary.94987b64.0","_nodeVersion":"10.21.0","_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","dist":{"integrity":"sha512-NxDqH0KHXY1o12q0bXHcIZjiunUopwh6kEVOhETnMCkadIJqWOv4fe8l6w1WY1oNLXuMWF8CwChmDO/kG0Oi/A==","shasum":"df144b65c05e4419328a30f94a3d491caf659605","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.18.0-canary.94987b64.0.tgz","fileCount":16,"unpackedSize":262753,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfG0P2CRA9TVsSAnZWagAAJ9kP/05UatXCPBIoOZX4n9yB\n6k+N7fanqNSTuNDxFtsAKQkA/BR1TG+hZ9RFRsnKomeHfpGyZEXfFgif7U6q\nscbzOFmrMdKh12VhLHG1spR937ttAM4p7yxGGpod+NCAel1+WC4TkDO+3G1D\nT3KY3xALZa6RX4mnUDRZQu4r3/3K7ha8xiiuhOLMfwAnfDO/5lemb0kwrMDi\nsYIKqsY5CeyFdRb3iMY2npWSBARQfaJo5R4OBclkJ3ljC/wa1+G+g1QCviJO\nswr9spkpoU6fl+Q/ju3yuYbnsw0qyX4RyQDymClTHmh3RDh54GzRUvbvD1ic\nXCReBRknYUhAvAoRy+LdBxtrYDwLg26wG2+2da3RnUIfZpKDnHFTRk9texUy\nWaSuhVUV1MbAoy2xqQNsAInFYcqf+4eplk7bJLWCohO6OziHOs+W8Rs4x/4C\nRDYdlqfJ/oG+pPWJr4gUFYA4257zwv5GKT2K0DsxqUKNausPQIxMo9ptNl/a\nuogSSZZ6XZqiUgbH8ZsM6GwGeeY9SojRkx5e0VGwdtmkx5RYznRPPd0jFbiw\nlFobRwDoDBVojVfAUj+Loj7AYZBTo4s6vKCEDuuCTbH8TmclUmZUy4XOtc6L\n9U0lZex/zzxrkwFlJYpDPUPV1Idm2YK6gduvS4ezRMs2IudROqKDtuw9I0BY\nBF2l\r\n=dmH5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDJJPFwfua8Lrlgcuk4pCgmFumZOQrtW5mGkx+z5fzfFQIgLE/H+S2HgNa8U6jFUUPA52ajN1ijc49cSlHmaFhLPu8="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.18.0-canary.94987b64.0_1595622389797_0.8939983899817361"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.18.0-canary.ff49b7e2.0":{"name":"@material/mwc-textfield","version":"0.18.0-canary.ff49b7e2.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.ac405eae1.0","@material/line-ripple":"=8.0.0-canary.ac405eae1.0","@material/mwc-base":"0.18.0-canary.ff49b7e2.0","@material/mwc-floating-label":"0.18.0-canary.ff49b7e2.0","@material/mwc-line-ripple":"0.18.0-canary.ff49b7e2.0","@material/mwc-notched-outline":"0.18.0-canary.ff49b7e2.0","@material/textfield":"=8.0.0-canary.ac405eae1.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.18.0-canary.ff49b7e2.0","@material/notched-outline":"=8.0.0-canary.ac405eae1.0","@material/ripple":"=8.0.0-canary.ac405eae1.0","@material/shape":"=8.0.0-canary.ac405eae1.0","@material/theme":"=8.0.0-canary.ac405eae1.0"},"publishConfig":{"access":"public"},"gitHead":"dfb6845469ead87e451744df01007d8532a7a5ad","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/dfb6845469ead87e451744df01007d8532a7a5ad/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/dfb6845469ead87e451744df01007d8532a7a5ad/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/dfb6845469ead87e451744df01007d8532a7a5ad/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/dfb6845469ead87e451744df01007d8532a7a5ad/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/dfb6845469ead87e451744df01007d8532a7a5ad/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/dfb6845469ead87e451744df01007d8532a7a5ad/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/dfb6845469ead87e451744df01007d8532a7a5ad/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/dfb6845469ead87e451744df01007d8532a7a5ad/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.18.0-canary.ff49b7e2.0","_nodeVersion":"10.21.0","_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","dist":{"integrity":"sha512-gCdbr9/+uh+Mbt9JMAszxXe4MfNQcP3183SZf/MkpiqgHlAhfh7YJx2mmTOeqbXwapEhZs91pyMBOV6hIWEXAA==","shasum":"5a652cdefd0868003bff031cd845064a20c6dd6c","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.18.0-canary.ff49b7e2.0.tgz","fileCount":16,"unpackedSize":262753,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfHyVPCRA9TVsSAnZWagAAtK4P/3DE0qXdmUx5gPo/ncpe\nA35IEmoiF7MNjMqGEMAnYzfo4jzAQ7eOLMLd/zIDv7w8Ipwau/EsIRduozd0\n7k2aysmPd611FMJo28WRgIy5uPX509/Hl3MC9bF09xq5SYRwSsl7lVQopd2i\n/+vN4o5UbM2Pw4kvaH7ZcBlr9kS9s06mHlOdCe0rLW1mnZQuGeWoLb7gGHn9\nNhpu3cou0TOWL1H8C3iFjnnWAS2qu4KOKOPyBMK1C7tH9MS8OEoX831VKEq3\nTESSMVBuboGsMChvP99Vl3qS/+r729JhZ1pwtHsG/BSF4KMNbt5owFZPO0aJ\n4LQSjOQdb28YCRg2Qp7onWhXotZ/v2/tt4zsXtzQJ0pzZNZrWseSH1t7ysy2\nWhWLvdjVc3GlxaJvMhC4IwXLochmTJ3MqP97V7i7pnDIFeb93+nXN51d7S9G\nopKHH7ZN3PPQOxZgnFOSB50RzrVKbAqccsveI10JL/EfoGSEShNJeSHljbHK\nAJVJyanEz/uL6yDlzUBHlLlx1q/zA6027BcBc+Gs8Mc0oMK3cJdF2+jgITg2\nakcFqm4NXe0L2eJilyiLeBewwwPe3H0iurZDYVGSdS2Qxz72xRJ3bD0QBYWC\nU/Bgpd6qDMULX08tUeXZlufGSIc+2+7tkhwYix+F9mhD/piTJgDdRDraE6GZ\nmQO/\r\n=xfYs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGu0KAvCJEVLlBDHmVs0gWuQMIwnRhcy5bZ1w6Na2KYZAiAv6+GBErUTEcp2P1/DN4465RJ6pLj5hctc0g6tcqWx4g=="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.18.0-canary.ff49b7e2.0_1595876687451_0.8519237244546429"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.18.0-canary.3d334ccc.0":{"name":"@material/mwc-textfield","version":"0.18.0-canary.3d334ccc.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.ac405eae1.0","@material/line-ripple":"=8.0.0-canary.ac405eae1.0","@material/mwc-base":"0.18.0-canary.3d334ccc.0","@material/mwc-floating-label":"0.18.0-canary.3d334ccc.0","@material/mwc-line-ripple":"0.18.0-canary.3d334ccc.0","@material/mwc-notched-outline":"0.18.0-canary.3d334ccc.0","@material/textfield":"=8.0.0-canary.ac405eae1.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.18.0-canary.3d334ccc.0","@material/notched-outline":"=8.0.0-canary.ac405eae1.0","@material/ripple":"=8.0.0-canary.ac405eae1.0","@material/shape":"=8.0.0-canary.ac405eae1.0","@material/theme":"=8.0.0-canary.ac405eae1.0"},"publishConfig":{"access":"public"},"gitHead":"620788b72968e56f9d028ba5ef2ee7d1b4a91488","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/620788b72968e56f9d028ba5ef2ee7d1b4a91488/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/620788b72968e56f9d028ba5ef2ee7d1b4a91488/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/620788b72968e56f9d028ba5ef2ee7d1b4a91488/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/620788b72968e56f9d028ba5ef2ee7d1b4a91488/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/620788b72968e56f9d028ba5ef2ee7d1b4a91488/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/620788b72968e56f9d028ba5ef2ee7d1b4a91488/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/620788b72968e56f9d028ba5ef2ee7d1b4a91488/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/620788b72968e56f9d028ba5ef2ee7d1b4a91488/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.18.0-canary.3d334ccc.0","_nodeVersion":"10.21.0","_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","dist":{"integrity":"sha512-p/X/I1vu2XcYXi+QAm0YFNLQlt2/zVC8DECsXkL39WUuJsLrAwghhrLKCNzNLRx4aTI9kh7Hq9awpuRlFPj9tg==","shasum":"f278c14079af0c17d0b1d457e7cf9b8a323b5944","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.18.0-canary.3d334ccc.0.tgz","fileCount":16,"unpackedSize":262753,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIE8NCRA9TVsSAnZWagAAwmYP/jE7nLa8QjquodMmzrb6\nd7dTNes4kUi4Kl0W+vAYlYX5MXXXJ11j9VdIPQB772uE3loGTEg6ZqZDV7Oa\nWYHafmgnZlALQoNNOlTZ/wQrjq+aYzqqrdMUjgd6l7wWtb7LezewX4LOCbsf\njvrL4ihhH39CLxDz7Lm3GH2fx1E37PUOkCrSDz9xEnECSorCbhX3BuDtfswf\nmGVN4R8GJy2FEHzjAMoaVs0AT2kOgZ2hNrUrpICnlvK5CGmUoaWZOBPTipTX\nAAJlxj5uAHLGENRY/1xM8djxIciQy8+2CqGjIRpYnlETOb5ofotdu6L0lj+N\ngHWxHiBoGYz7s3+LWTbsBnwfM54XdARdqXY2Cg7vBN3AFx2eFbLY3XSXoxv8\n3VBW5pktTZxAlSQVA78dTynb7icJEDQwdvgmgeaG24LYv9AY+56AUNgpn3Md\nrurg42+ahoulC3dNSTRyDvHtubYYdqpN82c4BVHmC1+yqsAdaOnE2YTU0qoK\nmwjl1LQSJ2qOMBST5v1cmKz9M65VzjuOD47oCPZkRiRgP1Jcz94QJpfagN0p\nxjaSkWXGD2F0sJmNsfKXmsK78mX8HfsGrbkBj/qadm2ltQqJAKxaZYO8bO4E\n1IujMuhTyiAU4NWIZq8TZNzqWx7BniibRq0b4YraJ9WamAzV3UBrQlU5NlNS\nf/D7\r\n=So+8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDDAuNEjyJFbp7zHQmMyFwZkl8Qj+A3ITLJAYTn3vQHVAiEA8xBXrxJbqsDMzQaGXm/KfaS+omkl5g2dbezGsmOdeEE="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.18.0-canary.3d334ccc.0_1595952908617_0.0364634018626846"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.18.0-canary.82ac569e.0":{"name":"@material/mwc-textfield","version":"0.18.0-canary.82ac569e.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.f86f83f54.0","@material/line-ripple":"=8.0.0-canary.f86f83f54.0","@material/mwc-base":"0.18.0-canary.82ac569e.0","@material/mwc-floating-label":"0.18.0-canary.82ac569e.0","@material/mwc-line-ripple":"0.18.0-canary.82ac569e.0","@material/mwc-notched-outline":"0.18.0-canary.82ac569e.0","@material/textfield":"=8.0.0-canary.f86f83f54.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.18.0-canary.82ac569e.0","@material/notched-outline":"=8.0.0-canary.f86f83f54.0","@material/ripple":"=8.0.0-canary.f86f83f54.0","@material/shape":"=8.0.0-canary.f86f83f54.0","@material/theme":"=8.0.0-canary.f86f83f54.0"},"publishConfig":{"access":"public"},"gitHead":"0082732bc61fddf6b3c8f7d114839f1937e7d1e3","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0082732bc61fddf6b3c8f7d114839f1937e7d1e3/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0082732bc61fddf6b3c8f7d114839f1937e7d1e3/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0082732bc61fddf6b3c8f7d114839f1937e7d1e3/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0082732bc61fddf6b3c8f7d114839f1937e7d1e3/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0082732bc61fddf6b3c8f7d114839f1937e7d1e3/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0082732bc61fddf6b3c8f7d114839f1937e7d1e3/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0082732bc61fddf6b3c8f7d114839f1937e7d1e3/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0082732bc61fddf6b3c8f7d114839f1937e7d1e3/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.18.0-canary.82ac569e.0","_nodeVersion":"10.21.0","_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","dist":{"integrity":"sha512-y2miVoBnC5Oz8L9AQ4gFLWFqZ67s9c/FqYXIicEkatO9VMC1e9MUobK2faZrdi3vOoeAIR/NMArrpMcSF97WCw==","shasum":"aed64752d2403569f5c881f80b402eccc2aa92e3","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.18.0-canary.82ac569e.0.tgz","fileCount":16,"unpackedSize":262843,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIHGSCRA9TVsSAnZWagAAexsP/R2NHtTqiJGr+3B1tXfX\nMK6iuY5NVvIvZWbgMwmYJW4hh+e9hvJu+B6/ciZsigSnKG7AtxDMbCMydzuy\n4muDUugKSxzDy5rNRIm3ngV8HuMxXq7EA9hq4HuYA7rkDuWhwVBKwnNVPzfQ\nEiZ4TP6wFMqtM0VSoawS+qWyGyF08tgWeBvDouwA90FWXDtAy09UcRvczExe\nA+UDinx75njp8zWhrE1nIDsAzqjsCKIrGmwdlGnGbVPW+/fSOkcKEsBCvoMA\nku5QA8m2boEv8cCTtGLLgjRyou5ak6E90GOz51pUESxhusZMfONJhkih+a9u\n+AunsT0q6MNpK4cmQdI/atfwur4f1RmSuxrg2HDj2AKvmsxWROMI0EurKRse\ncNyUPOUs1TOgS+NEmZU/TYlYXksjf8grzU0vVJWL4Tf/mAkt4CvZGZDG+62+\nArtePFW7S1OMljPqYgH66H1V6x5MVwofojFAhV9zG9fLCWGHwt0MgrF5qfXT\nuFD+WRj1PZ5g0lkF7x9BXyU2JB8PQfY+CKbiHJuY0/+CClBXBgvkel0jPAfA\nNEXpuZToZxXQIoD9W6l/TV6ir0dECDbkzU08chQopJJbVzXJUZBr6fXzFIY5\nCBJ+jvZIUd7L+MPHfaFGAiYaQ7ck9kPcKwn/REZYBrOAU8D6XlFWTwJGcK3A\nYxhx\r\n=j6zZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGyPp2NlfvWKeoE/h89qMeOJkirqgM5DuUnRNARRecvxAiEA4xHR9J6NpbL+dqaQKFm3Nxa+XVd26iFUR5ZOCNkG4RA="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.18.0-canary.82ac569e.0_1595961745610_0.4485033409740484"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.18.0-canary.99df7397.0":{"name":"@material/mwc-textfield","version":"0.18.0-canary.99df7397.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.f86f83f54.0","@material/line-ripple":"=8.0.0-canary.f86f83f54.0","@material/mwc-base":"0.18.0-canary.99df7397.0","@material/mwc-floating-label":"0.18.0-canary.99df7397.0","@material/mwc-line-ripple":"0.18.0-canary.99df7397.0","@material/mwc-notched-outline":"0.18.0-canary.99df7397.0","@material/textfield":"=8.0.0-canary.f86f83f54.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.18.0-canary.99df7397.0","@material/notched-outline":"=8.0.0-canary.f86f83f54.0","@material/ripple":"=8.0.0-canary.f86f83f54.0","@material/shape":"=8.0.0-canary.f86f83f54.0","@material/theme":"=8.0.0-canary.f86f83f54.0"},"publishConfig":{"access":"public"},"gitHead":"e236d384d23fb84c6f0db97495a598e8b374ef26","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e236d384d23fb84c6f0db97495a598e8b374ef26/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e236d384d23fb84c6f0db97495a598e8b374ef26/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e236d384d23fb84c6f0db97495a598e8b374ef26/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e236d384d23fb84c6f0db97495a598e8b374ef26/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e236d384d23fb84c6f0db97495a598e8b374ef26/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e236d384d23fb84c6f0db97495a598e8b374ef26/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e236d384d23fb84c6f0db97495a598e8b374ef26/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e236d384d23fb84c6f0db97495a598e8b374ef26/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.18.0-canary.99df7397.0","_nodeVersion":"10.21.0","_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","dist":{"integrity":"sha512-3crY21wuRmvXODif2ihjr3R3/pUwM2/MRtz0KywUYQnmLym3WZvHtk/9T5xCVrOlrvyJttL0NjAjY7r1SNbsjQ==","shasum":"c0b42dc42e75d0fc3a1e321837e005d2f7f30c0f","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.18.0-canary.99df7397.0.tgz","fileCount":16,"unpackedSize":262843,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIOGbCRA9TVsSAnZWagAAdrMP/iAI3+DnyC+mEtDmXs2V\n4lwyUvHWIKyLOgoszAGyOcKQYlhDUqsoekWTWqFdgWaOVq93tkW1XumZUOWy\n/uwv9IzvxHcdfxNPx/U7+Bzxkb6FOshBripExc6/0jnYZE+3RHetSIXjk8ow\nG2/jv5Cyp5cIBIRrJ6BwK03YBHc4Cl+4hAEcMHvskbPzwUoWYo+qnBFF8dp+\nr7HWPKfE/CcmEddadJYOD97CkEDcbn9hjPS4w+6JBktHWwcxfamvjruBSZmN\nbzaVqlwlETuz9xPuFRmmH521uFLCNOYa9Z3fZSurqK/m7M/kcTntIzGtI8RU\nsws7R1K18LPxxmkHV9Ls1kOBD9Bu6J8zDwRr28lXXRhyArn3RNZNdC6m2mye\n73LbfXakounUxtx9ZC9h4c0FPke2UQzdQE/zzVRbVHicigoAxdc5uoOims6m\n+nNvrmEX8WmgxJlcNhpX7z3P0JBsw17/hl3MfFyO8dzlpb0D0V1eoMtQ3kjZ\nZPOOycUDJMFgY4DPgY946w8j9VV3rc8YFlq71dy5wSW0SyGMLsqM570dhYoE\nzVnOlQBGhCKaQDsXUfEkqgVA0Q0JsaiyFQCXw3VG3vHYPbWv/GuEKnuri5T4\njoTuLdywfW7t8CAvBLfNkLz2UfPuF8Fpnsuok3jLzCTnL3qA6SCpwUwQrMdg\nHo1U\r\n=oxZ8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDO+Yq5D11BEktXuqOQ/EXNS4cP7Awe09EOk8pFz8p+CQIhAO01RfJXaTpnq6gKwlX2Qtvbtzw7WqO8XhIoVRIjfJkj"}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.18.0-canary.99df7397.0_1595990426823_0.813662970366186"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.18.0-canary.45493e05.0":{"name":"@material/mwc-textfield","version":"0.18.0-canary.45493e05.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.f86f83f54.0","@material/line-ripple":"=8.0.0-canary.f86f83f54.0","@material/mwc-base":"0.18.0-canary.45493e05.0","@material/mwc-floating-label":"0.18.0-canary.45493e05.0","@material/mwc-line-ripple":"0.18.0-canary.45493e05.0","@material/mwc-notched-outline":"0.18.0-canary.45493e05.0","@material/textfield":"=8.0.0-canary.f86f83f54.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.18.0-canary.45493e05.0","@material/notched-outline":"=8.0.0-canary.f86f83f54.0","@material/ripple":"=8.0.0-canary.f86f83f54.0","@material/shape":"=8.0.0-canary.f86f83f54.0","@material/theme":"=8.0.0-canary.f86f83f54.0"},"publishConfig":{"access":"public"},"gitHead":"8423dd01198986c553ae23227667bc8148bb4276","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8423dd01198986c553ae23227667bc8148bb4276/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8423dd01198986c553ae23227667bc8148bb4276/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8423dd01198986c553ae23227667bc8148bb4276/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8423dd01198986c553ae23227667bc8148bb4276/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8423dd01198986c553ae23227667bc8148bb4276/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8423dd01198986c553ae23227667bc8148bb4276/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8423dd01198986c553ae23227667bc8148bb4276/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8423dd01198986c553ae23227667bc8148bb4276/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.18.0-canary.45493e05.0","_nodeVersion":"10.21.0","_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","dist":{"integrity":"sha512-XzX3HlyNANZNDjchVkJXK9vYMVDew6bYoDh6N3iUmSYdVnO5O3x6sFZud4/h6mpNeembQLu39TMB0H4P5+qidw==","shasum":"f0fb2542b0b1ce850da9a7ead9b7495a302aa692","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.18.0-canary.45493e05.0.tgz","fileCount":16,"unpackedSize":262843,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIa7zCRA9TVsSAnZWagAAiQkP/2JyqdlJHnz1QcFYBRAe\nKibitDpswIShfDupN1lVzibKHDtkuuR25wi4VuF5rD8RzKDJAyQizCLD3040\nPSrXtxgCVQmzZHrR0MKPDZJ+GKQUZO2MJRgVpVQyTbdxBSHmO3j212I2ae9O\nE0zlLyXZTveaeHMVszKbdPTnP6sYHEYTV0q7AGM3EE2ZoH5Nhu4+75lqTTz+\nSgdIxgvJqAnAJr9jVn3ijAwToz3czERtU2+YYZdD5adoFaHPvhmeXEb9Vi6K\nxoa/TJwROcSTQygN+0YnU0XrDQstznhm9A/plS8PfafJAH/BRLVPRLn6y4zQ\nCwIIaXtVv4ZAf85NpGr0Hr7PtS00KGSvZPW74wCydo/txj/h9OByK8PiYDGa\nY/ZeJIxRW16o1jJCc0VXbMmTqL8dYHEQwaxuW8F+yQgUc4oaMbEnuGJZaq3p\nR6SjFFJkEycA9PX8RJH3EZooGdKKB+ngvLmfvtKDr3gzhxgNIDPM9cJo6Mp5\nJ4Fn5edDCyzEjiYe7M1Lsaj4f5F/za08TstPEy8MHvp2IPrmJ0ZyO6ddIHFB\nYA2FpKR4kyJBNE5jnRT8Z+qbgJWvF6x87nGuBBm/2x91Kcgo6o/rbu5jvhc+\nzrOhj0th5h4oFKgL4RSglUkpboOpwvlnou/rPAd68m5G/YeIKjxzwYOPLh0i\nekyl\r\n=fWPE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEPxkZvVnqKxpEv6FF/Azl/vpQUrJSEbrvJedRBZxqK0AiEAmne6EvbQKi0XLJ7B1nCNobYtQW/Jx+C5raIvbbp1Q6w="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.18.0-canary.45493e05.0_1596042995201_0.4364449902901675"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.18.0-canary.f2ab0a95.0":{"name":"@material/mwc-textfield","version":"0.18.0-canary.f2ab0a95.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.f86f83f54.0","@material/line-ripple":"=8.0.0-canary.f86f83f54.0","@material/mwc-base":"0.18.0-canary.f2ab0a95.0","@material/mwc-floating-label":"0.18.0-canary.f2ab0a95.0","@material/mwc-line-ripple":"0.18.0-canary.f2ab0a95.0","@material/mwc-notched-outline":"0.18.0-canary.f2ab0a95.0","@material/textfield":"=8.0.0-canary.f86f83f54.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.18.0-canary.f2ab0a95.0","@material/notched-outline":"=8.0.0-canary.f86f83f54.0","@material/ripple":"=8.0.0-canary.f86f83f54.0","@material/shape":"=8.0.0-canary.f86f83f54.0","@material/theme":"=8.0.0-canary.f86f83f54.0"},"publishConfig":{"access":"public"},"gitHead":"1009e1c7d365921dcbc3071cabaa20c5e21e65e8","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1009e1c7d365921dcbc3071cabaa20c5e21e65e8/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1009e1c7d365921dcbc3071cabaa20c5e21e65e8/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1009e1c7d365921dcbc3071cabaa20c5e21e65e8/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1009e1c7d365921dcbc3071cabaa20c5e21e65e8/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1009e1c7d365921dcbc3071cabaa20c5e21e65e8/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1009e1c7d365921dcbc3071cabaa20c5e21e65e8/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1009e1c7d365921dcbc3071cabaa20c5e21e65e8/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1009e1c7d365921dcbc3071cabaa20c5e21e65e8/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.18.0-canary.f2ab0a95.0","_nodeVersion":"10.21.0","_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","dist":{"integrity":"sha512-ZLpW5ZuxUcvWl91LYzjbj9CkcGrVR375IXCEvxoD0J/28ArwXem3kSQGyo1zxxelifZ+3044pEkwYGie71btPQ==","shasum":"f30223bb3fc675f91a5243102bde2ceef62b2cc7","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.18.0-canary.f2ab0a95.0.tgz","fileCount":16,"unpackedSize":262843,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIbAYCRA9TVsSAnZWagAAP4oP+wVzg23fHSgJweGmoLqy\n8gR/sDIZHTPt+uosm6zGi+qLQASJeorYcoyHUQ5UJKSBu1g5wWcR3ElvddTO\nlSHlDqNQuNuHZ5RjKd5bHePInVyP0sWzOWHtwxT2KtBJ68W6+Auba0HkYnGs\n8NxmzAEpADcudfo2cfPUTcs//rPi5UK4ezqhHvkqhq8oS5MCHhSnlTG5W5X8\nd1nN2rnMKjHdpQlk0E0LL6GrEhHn9IIgG64VPuVPp9ZA7bhYC4e7T+Qn3tS3\nTe8KRQCEzUOozClNwev2ngzwHLN3uw+GtqqQTpsuGRMtJKijhzDKCvDcyTW3\nuKasVEKJnED45h663AZgXITtxPQ5f9/oruxuYoBFiMDhnFqVV+5/P6vmZ7Jp\nOPUs9PlNpLcyspP27nRn3ufKjFJWer+/gOzeoK4M+tv3jcS9nZFLdU6+DMat\ne3F6RCW0woJuX8n6+/HKSKYRozEjq8sooCr/BsskFk4Q//2tt2xCLKavyH1r\nWKlTA89fUhUihqV8i/dbtzemRmGpvyWrpCLpr3OdgQcC+PUf5ZJN2LBtb1yY\nZFLljNpIJ1HnE6mMKppViAVYEbluP8vtHuBzGEst37Pt1t1hB4LjVeFGNDgB\njEmubjNmAtWGbsrMGjfOR1vbwfZkvh1Gv/c4kFYRmbNrPFlbV9sinRbngKTk\nfEOl\r\n=s/kf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE2zBSDEVCql4eD4octcLdsOJ7EYhCCsDbFX1NdVja0LAiEAzna6im6bdRuNN7pjfS8YxzJe4WI4avzRl3uRvlzTedU="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.18.0-canary.f2ab0a95.0_1596043287909_0.1129789494050133"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.18.0-canary.45f9eddc.0":{"name":"@material/mwc-textfield","version":"0.18.0-canary.45f9eddc.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.f86f83f54.0","@material/line-ripple":"=8.0.0-canary.f86f83f54.0","@material/mwc-base":"0.18.0-canary.45f9eddc.0","@material/mwc-floating-label":"0.18.0-canary.45f9eddc.0","@material/mwc-line-ripple":"0.18.0-canary.45f9eddc.0","@material/mwc-notched-outline":"0.18.0-canary.45f9eddc.0","@material/textfield":"=8.0.0-canary.f86f83f54.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.18.0-canary.45f9eddc.0","@material/notched-outline":"=8.0.0-canary.f86f83f54.0","@material/ripple":"=8.0.0-canary.f86f83f54.0","@material/shape":"=8.0.0-canary.f86f83f54.0","@material/theme":"=8.0.0-canary.f86f83f54.0"},"publishConfig":{"access":"public"},"gitHead":"1cb46e993882c87c3cced22481410b4922c1e1cc","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1cb46e993882c87c3cced22481410b4922c1e1cc/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1cb46e993882c87c3cced22481410b4922c1e1cc/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1cb46e993882c87c3cced22481410b4922c1e1cc/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1cb46e993882c87c3cced22481410b4922c1e1cc/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1cb46e993882c87c3cced22481410b4922c1e1cc/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1cb46e993882c87c3cced22481410b4922c1e1cc/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1cb46e993882c87c3cced22481410b4922c1e1cc/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1cb46e993882c87c3cced22481410b4922c1e1cc/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.18.0-canary.45f9eddc.0","_nodeVersion":"10.21.0","_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","dist":{"integrity":"sha512-gZ3dEPFddg27Q6x/eg1vbei4tIb9c6FCiY4Q0Lpcwf4vCNL0Mop8oisWB4efmIBaRKPewk5a/QCSYsTdznVE/g==","shasum":"2ccab62ca8c26fdf78de42c65c66224d212df91b","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.18.0-canary.45f9eddc.0.tgz","fileCount":16,"unpackedSize":262843,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIhpaCRA9TVsSAnZWagAA99kP/0OB8Fj6mIv9XiTM6NgQ\nCcszqXCIhdDV2Gs4iZioVqBcllBm4w6OiM5TaWbslIkZpURwtcxVR4vNv/b+\no/BgrSLGoSevyFyZIsSxPzn8+IAMITwEo1+319O5WuBSepMXmx/5FimOyU3a\nf+7IG2WDpvFdH/q19SpSMDDOwYUaKz3UkrvBoOtAZGtYkOYzWsbDwBj7ZsbS\nft9AYx4KvWZBC7q89xxbAPbPwuejxvwYTZMQCLuudDhTCCUIiTi4SLwfGMIS\nbrpybgxWKq25LgM50AnHAUF4bu54Sgx7fCdblGUYBLYeIHXHX7Sb3Fr2iAbf\nisj5GH5XWegHQsUe1HBPz+W7wc3E90gpaCIKe0O/Go77g2pxKYO9xhdQBIQK\nZPLSEPb1lqLNMeF6oWACrZdvIFqLJRJReXvHKpM4eFIH9iYg2wynTp6VavGU\nGkHilE0PvlUiwzbn+Y+VwrFrBTRbvGDmhGEyfUlMnNNVKkjCOH9NuoesCmhI\nY5hpXqjKsPbyQTcGTKsTBDuExLQxP/ZGS5yCGqTmiBXj0JGkmbvIAVnvr7oG\nHsTn33q2OWVu/xZc806OlV3KABvu0xTFr0bdeDh26bGWaKoAc7KMGLh2ILqr\nQrZIPBbN862U3qvShoxfPoxg7J1f4BtnRgGedpVGrdLjp3JgArZMXnAJdbas\nJTTe\r\n=hnO8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCnJAsbAUe+LZPPWByc3rBCY5LJK5L3IOKsG2PJxAS20AIhAKNZ4RiUW6VwrUwaXVINsViO7UqEw8x4cZgvYmkY5NTw"}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.18.0-canary.45f9eddc.0_1596070489595_0.22054216314629604"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.18.0-canary.b64663ea.0":{"name":"@material/mwc-textfield","version":"0.18.0-canary.b64663ea.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.f86f83f54.0","@material/line-ripple":"=8.0.0-canary.f86f83f54.0","@material/mwc-base":"0.18.0-canary.b64663ea.0","@material/mwc-floating-label":"0.18.0-canary.b64663ea.0","@material/mwc-line-ripple":"0.18.0-canary.b64663ea.0","@material/mwc-notched-outline":"0.18.0-canary.b64663ea.0","@material/textfield":"=8.0.0-canary.f86f83f54.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.18.0-canary.b64663ea.0","@material/notched-outline":"=8.0.0-canary.f86f83f54.0","@material/ripple":"=8.0.0-canary.f86f83f54.0","@material/shape":"=8.0.0-canary.f86f83f54.0","@material/theme":"=8.0.0-canary.f86f83f54.0"},"publishConfig":{"access":"public"},"gitHead":"18456f1bd35a7bed64d6ca9d3d408d9d62d59c90","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/18456f1bd35a7bed64d6ca9d3d408d9d62d59c90/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/18456f1bd35a7bed64d6ca9d3d408d9d62d59c90/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/18456f1bd35a7bed64d6ca9d3d408d9d62d59c90/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/18456f1bd35a7bed64d6ca9d3d408d9d62d59c90/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/18456f1bd35a7bed64d6ca9d3d408d9d62d59c90/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/18456f1bd35a7bed64d6ca9d3d408d9d62d59c90/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/18456f1bd35a7bed64d6ca9d3d408d9d62d59c90/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/18456f1bd35a7bed64d6ca9d3d408d9d62d59c90/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.18.0-canary.b64663ea.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-FPiPK6DvxyH2DKPWmfXRIZz/VBhPcJXFUYYFVuhPLPiLHzOoPmoEBwZpgNTp3NZsIXZNzSgNNBiyHCD+6pPGUg==","shasum":"7bf7b0896b9ba1ed3d6d10eaadc69a0ea1450be4","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.18.0-canary.b64663ea.0.tgz","fileCount":16,"unpackedSize":264486,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIwa9CRA9TVsSAnZWagAAGfwP/i3wnWwiOLOot3xR2r3B\nMQ4aRWoh5IL9gQZ4+t/B/++erFah0DCwSSMhxQuyKZlHyKx+nx2QR+DqA3O+\nYL6HZgNQedtBRqwOZJMPp+lTUJKdU3w9DjfSGIfGduDW4+wS4WkgGtc7gdfe\nAxytvD/9CNJDF4zi121sRb+rpc4x88tJjbAqO3ID5NXHQvdcZBur2oVUefwx\nIz2iKPG9gtiBN74MWE3YvZaO8xduqT8jH3C7FdXNVAmMRN13MlxvSaowGnwb\nUgyuKfIPWqEudtCtTgWLeO9T+uy4MZ72X6kJ9egzufCVIWmIDJkXAcn4wy+r\n13QNNaCBExA1vljEleC9Xn1C/DNFsiFLHVoe5tdA+Xv75CoV0pPfkVwMMLvA\nR9i7Gp9JNyGsu1ZShZqIxeXVfhCqQ3/+T0/Tl+9ZKAE1m9fhjbblY9ZS458V\nrh6wOx6eyXTawH3Hyqpgv21Ckpi2J/0d32kKZ6klimgPMJLExlmlTl33Sjyd\nplHzSd6xZ8cypjolqSHZ8ytbpywI2ZM4oy/nd92Ubm5a1WYCx5BW/Jqf3IPG\n/9xGCCSTzE2uR7hccLpWkBiofFcHBazxC2xbBPpwKY43nVS9V6oLDOl0qFfW\nWdqgWZeeyNC5vEdTHQXMamItB7okU7uiJWiumcEjavJVtZMZIlZ+PgyJgb2n\ndiTa\r\n=l1Ly\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDdXsVcJWtrSL8XMT62QPNTNWDUlNnZXRbXYNlYrYO1YQIhANHxNtbmFnYvejpPNBNxX7kimGjp9m5wh2yGI/ekaxBS"}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.18.0-canary.b64663ea.0_1596131004879_0.6422195368879289"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.18.0-canary.9a1a4d2d.0":{"name":"@material/mwc-textfield","version":"0.18.0-canary.9a1a4d2d.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.f86f83f54.0","@material/line-ripple":"=8.0.0-canary.f86f83f54.0","@material/mwc-base":"0.18.0-canary.9a1a4d2d.0","@material/mwc-floating-label":"0.18.0-canary.9a1a4d2d.0","@material/mwc-line-ripple":"0.18.0-canary.9a1a4d2d.0","@material/mwc-notched-outline":"0.18.0-canary.9a1a4d2d.0","@material/textfield":"=8.0.0-canary.f86f83f54.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.18.0-canary.9a1a4d2d.0","@material/notched-outline":"=8.0.0-canary.f86f83f54.0","@material/ripple":"=8.0.0-canary.f86f83f54.0","@material/shape":"=8.0.0-canary.f86f83f54.0","@material/theme":"=8.0.0-canary.f86f83f54.0"},"publishConfig":{"access":"public"},"gitHead":"f3382a4c5be4b9d21268b2d1b0831f8d8343d2c6","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f3382a4c5be4b9d21268b2d1b0831f8d8343d2c6/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f3382a4c5be4b9d21268b2d1b0831f8d8343d2c6/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f3382a4c5be4b9d21268b2d1b0831f8d8343d2c6/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f3382a4c5be4b9d21268b2d1b0831f8d8343d2c6/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f3382a4c5be4b9d21268b2d1b0831f8d8343d2c6/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f3382a4c5be4b9d21268b2d1b0831f8d8343d2c6/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f3382a4c5be4b9d21268b2d1b0831f8d8343d2c6/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f3382a4c5be4b9d21268b2d1b0831f8d8343d2c6/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.18.0-canary.9a1a4d2d.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-ZtBOB/8fnaXX5HNGRFd7iFWRCCwSgnk+YNsBv+A61wA0o+oNVvqIBUrVLVDnt+Mrtv+JNfft9I1emmxEUpT2Mg==","shasum":"f1f8f0862737461a69fc2ecb4d5ff05ea573a1a2","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.18.0-canary.9a1a4d2d.0.tgz","fileCount":16,"unpackedSize":264259,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIzXICRA9TVsSAnZWagAAZNsQAIydERqVlyiB1WH0ft/+\nobBn/lbOf3A41ZbHUpQVuMJXrBRGm/nL7sy7oJ0+chjVWVuxVp6kTFgnScg7\ngHR4KGZI+cWIE1sWeZHnikL/W0p33IZJPb2IGuZNzNJSRiYY+IRmsQ9ttt4i\nCMOp/sZCxnp/D6WxCMFr/6oO6IRbpbDUGAjneaNBxC3OiUnI7qHYz+Wl1TmT\nrTnlxLR8wB+4SGB68S/dQuc19sP8mGnN4hHhcYFmKJ+M1dxPn1L6A/IydytI\niATaowIRby/yUCUujtqkoybDHLVHu0r8COFImDXQAVJouSn4mZTNuDpPw8FD\nIxtUKlqiUemI5Xh9CpuCj6D6+DeiZ4QvwJFyqcRzD5qlwlP1yBzXOC47FI05\nNewzxg8mOy+4+e5RxOuEAO6KqtSfu2MB4pCqf2Tg3AbmreGZWeY8bFNuxb2K\nHC8OvH9MwbE2njvxxkiZ8zKZi7fvNmIpr4DbvjbV4iDPa58ZZB0FLuC2ZrBH\nW2mLI1W8avCfHqyt3GYnNb2JAK4EEwNzRdvYapN3UwFE/Vjo3Mu4kWJEq8Pe\no+0RpLdz6DbiK2O9+fiBMYrPbv0FXnql6kZS3YqB57l4GJZqmTFRqljwbMBz\nh8nXQZKKCoIAMxAhLUjpagvjxjJSCVYfBhO3DTLOFQapATncY7gpr59gWZoB\ntLdl\r\n=0W0x\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDCMBD4MFHth4Hja5cySPgPZUHQk+YUhEwu9OkqqRMPcQIhANqk741WlUPsUml+7wYSrY4aNTxTMbaqvVtJkO0mopyT"}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.18.0-canary.9a1a4d2d.0_1596143048194_0.2329214429710742"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.18.0-canary.887c2848.0":{"name":"@material/mwc-textfield","version":"0.18.0-canary.887c2848.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.74839da7b.0","@material/line-ripple":"=8.0.0-canary.74839da7b.0","@material/mwc-base":"0.18.0-canary.887c2848.0","@material/mwc-floating-label":"0.18.0-canary.887c2848.0","@material/mwc-line-ripple":"0.18.0-canary.887c2848.0","@material/mwc-notched-outline":"0.18.0-canary.887c2848.0","@material/textfield":"=8.0.0-canary.74839da7b.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.18.0-canary.887c2848.0","@material/notched-outline":"=8.0.0-canary.74839da7b.0","@material/ripple":"=8.0.0-canary.74839da7b.0","@material/shape":"=8.0.0-canary.74839da7b.0","@material/theme":"=8.0.0-canary.74839da7b.0"},"publishConfig":{"access":"public"},"gitHead":"2da757768e8d58aa4885027c78c58f8515382305","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2da757768e8d58aa4885027c78c58f8515382305/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2da757768e8d58aa4885027c78c58f8515382305/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2da757768e8d58aa4885027c78c58f8515382305/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2da757768e8d58aa4885027c78c58f8515382305/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2da757768e8d58aa4885027c78c58f8515382305/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2da757768e8d58aa4885027c78c58f8515382305/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2da757768e8d58aa4885027c78c58f8515382305/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2da757768e8d58aa4885027c78c58f8515382305/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.18.0-canary.887c2848.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-gUj+BWw4CvIBAChIbY2eR3UlPrSDVD61IkPsIBs8LhEnMG3WaGwBraoJmBma52LS//kHJXqkzUeb4mFmrGS3GQ==","shasum":"ceea3a5f88a1975eb2bfd53421000031c0f15802","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.18.0-canary.887c2848.0.tgz","fileCount":16,"unpackedSize":264430,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfI0QrCRA9TVsSAnZWagAAzB4P/R5qA/eKH4c5UpBYjy6d\nR88OyKU4xoOnXcYYeJPcivZNUq7d9XoTTXA9oXQoTZLVEZ2Z0WMtFRisDwnR\nlFdynDhfGH8rfc3O8Zm264HZV60HCAABqqsuwwuzMY+B7uISjrFTnhOB2w3O\nHtg8URqUDlBZfvf/5DDVa4K7Z84Fm6VzqX2hm7Wziq1akpIqKeYwSVoqsuIR\nEso3zgccaNSFi4l06N6x7AlkU+KeEBEa5Ew/9D7ndvTnyGEfg8/pryu1byOa\n/eJsN0EjHs2yKDdw6ut/m4iI8DT610kP/TJnrQQtMrfIl4vcrbdtL8ygaJan\n0zw4jKNmHXSwzzx9Qhq04qLX8/eM3Lw0nogc9D2GkzD/o4EgBV3LG5+fsdOB\nWe7hcGRCyswCzweTLelF0qWI6ynSrhtjfUC2STMwobObq3YoFgDTSinJMTR6\n2oL3GUEIQuMpqr0i7pVqDAA1V4nJbXyov4fA7wJhJMu6qPbY1MDfDdA24UoE\ncNE5sU/bSChsjupFAinImQUBKk+QjcHp1cyxWptHk1vjSLwb6JB2rebH7bUe\neT4E/c6m9cxFpKEGLreah8KUr9WOvzeYv4Sp2N17a1GCmX9+eCtEKa9Qbgkb\nQtofgZG4JwMtHqROey57dhmYBk+FKqGTgPZE4ZSnMbcP/4IfrX8kEh+2TBVD\nmyMw\r\n=274o\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDzXi8GmoNw2kQyasknvm7wDSC0dK+WFPE5ni8ZpxbyLQIgT9k7cmjixeNtS0uEM7dxLn0jhwYqyA/lQepixNZa5A8="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.18.0-canary.887c2848.0_1596146730916_0.7661127898505837"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.18.0-canary.354eb695.0":{"name":"@material/mwc-textfield","version":"0.18.0-canary.354eb695.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.74839da7b.0","@material/line-ripple":"=8.0.0-canary.74839da7b.0","@material/mwc-base":"0.18.0-canary.354eb695.0","@material/mwc-floating-label":"0.18.0-canary.354eb695.0","@material/mwc-line-ripple":"0.18.0-canary.354eb695.0","@material/mwc-notched-outline":"0.18.0-canary.354eb695.0","@material/textfield":"=8.0.0-canary.74839da7b.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.18.0-canary.354eb695.0","@material/notched-outline":"=8.0.0-canary.74839da7b.0","@material/ripple":"=8.0.0-canary.74839da7b.0","@material/shape":"=8.0.0-canary.74839da7b.0","@material/theme":"=8.0.0-canary.74839da7b.0"},"publishConfig":{"access":"public"},"gitHead":"75cc944c1c31dc88606fa2007d002743354e601f","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/75cc944c1c31dc88606fa2007d002743354e601f/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/75cc944c1c31dc88606fa2007d002743354e601f/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/75cc944c1c31dc88606fa2007d002743354e601f/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/75cc944c1c31dc88606fa2007d002743354e601f/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/75cc944c1c31dc88606fa2007d002743354e601f/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/75cc944c1c31dc88606fa2007d002743354e601f/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/75cc944c1c31dc88606fa2007d002743354e601f/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/75cc944c1c31dc88606fa2007d002743354e601f/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.18.0-canary.354eb695.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-HUYVJYzJPhjc0KjZe7RCK5k8KyYBgoHIh6p5jUAItzorNE7cGoz2E124w1QCHrEqtcBxackY6vMH6HfB+BZPAg==","shasum":"b1d4c6fab921cc4fd26c902fa02ee8e40c930c09","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.18.0-canary.354eb695.0.tgz","fileCount":16,"unpackedSize":264430,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfI159CRA9TVsSAnZWagAA+JAP/1FxhvcSe/CfIu4LLh3z\n3fqYVWK8qVM7TXNBUzlxgp+AbiLyIho+1xrbDh++OE96fRI2ABwcCF1dCvFN\nrzErjQpBRF01bw6m46UAVyYq3kI2j3j0R94lameC7NqAnVlD9RIJc4G9PnhZ\naeOBmK0RRebdJRi7T7R3yKi0Mzjqcq0iu1/KPlNhBFD1wYfu/s7PpF11dfbv\no5o87p8XzuS+WTzgd7wbwnRBIGE+B0BtXUcTT5aeuZUYiUuUdZLfJgiiavge\naq2dUGi3Dz5xeGpyE0mxmPSUktFfoho0d3A7klmR4yfTvcMczsZU0IMMAkJj\nqg8Xk00j8bnKEb+KFL6jbn66PrrPXb5cn+Yg+GiMxfK9N6lhhJwK8PWcaqmA\n/j8qbXYJkR0F+Y8w7YUEpeEkmkD6ByG1G8I9PUabkUdJZFje8aviV1JRRLay\nrLMHTUbyghXQuCxjkv/h1RPA6GonWqBMLBTXssMQwPiYml75dDeKD1gLPjNl\nqBiY7GWDThheFclB/HlHKs9GTWt4IX+grnnKtnrQiAbItTqH2YEZZifB1Ty9\n2DRU8+RaZxOJAmIQvNONQMjpOCgjCnJvbSJ8CryLjbX/UIdAFgBjcJz1ks13\nL0EDCQrgXyv3s/4CwSOjgWWW7vy3Hbajz/isuOUIdEEwqgtx4bG6UM56pE5/\ntwe/\r\n=fHQH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBxHrnYkN1gr5W9bS8DG7iw0dRvu5tuRrZtmIcbYrpgcAiAkUqxlAjctGmAPCQvgDbnSx70+aTbT6Hy7bOPKlr5maQ=="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.18.0-canary.354eb695.0_1596153468969_0.3476250867908812"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.18.0-canary.7beb236c.0":{"name":"@material/mwc-textfield","version":"0.18.0-canary.7beb236c.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.74839da7b.0","@material/line-ripple":"=8.0.0-canary.74839da7b.0","@material/mwc-base":"0.18.0-canary.7beb236c.0","@material/mwc-floating-label":"0.18.0-canary.7beb236c.0","@material/mwc-line-ripple":"0.18.0-canary.7beb236c.0","@material/mwc-notched-outline":"0.18.0-canary.7beb236c.0","@material/textfield":"=8.0.0-canary.74839da7b.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.18.0-canary.7beb236c.0","@material/notched-outline":"=8.0.0-canary.74839da7b.0","@material/ripple":"=8.0.0-canary.74839da7b.0","@material/shape":"=8.0.0-canary.74839da7b.0","@material/theme":"=8.0.0-canary.74839da7b.0"},"publishConfig":{"access":"public"},"gitHead":"9cb1508b49b8ccba6072341f23bae1ac67078621","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9cb1508b49b8ccba6072341f23bae1ac67078621/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9cb1508b49b8ccba6072341f23bae1ac67078621/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9cb1508b49b8ccba6072341f23bae1ac67078621/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9cb1508b49b8ccba6072341f23bae1ac67078621/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9cb1508b49b8ccba6072341f23bae1ac67078621/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9cb1508b49b8ccba6072341f23bae1ac67078621/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9cb1508b49b8ccba6072341f23bae1ac67078621/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9cb1508b49b8ccba6072341f23bae1ac67078621/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.18.0-canary.7beb236c.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-qvh67Cn9A5ARrgDL86wBFhJRpqEhUJ63qeuFPp+oL6na3r2cpy+GEriMdorUecVkqDl6WIr5CYCrNEZLe1pIWA==","shasum":"379061b31219da97d6f1c3ad00949a05ffd9132e","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.18.0-canary.7beb236c.0.tgz","fileCount":16,"unpackedSize":264430,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfJFeMCRA9TVsSAnZWagAAnUAP/jCNaidi8CvNsfUbGkye\nGSKq0OLAfaaBMFVD0X2EomQFLX6rq5y4/N+6o4q81KQmM60TBaHF/053iTTj\nnihWBskgFgoRn8XCBEzXoCZMNCZ1QijFEc8HeXOWjUY2mD3XfpVHAjgUFi8l\nz1+ABQxIzcNga8SqqneGsEGPagB8dboQxb7HrCaBVqh+s/okcOjKtUq1SXYN\nVWhj6GBIden3SKYEznYYXSqoofN9k98RZYQvUxi2NpdJ8NwseUzCXxw/dSDh\ndlq5WCtpoB/kV05MHpQJ+RVCS0a3VXrH/mAUODzAtxF+fgLkRqBvtq7jD8jQ\nsvoyuOwnY2zqLKPoaquPrAmn23T8l3BzIpNl3HEUHnxhlUXXO5j+m57aiICJ\nqpioypbB8Gp+wsnPgiBX72f0ZVEAq02qFbQiixpyvorwOxohaozPJW4M/OHH\nvmxDmWb9gucjDgA6SiTgFq4j9KCEuBe+Nz8UtQVMaEbz8kBlCQ9ueNVbTDH+\nEV2/kuyWPJ1jLxGoeu5O+NzcaENdjiIYAHqoqXgM/upFjUrUS4rKaJZbg/+7\nAK2oFi3xbLMisaAOHhJ5i4IgHFt/se4NR2iA8CfZISGDraaFTbCRsfCvBV9P\nyjjjjUEKV1Ti0iivvn1700sNJQccdjyC77DWFZpR7mg7qecOUETGEJ13VSNT\nprkJ\r\n=a/7r\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDgz3qwp328AjPmJQFKSq8AGi2uqARS4+57t150nYR4awIgXxevGUGDHtUzZXwKr0U9gh4O/uXgFj20JXoVsoNi7U4="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.18.0-canary.7beb236c.0_1596217227751_0.66924204235144"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.18.0-canary.c44acc0c.0":{"name":"@material/mwc-textfield","version":"0.18.0-canary.c44acc0c.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.74839da7b.0","@material/line-ripple":"=8.0.0-canary.74839da7b.0","@material/mwc-base":"0.18.0-canary.c44acc0c.0","@material/mwc-floating-label":"0.18.0-canary.c44acc0c.0","@material/mwc-line-ripple":"0.18.0-canary.c44acc0c.0","@material/mwc-notched-outline":"0.18.0-canary.c44acc0c.0","@material/textfield":"=8.0.0-canary.74839da7b.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.18.0-canary.c44acc0c.0","@material/notched-outline":"=8.0.0-canary.74839da7b.0","@material/ripple":"=8.0.0-canary.74839da7b.0","@material/shape":"=8.0.0-canary.74839da7b.0","@material/theme":"=8.0.0-canary.74839da7b.0"},"publishConfig":{"access":"public"},"gitHead":"2491ff018c9a71195a5e873fa60b912085ec84d3","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2491ff018c9a71195a5e873fa60b912085ec84d3/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2491ff018c9a71195a5e873fa60b912085ec84d3/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2491ff018c9a71195a5e873fa60b912085ec84d3/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2491ff018c9a71195a5e873fa60b912085ec84d3/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2491ff018c9a71195a5e873fa60b912085ec84d3/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2491ff018c9a71195a5e873fa60b912085ec84d3/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2491ff018c9a71195a5e873fa60b912085ec84d3/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2491ff018c9a71195a5e873fa60b912085ec84d3/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.18.0-canary.c44acc0c.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-QGCImJdKhoD/K2UXCGA7NuegQAu5cxirMj6c24rxtLDlzvkm2uXSvhzxDMDMth1dVqlDHddHTmX4YtY9n9ybJQ==","shasum":"f76857670e022eef93a3a374da3ecdfaa7c9beee","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.18.0-canary.c44acc0c.0.tgz","fileCount":16,"unpackedSize":264430,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfJIjmCRA9TVsSAnZWagAA8DkQAJqRgqduAPh+Wuz03a3Z\nWvLx26u2WE1On1UAdXjo/ERoKnPe6I3LJkFr7j4HtoBxN3HB+9KqoMc3k2db\niK6qzj3FTqowPO058rWNaK+0YAOPnGa6B4Nnf1ccnbjKQ1z8d16tY+hYGh3n\ntpGLbXBEVEMgsEmV4+IMsuguXOS4oFM29Kn/et2/UfO5X+sFuukR2PJKVMcg\n8WLQJ6d/ps82dm1WRP3eOHOA3sfvpCIt0bNHjqQOap24g0F2KuRSdaJw9c6F\nQlGpeXL6WmNe7gm4hrOENp0maJAqFrk0XApyDmIGM0tSmrIVyVNlQvulkBU0\nks7SNjmNCAiPLU6Vt2YlSh880T0TSB9CJ5COS1tedqwDMUHptKDbobQRsOY4\nvcmMuxFZ81kPthWBJU1fjj9otz/a3FKkPCNB3suXIYUNmRSmghui9lMAOQ5a\ncp41RsRbYApQOcZJnU/ap0jlLjfMKA8aqmlIanAwaoU98Nu7G2HKvN4A76QX\nIo9YfJkggZOHhFPWWLRR0sGb2NS+RgjVhQ7NncubFqN3IXgyAPmxDBpbh1xQ\n0IL02Aa4u9RRil6VuKKF2a68DEvUgsYcE6IwG38WIgSkzmUdckBfkjuQb0wp\nrNXJresloVYN/sLQyNiSVQDmnbed00PbzI3wYyIevJ0WDUKTz6UOec5P69rV\nmf3k\r\n=uO76\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEA6C/4tsMG6xEbAlEr9meAgXvJh1zqn+KUwaribE136AiB5LhTp4FSnKXHYJOBe5bGqyLVlYQnQgaDrv+b1w1pA6w=="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.18.0-canary.c44acc0c.0_1596229862097_0.0656969335421842"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.18.0-canary.779853ff.0":{"name":"@material/mwc-textfield","version":"0.18.0-canary.779853ff.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.74839da7b.0","@material/line-ripple":"=8.0.0-canary.74839da7b.0","@material/mwc-base":"0.18.0-canary.779853ff.0","@material/mwc-floating-label":"0.18.0-canary.779853ff.0","@material/mwc-line-ripple":"0.18.0-canary.779853ff.0","@material/mwc-notched-outline":"0.18.0-canary.779853ff.0","@material/textfield":"=8.0.0-canary.74839da7b.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.18.0-canary.779853ff.0","@material/notched-outline":"=8.0.0-canary.74839da7b.0","@material/ripple":"=8.0.0-canary.74839da7b.0","@material/shape":"=8.0.0-canary.74839da7b.0","@material/theme":"=8.0.0-canary.74839da7b.0"},"publishConfig":{"access":"public"},"gitHead":"e06c13898d0c9fdc7cd494c68586a55eddd2d483","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e06c13898d0c9fdc7cd494c68586a55eddd2d483/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e06c13898d0c9fdc7cd494c68586a55eddd2d483/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e06c13898d0c9fdc7cd494c68586a55eddd2d483/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e06c13898d0c9fdc7cd494c68586a55eddd2d483/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e06c13898d0c9fdc7cd494c68586a55eddd2d483/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e06c13898d0c9fdc7cd494c68586a55eddd2d483/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e06c13898d0c9fdc7cd494c68586a55eddd2d483/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e06c13898d0c9fdc7cd494c68586a55eddd2d483/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.18.0-canary.779853ff.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-2SWAGxC6AAe0r3sD4oOj6i6wAUvkfIbW64Rzv4zTNwOqQgMU5RFDW1eOG3HYWX3JAPIxMqt+szUryaMBZgNYVg==","shasum":"3f3c79312c5ada382f9d76865c30467cc00d1f57","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.18.0-canary.779853ff.0.tgz","fileCount":16,"unpackedSize":264430,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfKEgICRA9TVsSAnZWagAAF5sP+wXjohM0LYM9R78EWTzQ\nGb4CBC1c3OKlhTPhnICy7SBKlOCnYTI/SKj6oH4hDLq9Et7NccuRXCXqF2kk\nAUM+/Y+VmvTYJXY/ltf+fF9N4pgsw4HYS/acdDs+u6z2oM3iJP2l56ttsGY3\nKwb/npc/MhKoznqoZ92L3FROCI3vobnhiTLjAZP1ual3f3cGHCYELmOlomB8\n2vzCj6+miugaeaz0mLFHzKvbtEtPN4y6Qwn3bzNP7jw2YR8f0rVgq0k97Vxm\nPk+rJSucBhvI9UmZGj21LqW4PIYuxulaZG8vhjiWrttf460THk+nwK2H7C5y\nhFWpBFwgqFbw9njXXInKoeGPISeG39mn6MLuCPSGgkknp9LhOGUrCEUoW0Jf\nFYqvi7a39UyYg+YMaYS/kDkP/DJv2FLs0Ot3KJVgCLz14pJYKvyQ5dMwXzSc\nixQ4c4uIvadSajAZXpJyeNvfHJvAk6DOLXJW4X1X136xb3PHP+aRYERwx0f3\nNC7L9L5FociNtup5N+q2OVXo7mgL2V8uXpfwezlOPWut5uytfbiVIcBHt/Bc\nxKAxF8MyykBJOQkBAJ358+yTCjBDV4CLUsczayEEud/QGDpzMzdJsIHfxz26\nfuUsdaq18H6Wo1NiVobaJ00FTVy21lV7ms6qufuKBC9y3ZcyVgvvmQtm4uBt\nqO7j\r\n=KbPh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIERODZVWuvFlR+mVxc2hM1FU5ZP8ydLAoVdzkjh4LfO4AiBTgrGTJsKza1Ob0G6RK2Q6EWLfFG0XltrNpnZCLgmQ1A=="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.18.0-canary.779853ff.0_1596475400487_0.46827243446434696"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.18.0-canary.8aaf270b.0":{"name":"@material/mwc-textfield","version":"0.18.0-canary.8aaf270b.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.74839da7b.0","@material/line-ripple":"=8.0.0-canary.74839da7b.0","@material/mwc-base":"0.18.0-canary.8aaf270b.0","@material/mwc-floating-label":"0.18.0-canary.8aaf270b.0","@material/mwc-line-ripple":"0.18.0-canary.8aaf270b.0","@material/mwc-notched-outline":"0.18.0-canary.8aaf270b.0","@material/textfield":"=8.0.0-canary.74839da7b.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.18.0-canary.8aaf270b.0","@material/notched-outline":"=8.0.0-canary.74839da7b.0","@material/ripple":"=8.0.0-canary.74839da7b.0","@material/shape":"=8.0.0-canary.74839da7b.0","@material/theme":"=8.0.0-canary.74839da7b.0"},"publishConfig":{"access":"public"},"gitHead":"e119651cfd9ab60def67a36255b4ea0ca1022d37","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e119651cfd9ab60def67a36255b4ea0ca1022d37/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e119651cfd9ab60def67a36255b4ea0ca1022d37/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e119651cfd9ab60def67a36255b4ea0ca1022d37/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e119651cfd9ab60def67a36255b4ea0ca1022d37/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e119651cfd9ab60def67a36255b4ea0ca1022d37/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e119651cfd9ab60def67a36255b4ea0ca1022d37/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e119651cfd9ab60def67a36255b4ea0ca1022d37/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e119651cfd9ab60def67a36255b4ea0ca1022d37/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.18.0-canary.8aaf270b.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-zeNRuNO3/99ujhZounQG6+tUwCWt9BrFIbvcspC519Cd+w46f/ynyiSzIbUXQWoVXCl95Whice9YzOU6wqFURg==","shasum":"d48ef6cc72356fdcea0d7931ff3b620acd30a28a","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.18.0-canary.8aaf270b.0.tgz","fileCount":16,"unpackedSize":264430,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfKFopCRA9TVsSAnZWagAA+NcP/3OTuL2caAeoEZ7QBOn9\nzH9oYh/R1ec+RzK5T0zRzPNnbsOsUihMpBSYkIn6lH5iQa4aP6cUqWiT5Q7q\nbzcFaHTkkW3dbX4n094VaaOl8DooANc3r7bq2erZZmWo+w5cHxh0xgNRBnck\nbNPVGvTxFiJOyTGecz1S+Y31j9QpmXTBC0ZH0fYudF0iQ+L+Iz/T+xFe18zN\nvhb6lQEB5Jn9IhjX6yyWdrRovNiABqfTYVhXhbHO6SbWWd7+e0VQtbKwRGYQ\nGoje1fjxGVDsGBkWprYbsU2EDFIFX3VamfyMOHpapaBDtf6hUMtYFXzk5/Ug\ntap+JO2VvG4ldgh5i/RsP1KAb/xV7MWB1p797oybBkCQfgyDcGKGujExVALO\nfhVta8eaPvXDFitJ2HpIWQ2eOA54vOYvd9GrIU8G42f3YyV/FIKCTO/s+Wz0\nwU+/exvQwlkS6Ob+tAni1EPdyTedb5OfRT3q4/urPomdVfXQb0s48zJrnT10\n3XHQaCEGJBt0cEjWE98FgY9FLeWqMggFH00jyJi1ZzyZIgxzT7Bsoh8wxYB8\nrL5EmXbtThT4fIXZthpWCPlT7DlaJZw9wTVq+cYrOefpNx//yj2rP+YwU1mr\nOqeqXYrJYduy56mFVOGFShhzFSGPiYSgPUEoTsvMoLtCbfXDG2qDVFmLOnOf\nOFzE\r\n=zHkq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCF4sh8AcBm9XKIsho15TkTVtEnHzxK23uulrkZMFK5+AIgLVqd2mFEbG/wBKKWzW9h0MnOjJMr2KsByvjKr4DNNnE="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.18.0-canary.8aaf270b.0_1596480041305_0.7617221318216143"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.18.0-canary.5cde9f12.0":{"name":"@material/mwc-textfield","version":"0.18.0-canary.5cde9f12.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.5903d39af.0","@material/line-ripple":"=8.0.0-canary.5903d39af.0","@material/mwc-base":"0.18.0-canary.5cde9f12.0","@material/mwc-floating-label":"0.18.0-canary.5cde9f12.0","@material/mwc-line-ripple":"0.18.0-canary.5cde9f12.0","@material/mwc-notched-outline":"0.18.0-canary.5cde9f12.0","@material/textfield":"=8.0.0-canary.5903d39af.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.18.0-canary.5cde9f12.0","@material/notched-outline":"=8.0.0-canary.5903d39af.0","@material/ripple":"=8.0.0-canary.5903d39af.0","@material/shape":"=8.0.0-canary.5903d39af.0","@material/theme":"=8.0.0-canary.5903d39af.0"},"publishConfig":{"access":"public"},"gitHead":"12da43d72184f78a2245a6686a1ebff3e7bb03e7","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/12da43d72184f78a2245a6686a1ebff3e7bb03e7/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/12da43d72184f78a2245a6686a1ebff3e7bb03e7/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/12da43d72184f78a2245a6686a1ebff3e7bb03e7/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/12da43d72184f78a2245a6686a1ebff3e7bb03e7/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/12da43d72184f78a2245a6686a1ebff3e7bb03e7/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/12da43d72184f78a2245a6686a1ebff3e7bb03e7/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/12da43d72184f78a2245a6686a1ebff3e7bb03e7/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/12da43d72184f78a2245a6686a1ebff3e7bb03e7/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.18.0-canary.5cde9f12.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-2N82XETi+qjr/jM3YRd+pT6Z8omRVMtb3N/I5Otj9KKV0osqN6ldVuEAm336dBHSGPVJBrFN2p2sMUqurUyZ8A==","shasum":"1ce8d72958f17b8acfe01ad0f46fa8575561ad5e","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.18.0-canary.5cde9f12.0.tgz","fileCount":16,"unpackedSize":264430,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfKF7vCRA9TVsSAnZWagAAnKcQAIp6u/8lGCkduIZI/tUM\nWDu2o4mPZKM9aHCOpjzDtFl5oLvBOooKUwiP2j+hmfzDtLfHYeqqaFngvW2h\n2SUY+TDIs9RNWfWGlams5Nh5oILILqALs1Wl+mjYSW92yWHIqRKaKfRUoWgG\nFgNbkzLHyoIFOwGbVfGxf17V1Q4zYV5NuIJxpmuSzQmiKbf8M/dfMJPvjyFI\nvccqWmJRLJZU5E4/q15NCYCRnMqSSqNpV7eh1OfWuQnK0ih0xFyzcL7UEiEH\n2jGkr4+TsTduem5/sxMK03f4wM9L12ZJC4VRBtu0GnZ639g1MwfVte67pD/C\nMqz61DRW6RJ7qNC6AsGbvHKf/r0uQplEHJY1A+YEHaBcT+Rv1OrhnyMDFa2A\nTYjzmbrKzWkOiX9wn5PQJ2vBIDAnjTD4GcmU5DNTsbC3TdXr9zHrQV+xr+qJ\nWo81LVLt3mSOkMFxkKtER1XaObCUKZdTwdC1w+T6ubNuSnDb76dsessOwmTp\nSmU8XyHzoj0w5woHI2rqdwchg3bo96NsSLXD+qUfJAwJ5NwQllePMBy5j8Tw\nzslufYsraDJx8hvaLWwV02ZutFIyjW9iTiTZi+6jH1pa4NENdZt2WqKTCU8u\nyVf1ZnFv8J7n9kMEa5+qtogc6bg5dxHwR88XXpTVH6bbp3Wx3xe5vLkMJFTO\n6/Zx\r\n=4NoT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH9pQ/7VfoCFdaPpaxjU4JAx++jmTPJcxQv3ygUmAjHtAiEAu6AOQ7YDr3kd9P/BFPHbM0Y3R9JsrjgSp7sLo/yos9k="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.18.0-canary.5cde9f12.0_1596481263151_0.06442738988157237"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.18.0-canary.1607ec53.0":{"name":"@material/mwc-textfield","version":"0.18.0-canary.1607ec53.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.096a7a066.0","@material/line-ripple":"=8.0.0-canary.096a7a066.0","@material/mwc-base":"0.18.0-canary.1607ec53.0","@material/mwc-floating-label":"0.18.0-canary.1607ec53.0","@material/mwc-line-ripple":"0.18.0-canary.1607ec53.0","@material/mwc-notched-outline":"0.18.0-canary.1607ec53.0","@material/textfield":"=8.0.0-canary.096a7a066.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.18.0-canary.1607ec53.0","@material/notched-outline":"=8.0.0-canary.096a7a066.0","@material/ripple":"=8.0.0-canary.096a7a066.0","@material/shape":"=8.0.0-canary.096a7a066.0","@material/theme":"=8.0.0-canary.096a7a066.0"},"publishConfig":{"access":"public"},"gitHead":"0ed0cf9b8288929f621c044aaed573575e7f23ae","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0ed0cf9b8288929f621c044aaed573575e7f23ae/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0ed0cf9b8288929f621c044aaed573575e7f23ae/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0ed0cf9b8288929f621c044aaed573575e7f23ae/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0ed0cf9b8288929f621c044aaed573575e7f23ae/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0ed0cf9b8288929f621c044aaed573575e7f23ae/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0ed0cf9b8288929f621c044aaed573575e7f23ae/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0ed0cf9b8288929f621c044aaed573575e7f23ae/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0ed0cf9b8288929f621c044aaed573575e7f23ae/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.18.0-canary.1607ec53.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-Jd8ACqPmVXH4jxLq8kHXulO602xyomvtCBd76/qIUl7XkRKZmm3Cuud20CiS0dgbCGXOn9AseZBVPkSeVu6mdw==","shasum":"3e567f6f108cbd3de1c6b4d0f4862acdd1b1878d","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.18.0-canary.1607ec53.0.tgz","fileCount":16,"unpackedSize":264430,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfKGmgCRA9TVsSAnZWagAA4pAQAIXb64mEUQXIGa8sRkxF\n0k7n9Peh7E98wlgDImbHERakmjR54kAr9eNZ9qVlrzGsq7yAjk+pOJ3SoazQ\nrlLmEgVPfJjN14BQJBJC1EVMeEzuLELPZwLTElCHnA8w/K5BCQqQFxGmp+5P\nRPBRNvnkfOD4eoUB4RVioyCw4XVSNuq5FGZ9/EFj4mKEKxOlxgpTTot/1kzY\nEnj4QL4gGRCtogvx2ZvikG78oUEYaDqIF4/E8iqymcwksEfjsgw6gaB7JK2O\nLwr5i6C1NhLz/Jc06BmSsykN9k6ZO8Ti+GAjbo5tVaRR0Q824QAm2xoabCsO\nqw165mGmcyM+2MYetf4QV9D5bOq1rZYlwBhr03smVlYyph6l4BkZAQGrqgUN\ni47vvyYPZA8n9wdNWMEJv5aKVzNq+dqDcZQ4b72VnGjFCc8ptL6/+80gFvdB\n47b/xljzfRXTG88xA5H+lFDogdCtMgyqYAiWwCqubENufevLQ7MiGT5x940B\nh+BH6IfKtIvF8F3choY7X1iyB8PlbfLRqXAlw5J8D4bGFlTTb5SEXQp5PPKC\np+e/9HPAs1myUYj3iMMgyiXRnZBeSXhtoThuVproVwXy7uorayeHqWyahNLb\nEIUg2aZhMwKxM23AupIUc8UpMHVfK27oEpQdyh9470AXXLcK/GlJt9xwvPcs\nopb0\r\n=fHD/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBh41udHhpte6ZnM1vqD3SejseUDiGL8uRQjRRcJZReEAiEA/nWMsv62HZ90tIsbWBT5wnxSu5GPCUkKfEsC2zrRyZU="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.18.0-canary.1607ec53.0_1596484000249_0.328975308034412"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.18.0-canary.678b30e3.0":{"name":"@material/mwc-textfield","version":"0.18.0-canary.678b30e3.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.096a7a066.0","@material/line-ripple":"=8.0.0-canary.096a7a066.0","@material/mwc-base":"0.18.0-canary.678b30e3.0","@material/mwc-floating-label":"0.18.0-canary.678b30e3.0","@material/mwc-line-ripple":"0.18.0-canary.678b30e3.0","@material/mwc-notched-outline":"0.18.0-canary.678b30e3.0","@material/textfield":"=8.0.0-canary.096a7a066.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.18.0-canary.678b30e3.0","@material/notched-outline":"=8.0.0-canary.096a7a066.0","@material/ripple":"=8.0.0-canary.096a7a066.0","@material/shape":"=8.0.0-canary.096a7a066.0","@material/theme":"=8.0.0-canary.096a7a066.0"},"publishConfig":{"access":"public"},"gitHead":"53d3656f4039bb116e0f771ca0dffc41b500bb59","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/53d3656f4039bb116e0f771ca0dffc41b500bb59/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/53d3656f4039bb116e0f771ca0dffc41b500bb59/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/53d3656f4039bb116e0f771ca0dffc41b500bb59/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/53d3656f4039bb116e0f771ca0dffc41b500bb59/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/53d3656f4039bb116e0f771ca0dffc41b500bb59/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/53d3656f4039bb116e0f771ca0dffc41b500bb59/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/53d3656f4039bb116e0f771ca0dffc41b500bb59/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/53d3656f4039bb116e0f771ca0dffc41b500bb59/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.18.0-canary.678b30e3.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-Z0agaLS0i87SteU4dTk6+BlbxdhBuchftZg5Uus9IsN4k+8JcPVfT4yc74JKMDuVDSZUzky7zAkTfZbt5x6J8w==","shasum":"deaaaaad3da350f5392dcfb6e631114d1ad77d30","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.18.0-canary.678b30e3.0.tgz","fileCount":16,"unpackedSize":264430,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfKGqGCRA9TVsSAnZWagAAWyQP/3v2hYSg/+xrXD1jhbJy\nsLDm912MeRgFmg1VB8Y+bMlNwW2Soh2zjjj9LzDnCQkH7X/Lwmbv5Xn+pwSx\nOLEHK7btkBsjpZD8Xh6MMnNjzTiClo5Gvj2ImWmHwX+gcOObybMT6e9ooS2K\nXc+RT73uq5JPrUAAgHC8tw+ENelRjtpkNNqvXIduXzNv77lNGL0nOe/2e6Cb\nQlLRHojopXk0hfc2wuV8q8X7pLtKhGDNURSh8W5UY+6hL7e8rMeKCMlvAbiE\nBOStqI0hd8SMobhhKutFsxWjL7i+OcW7yDkD4C6+qz3CEE3IQEyGaNJuRoci\n9PEbPoYTlm2B8NcHhCnBYwrvv6BzwJLzYJnArzuuMTLELMjpjS61gcjG3WDe\ngkh2jVLtjQiBpojaJGYJqL+Noaq8rhmnck+OD8Q4+mOdN7OX6AhQTkAKOhik\ndlasjd3qPBwXx3jB16DOYnEcH4i8hGGrX5MAUKWBd12ytyoXStdzjPBA9eW6\nD+Bgd1Kk8lLisp2LwdbKNd/MCZsnl/KeD5taQ3bg5bX2k2hlKVuNdnMaErjt\nWWQTSmaWovHKNqjTUOZLI6Xx4DrqsXltnrXUcCIEGUfm/6MFKTuAgxOTb6Tb\nNFNMbrlHMbsSerRusQEQh6GwtXXbp2Wdyw83iDz/H7pv7IeZaTzArAh1RaUM\ncEhx\r\n=re5W\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGcDYoO/ZR4/t0tSpGxP3wfuXD2Mug7o0F0+labX3mjSAiBirBuO6fVh0+RAFOoJwNsC40nTIjvx7agnI75B0xHlsw=="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.18.0-canary.678b30e3.0_1596484230482_0.708510686221576"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.18.0-canary.21c55569.0":{"name":"@material/mwc-textfield","version":"0.18.0-canary.21c55569.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.096a7a066.0","@material/line-ripple":"=8.0.0-canary.096a7a066.0","@material/mwc-base":"0.18.0-canary.21c55569.0","@material/mwc-floating-label":"0.18.0-canary.21c55569.0","@material/mwc-line-ripple":"0.18.0-canary.21c55569.0","@material/mwc-notched-outline":"0.18.0-canary.21c55569.0","@material/textfield":"=8.0.0-canary.096a7a066.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.18.0-canary.21c55569.0","@material/notched-outline":"=8.0.0-canary.096a7a066.0","@material/ripple":"=8.0.0-canary.096a7a066.0","@material/shape":"=8.0.0-canary.096a7a066.0","@material/theme":"=8.0.0-canary.096a7a066.0"},"publishConfig":{"access":"public"},"gitHead":"65f46b7dbda996fd5cc43abfdb42943515aaca08","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/65f46b7dbda996fd5cc43abfdb42943515aaca08/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/65f46b7dbda996fd5cc43abfdb42943515aaca08/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/65f46b7dbda996fd5cc43abfdb42943515aaca08/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/65f46b7dbda996fd5cc43abfdb42943515aaca08/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/65f46b7dbda996fd5cc43abfdb42943515aaca08/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/65f46b7dbda996fd5cc43abfdb42943515aaca08/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/65f46b7dbda996fd5cc43abfdb42943515aaca08/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/65f46b7dbda996fd5cc43abfdb42943515aaca08/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.18.0-canary.21c55569.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-0W5PSaiG32hZc/fiMOq9JNifDQHMILh3H4dJs2G5+Tpcc2TpVK/ETiKDyjpUHORXQXAlLjxJ0spSEUxStlO96w==","shasum":"84cd9035d1edf35bfdfc41ec9f6b4e937872fb8e","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.18.0-canary.21c55569.0.tgz","fileCount":16,"unpackedSize":264430,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfKGvzCRA9TVsSAnZWagAAObQP/iYqr8veGB95RrDLgTaC\nL0vZ9U6yAC7pIaEYMB0H9Io/JRFtmN1j4Q+ITa3QHtdD7Fng2ETAN/EfIGHN\nfocwWzjCSgXHEfG0Q5uFPDaJNV2LmAI3EM+6efo33pySvwdUtbNsLJdsTXHE\nnKRsZQZqdBpAVxCU1Utrbrpt/8+kty0GX6TdSN5Fvhtkui7lEbdje1TkKK+v\n5+khta0Noef/ljbQWE20cSEbGerUmdck5TzA3ZQ7HUB4MAMWSifJSwgl8vXm\n3EKlJCM1bmjTq5PqdX+47F/zUszNL9mhEzpSKZdl5IAx+xW8Jbm0S0B1CA2k\njwXbdASu5UeFeSDH0Sz1JL37QAA4pHNLv4VN3GGJx8B+douJdVYA8m1YXoCZ\ngKKiDrT7uEiWVtjKZL69ytphSSXdRayfYWTNFAL0JWwBzvdjqJnrtt1ejm53\niBKddePQswt84eVGFBypsY0J0gB3K6fTFAxkzXkdICYRJtUM6mLNoSRpKD4G\nWyxBiPsmcqsHJ7A2ULgnjjnd/adyYAlwRGqfB5KajZXyQs/Vk+HnW3YeCI70\n+neubI6dsk6/xDhmaTQXv0Zfnm89jTNd/e/oM7VjZ9h5VJRpkUoBAGvIaYk+\no/uoulQW++AINC0xLUvPnNi02pReDIwtX2vYXbe3JqjY4pRdwOIz6b7eAuCr\n8zD8\r\n=RIjG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC6AiAPe+pvL7hQK/osRv2WdGYhhCuNISy1rGGxrm4hRwIgJr4NQLSzIL3jSAKAYvN4pHjgfj1ID2rMghaxz2/Iltg="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.18.0-canary.21c55569.0_1596484594690_0.8083275517437374"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.907d4d7d.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.907d4d7d.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.096a7a066.0","@material/line-ripple":"=8.0.0-canary.096a7a066.0","@material/mwc-base":"0.19.0-canary.907d4d7d.0","@material/mwc-floating-label":"0.19.0-canary.907d4d7d.0","@material/mwc-line-ripple":"0.19.0-canary.907d4d7d.0","@material/mwc-notched-outline":"0.19.0-canary.907d4d7d.0","@material/textfield":"=8.0.0-canary.096a7a066.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.907d4d7d.0","@material/notched-outline":"=8.0.0-canary.096a7a066.0","@material/ripple":"=8.0.0-canary.096a7a066.0","@material/shape":"=8.0.0-canary.096a7a066.0","@material/theme":"=8.0.0-canary.096a7a066.0"},"publishConfig":{"access":"public"},"gitHead":"c9bc2fce8a40ef8eff9b7444030f3e2a62cc1d8f","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c9bc2fce8a40ef8eff9b7444030f3e2a62cc1d8f/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c9bc2fce8a40ef8eff9b7444030f3e2a62cc1d8f/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c9bc2fce8a40ef8eff9b7444030f3e2a62cc1d8f/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c9bc2fce8a40ef8eff9b7444030f3e2a62cc1d8f/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c9bc2fce8a40ef8eff9b7444030f3e2a62cc1d8f/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c9bc2fce8a40ef8eff9b7444030f3e2a62cc1d8f/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c9bc2fce8a40ef8eff9b7444030f3e2a62cc1d8f/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c9bc2fce8a40ef8eff9b7444030f3e2a62cc1d8f/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.907d4d7d.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-VW8LYpDMKHPhZUMv37Qi4uZcxFRnX/iwW3VzHRdTr6KZJP9BIGzS3m6MLAY3drwrXAUPejkLBJzvTEjPBaSOSg==","shasum":"0bed7459e9260bed2bec335d769ea4f5116353aa","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.907d4d7d.0.tgz","fileCount":16,"unpackedSize":264430,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfKIAJCRA9TVsSAnZWagAACJMP/3EVtxkwzjmC5RkJ67Fw\no8H8jdjwLAyu27xZeBJJgapFVWz7rAQUMnnQ109BFGcHLtsdCyanO1ope7eY\nSqTmdQ+a6caRgdlJ6KpJyNpjhUBxHWde7zP5SoZtlGsHI3DKu7BgnemDmgsU\nQUgyHupehmfWqbxXWFYBdR2QOPtajSQbhRWORjSdvekyBcYYk+PiHzHS5HzV\ny9OgwYU6ybM25PuYVpSHt79dVM0YTezqJpLWGbf+/DJanN5cP5fPU8mU0stE\naN5m2O0BzvXPaNKrtkjrxobuAG/Xo/enSIGsQQuX1190PtN4VKlvedgHbKvq\nfOqBs0lpWngTv2mUrhahYRzjg+EMDuGGBwcoQ6jvpoT0TxFWk+44QEp0amBw\n0ukY7kSZPSWg/I8BGifDT+Jr0tnD/MPBw837EHiaUWxFqda5anoCsQJjEHRy\nsCCx2KGYOMQx+Y9HVB0CPTgXJbo6d2fDE4LxDoESqxTZvJUxH0EnhHm8loAq\ncHb4yNpgABt4R3AIGMcislpuvFPOVoO9pFbUSzNSxRathaufKEiG5EW6+Sin\n31gvP2JdfTm5bWqGvqF9OGnFvttZ8H0WjBixFRMCDdfDQFxtcmPgqXWa4yc2\nfEiE5yxaJKDKSwkovQGTLxYBDMS6dV8cfnafJbcjhVafTwcMgI3pCRhCA1RF\nX59D\r\n=UGY7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCTeO/+54duCaMde6xt5GcbCtYZGnvFzcrsEeOLwk27dwIgLcpO2YpkU9CGnRn12lYBh0HoPPkGCNln5ZsdrAetom4="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.907d4d7d.0_1596489737426_0.558254898820679"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.18.0":{"name":"@material/mwc-textfield","version":"0.18.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.096a7a066.0","@material/line-ripple":"=8.0.0-canary.096a7a066.0","@material/mwc-base":"^0.18.0","@material/mwc-floating-label":"^0.18.0","@material/mwc-line-ripple":"^0.18.0","@material/mwc-notched-outline":"^0.18.0","@material/textfield":"=8.0.0-canary.096a7a066.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"^0.18.0","@material/notched-outline":"=8.0.0-canary.096a7a066.0","@material/ripple":"=8.0.0-canary.096a7a066.0","@material/shape":"=8.0.0-canary.096a7a066.0","@material/theme":"=8.0.0-canary.096a7a066.0"},"publishConfig":{"access":"public"},"gitHead":"907d4d7d7235b3a3256595bce22f0d7db165adab","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.18.0","_nodeVersion":"13.8.0","_npmVersion":"lerna/3.20.2/node@v13.8.0+x64 (darwin)","dist":{"integrity":"sha512-7aWk4+5ZnusIGUPAhy0PaQKBNdkWnE3Ipz4BLNq9X8VqgnNIcod4FpfHcFyFs8+eWXW1I+xf5TUDcfG9MmoM+Q==","shasum":"62d1dee62bb35e54ad3836c5c7eba2839f18b3b7","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.18.0.tgz","fileCount":16,"unpackedSize":264327,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfKICNCRA9TVsSAnZWagAAVXoQAJxCD/vkxzsvxPTj/dBd\njAJq1atTk/aJR3u05DZk6/p2sjBBvLH88I5hp6iE00C1g2fNPPzSgXqhX076\nn5GznfhZjJzcNcr2GR1rM6Ecx5cV3rPKGgkVk9DvS7ACKH8VyVvY8hM8bPKu\nuFn2ZElPspmOsS2ugPO4ILeLkneL/PhdsHsPb+KNsPTsNSBhUZ58CDqaGJV3\nIWWXsSI+HqrQtiY5kkOEq129lPR46citTlnW1lCq6M2QBp0juegAbaabmwSl\nnGIdmLIE/CFqs4TH/KLWrkMbis8qRPHNGN4/HtZIvnzXTZjT5Glpuyh7dF6G\nqXBvieWi8T0BOL3+JC2opwVPcp3F/EOnoHOstt+FPIRULmjMA6whWVtwwgIG\nO9aV58s1Xwe2ltWUWvqMSNKlK1Uv23Tatxg809Nq+rEQ61hDt4ch3DyoifDw\nXRUv6fmVCM+scO+GwGSNRsc011dCbCjr177iLtYkW5y8xJxfab6dOz+7dCJV\nIxeqJ6h9W1J+Cz7WWTUGheG1u+EG/8fKayQ/Zoz4qql9TaHfuXvxf2qW1ZJ0\nJ1KBgXPKFpbYvgc+AovrUeXBIeq9D/e6Cr94OesOpMrw4wa0YdtF5RlgUY+g\nJ2TrP2vWnz/ntWes/FJUOS6jYDrxoNC6e63L0sfhbpJCVM7zG7/+jOSrzbLb\nAuXJ\r\n=xPF4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDuDpnTziD1w9j3QC6c2kVKGxUMpltT8+THkjx2sIdqvAIgFoKkmzNFdrMMsKmzPnT1IeefGkjNSA4CvAxMlKLbjV8="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"emarquez","email":"emarquez@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.18.0_1596489868871_0.2542817863164364"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.f7958e4a.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.f7958e4a.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.096a7a066.0","@material/line-ripple":"=8.0.0-canary.096a7a066.0","@material/mwc-base":"0.19.0-canary.f7958e4a.0","@material/mwc-floating-label":"0.19.0-canary.f7958e4a.0","@material/mwc-line-ripple":"0.19.0-canary.f7958e4a.0","@material/mwc-notched-outline":"0.19.0-canary.f7958e4a.0","@material/textfield":"=8.0.0-canary.096a7a066.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.f7958e4a.0","@material/notched-outline":"=8.0.0-canary.096a7a066.0","@material/ripple":"=8.0.0-canary.096a7a066.0","@material/shape":"=8.0.0-canary.096a7a066.0","@material/theme":"=8.0.0-canary.096a7a066.0"},"publishConfig":{"access":"public"},"gitHead":"814d7f99f2c2016c7d56a7297cec2ee04c29bbcc","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/814d7f99f2c2016c7d56a7297cec2ee04c29bbcc/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/814d7f99f2c2016c7d56a7297cec2ee04c29bbcc/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/814d7f99f2c2016c7d56a7297cec2ee04c29bbcc/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/814d7f99f2c2016c7d56a7297cec2ee04c29bbcc/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/814d7f99f2c2016c7d56a7297cec2ee04c29bbcc/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/814d7f99f2c2016c7d56a7297cec2ee04c29bbcc/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/814d7f99f2c2016c7d56a7297cec2ee04c29bbcc/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/814d7f99f2c2016c7d56a7297cec2ee04c29bbcc/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.f7958e4a.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-9Em00pZFaZAJigCNNWi49S2uwnwm4eMouoN79eIpGZUw4AwpKlUjqAiJw2CtGfDf+NJyvAn7cWKUloRFnob63w==","shasum":"93be34db2c1cad270c6af15cbee0da6a659eac3b","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.f7958e4a.0.tgz","fileCount":16,"unpackedSize":264430,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfKMK4CRA9TVsSAnZWagAAfAQP/0ZjvXt8oUkQ6PtntqPK\nWDoX75dmr5HcqBPa/cNQ98KfZ9gxHuwz5dVywQKijsErvp85lfPJeGyyr5EL\n/gPJ7QIQds6Pyf4nYOkImTrVxc/wjuBzic2S7783KEiFVy7+N1ENR8HqV7y5\nubr4ujoZ5PZCofsOzwKNZu3WqUr5wedeAvHP2tOoE6j8aRimZxlRd+WlKC6a\n4H9HSIrAVMG+a24zAuDZVjffKeRUqJdCJlsch8rD5cdbcRjPRY85O1q4sQH8\nhEj4yo4R0kwlQfPkG5BCke0z3ZOqa+ZIu6EXuLJ49ye9+OJwlNctponBrUfu\nY75j238QfD5ugBhmM9r89ESM4ZUsX+0WS3K9tJ73Tvz1/E28eMphBlHL1f3A\nfmb/AmCW7fJtaL3q1W4O9B/q2l3cEoNzhHPcd1+917nYOX5Dj6J+c9x2/K/5\nkwb2YZsiU0vE9ov+DT2MMk+wsi2V639eGodjYT40L7p/MLEJjH3751W+yeIQ\n9nVYiKjpjZvcC5zHUQ2bn/fDcDxfgHZs+gIRd014OSvuxKeZCRbpHKLTLfrp\noSzdL/WysP/1JI62xp26sqtooxfdDVCCXO0I06bI2v76sBynqzfe9SSc6ajW\nARgXZN1M61jXiySMaMTS7zrEInLExMUK1CPRB4pcTqE96p2pueBOG5HItIVk\nwhwk\r\n=CI0j\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDfOr8pODUqE7t38KDDnlZxlzBpvRQ89jl+CdOj3DXCOAiEAzyd3Q8juaweX6y4gNSxxRD6jga3ZAdRtXPUgQwVnw9c="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.f7958e4a.0_1596506807996_0.6593036795245517"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.f8ceaf79.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.f8ceaf79.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.1b44b43c8.0","@material/line-ripple":"=8.0.0-canary.1b44b43c8.0","@material/mwc-base":"0.19.0-canary.f8ceaf79.0","@material/mwc-floating-label":"0.19.0-canary.f8ceaf79.0","@material/mwc-line-ripple":"0.19.0-canary.f8ceaf79.0","@material/mwc-notched-outline":"0.19.0-canary.f8ceaf79.0","@material/textfield":"=8.0.0-canary.1b44b43c8.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.f8ceaf79.0","@material/notched-outline":"=8.0.0-canary.1b44b43c8.0","@material/ripple":"=8.0.0-canary.1b44b43c8.0","@material/shape":"=8.0.0-canary.1b44b43c8.0","@material/theme":"=8.0.0-canary.1b44b43c8.0"},"publishConfig":{"access":"public"},"gitHead":"a1435334692098639ad087e00c61c1190812b959","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a1435334692098639ad087e00c61c1190812b959/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a1435334692098639ad087e00c61c1190812b959/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a1435334692098639ad087e00c61c1190812b959/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a1435334692098639ad087e00c61c1190812b959/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a1435334692098639ad087e00c61c1190812b959/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a1435334692098639ad087e00c61c1190812b959/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a1435334692098639ad087e00c61c1190812b959/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a1435334692098639ad087e00c61c1190812b959/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.f8ceaf79.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-ZxeafUbrEqI0e499gAw0AkWhTu8ckrsfwnO9otIh5jDNqJZD66IxK56Ys46GX2tvrp9f6xr7eW41MCPi35yxgA==","shasum":"4cfdf7d0e7e259738b2b07a735e66540e6c761ba","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.f8ceaf79.0.tgz","fileCount":16,"unpackedSize":264430,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfKbRrCRA9TVsSAnZWagAAMr0P/0obZ37EYp9/BNCSLh4Y\ntqa3Tt3JC9rjBWsbU8iupDyFsloAy53jd2Pa+jRYgXpkVSIS0EDqJLkR14kY\ndibb5bq74fs2/kGWkUuE0cmFE6KJsLchaAYN1Z4Z3tVnaQ2pHH67bDwXmypx\nv1l6MB7XdyykagQ2vXUCXYEl4r9zGw6eAeHEPPrRakhP067/EdBt5Q7wkCy6\n0MQ0NALrTQSDrSjd4tW/pdmIm6IGBukmCouXuQOZT0otK1kWlmLhd2+9wmZk\nqGIflirruRvsD3JmS2eGt9o4iJAfH2n88wPLktfB3nUf7vXC5vtS2yz2oJiI\nCbdg+m6IbhxM4/c6bH0/TBsW9imEuagOhE/z6KY9OaGYx43cEPwx9H6HWQhz\nI0lR58QQmQVRCDiR9IyKKMkRd9f68VHa8oF1coNXU0bUUQxwA9vdi1VI0svS\nBtST4bHktH+Js2F4xZrzPFjERC46W2EgwgvN1OKI3HagR4qSXFtsF/6vNnmd\nMUNp58qKhgyUYmuCtD9Xw57n8nyD6hbgf1GO1lHXvyJ+XnYgXbuyVyFvQoP8\nRfVXosbN2R4N7gDaV2cwzeQOBCJ21cUM0O3/LqhQNec1hq74eMWCOpAhTbCb\njCQbQVZoSWVywORY6J9FqhYRbfq7+/cJHd8LwwQTriI1XNDFQzEsVMIyYwee\nbPtL\r\n=/kyf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDMQrRB/paw0lZhNAFiRav0KruOGQimBMMKYJNf+gCtaAIhAI3X6QWUhVoRKm9jK7QmRr6oyC7zFpMRjlstgKveeUD2"}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.f8ceaf79.0_1596568683429_0.9790187105264052"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.6b9e385a.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.6b9e385a.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.1b44b43c8.0","@material/line-ripple":"=8.0.0-canary.1b44b43c8.0","@material/mwc-base":"0.19.0-canary.6b9e385a.0","@material/mwc-floating-label":"0.19.0-canary.6b9e385a.0","@material/mwc-line-ripple":"0.19.0-canary.6b9e385a.0","@material/mwc-notched-outline":"0.19.0-canary.6b9e385a.0","@material/textfield":"=8.0.0-canary.1b44b43c8.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.6b9e385a.0","@material/notched-outline":"=8.0.0-canary.1b44b43c8.0","@material/ripple":"=8.0.0-canary.1b44b43c8.0","@material/shape":"=8.0.0-canary.1b44b43c8.0","@material/theme":"=8.0.0-canary.1b44b43c8.0"},"publishConfig":{"access":"public"},"gitHead":"d264df08ac61122a6e48c33485335fe7444fbd09","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d264df08ac61122a6e48c33485335fe7444fbd09/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d264df08ac61122a6e48c33485335fe7444fbd09/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d264df08ac61122a6e48c33485335fe7444fbd09/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d264df08ac61122a6e48c33485335fe7444fbd09/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d264df08ac61122a6e48c33485335fe7444fbd09/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d264df08ac61122a6e48c33485335fe7444fbd09/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d264df08ac61122a6e48c33485335fe7444fbd09/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d264df08ac61122a6e48c33485335fe7444fbd09/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.6b9e385a.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-M9l3WsYe7fSKW78+O1mr0Mo437UM7krhZyUKOi/EEd/CZtM70BlVsIQYYQO9NaVrORnCfrih+WpL4UREQyq1zw==","shasum":"a49a6c518e5015b1d710fd1991d1ea72c53a892d","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.6b9e385a.0.tgz","fileCount":16,"unpackedSize":264685,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfKdNICRA9TVsSAnZWagAAVYAP/An7+ISJ08TOLhFqWyjU\nlUeYBQuWn7Vc300fFV4k8hcdoJ/ohA8LNx4HnbVXVKeaJjVyLLkP1AnSq+nb\n9+uBtZfkEnr6TwvO1ncqQ8OcIlAH3yxvJgCj5s//IjxfUVv6bo0qMz3Z5fxO\np3iOc2BNoVCWqgsGMgf10aviSy1tfDX+YIC+ADB8h3En1YUZ7ZMRJZWXjbr5\neIVBwrZcRK7hpM2bIwzzcNbLfWVVsgdipUTQKpajlJBvGTmIz6eEF6QXsbFR\nR4/aP1PfApCuoJUHM4JhddQupoAeeAS8jGwIGNOvYQ7M7G6OHZ/jQ8myIdst\nwLSUfuRWTGRmrNLjBqCLIVV+z9EjYMxzQGRbBldjWRY3h+ZmiDKpZ9lcEi36\nhbxScjqxWvgHmVNfYZqXPr9D3cbwoVuXAmIiiYKoZWlRqF9eDgec334XkNWR\nuOjyZkP3QV5NSTHjUNHqAFaa+meVo7hKeY8NilknBfkUrs9w+ZosJTkLvH73\nqviFhO1TqO3IVvkdDcCE0ou4no8PjB5T0ZPQxlELrMRMtzat67DJTvTIi1Wf\nq8TysU/FymyFTC8R5X+LSQQuKoS9VUknhzLGbfkFf0R+br/94gMLa5wQXwa0\nMQifom8IaXa0i4UhTubvGZ7V8t002/dzZrRUaRcSuC+AT6j/3JGpWB1g/Ooa\n/qsc\r\n=2sVH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGvw31Qo4qqDU1oERSosV7z8qTyfWM5SGPB8XQAt7azeAiAGCro1+8uy7v3V16cN2/GTHK8LsnwXv8tziEEMQsWMnw=="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.6b9e385a.0_1596576584481_0.46554169362545217"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.9a7e6d2a.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.9a7e6d2a.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.1b44b43c8.0","@material/line-ripple":"=8.0.0-canary.1b44b43c8.0","@material/mwc-base":"0.19.0-canary.9a7e6d2a.0","@material/mwc-floating-label":"0.19.0-canary.9a7e6d2a.0","@material/mwc-line-ripple":"0.19.0-canary.9a7e6d2a.0","@material/mwc-notched-outline":"0.19.0-canary.9a7e6d2a.0","@material/textfield":"=8.0.0-canary.1b44b43c8.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.9a7e6d2a.0","@material/notched-outline":"=8.0.0-canary.1b44b43c8.0","@material/ripple":"=8.0.0-canary.1b44b43c8.0","@material/shape":"=8.0.0-canary.1b44b43c8.0","@material/theme":"=8.0.0-canary.1b44b43c8.0"},"publishConfig":{"access":"public"},"gitHead":"162d034ba4d899bea7e421640d7cab04f0130e9e","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/162d034ba4d899bea7e421640d7cab04f0130e9e/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/162d034ba4d899bea7e421640d7cab04f0130e9e/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/162d034ba4d899bea7e421640d7cab04f0130e9e/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/162d034ba4d899bea7e421640d7cab04f0130e9e/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/162d034ba4d899bea7e421640d7cab04f0130e9e/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/162d034ba4d899bea7e421640d7cab04f0130e9e/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/162d034ba4d899bea7e421640d7cab04f0130e9e/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/162d034ba4d899bea7e421640d7cab04f0130e9e/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.9a7e6d2a.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-JWMxUOiZg36A+FzF+cfunpexxmrNb9av/i3geEINtlNUtCojG8xF2NWRRAFsWTiOzjv9HBXYeJ6bttdFacYYgg==","shasum":"586dfaf3c844f65aab55a8387aca248e6253d29c","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.9a7e6d2a.0.tgz","fileCount":16,"unpackedSize":264685,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfKitzCRA9TVsSAnZWagAAvr8P/2BskGCbeHVsv+lsvsNC\nLPaFtXL2/CL7Kxmh3vwUqgX00waDhL4w6Fc2QzYIqpQexOKguwMjy5hj/+JI\n/aBB4e3VRtx21/eUTcrSNC/kscP5W+wTb4r/sICLXDBfCi2JeO9DThupyBFB\n0/eTxJ6UtFpV5mP3miDurMNriXS0O8G9HvWMJI8Ivw/PPWm8kmYgSyFvfbdC\nrV2OO/mobriT6/dV+Fa8UwQf8AysExAVWQcGKchY8ZHwiPk3E/CDVcExSXlP\nFzUnu5crXjk90cIrtl/i0JBmpa9DUQfNaFtw4V7r3GnUMnKxYG9fUevnaj6k\ncKn0vNOMXSg5sFEQE7FiclgNckx2OSLzGG4pkz4ksqeOLiz0epICHhJJ1ZN8\nfgQKDH7VLAOrwZynM1Nic8hX+WleOCScB1dCX9JgQnHjPX5bXO0VC4Q4G9gl\no7pflA2QsyPtjxQA9W5P37dTHDRrTq1K3RdfJUc8CvWSjw/dby8s5rwkGtvg\n7i6c7S32rwGiqE0QwhaayY1XfpUX9DXZMkWBGXMUgqTsucnaCGkMRSLOwufB\npmluLAX2FW/n+TqRrsJ5jv0zYk4Jb4anEGZIAYxhYM1zgDeqcRGGf0Le4TWj\nE5/12TnLR5OkOGE5iYgWMHmVbBVK+6LGBga0yftn9zP6HDcAhsNNjvagTZU1\nbyFt\r\n=L/lD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD5VIA5+NDaDRPHjOAtFEZEbM83xBNgcrA/LA4JA9ymjgIhAJaUSR2N6TdHtQOK8E+ETpuI1gkpiJhu/kh8Hg+Fd/lS"}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.9a7e6d2a.0_1596599155382_0.14746107531638786"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.188f3f1c.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.188f3f1c.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.1b44b43c8.0","@material/line-ripple":"=8.0.0-canary.1b44b43c8.0","@material/mwc-base":"0.19.0-canary.188f3f1c.0","@material/mwc-floating-label":"0.19.0-canary.188f3f1c.0","@material/mwc-line-ripple":"0.19.0-canary.188f3f1c.0","@material/mwc-notched-outline":"0.19.0-canary.188f3f1c.0","@material/textfield":"=8.0.0-canary.1b44b43c8.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.188f3f1c.0","@material/notched-outline":"=8.0.0-canary.1b44b43c8.0","@material/ripple":"=8.0.0-canary.1b44b43c8.0","@material/shape":"=8.0.0-canary.1b44b43c8.0","@material/theme":"=8.0.0-canary.1b44b43c8.0"},"publishConfig":{"access":"public"},"gitHead":"200ab3c3186265d2084631aa4f47600057a574eb","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/200ab3c3186265d2084631aa4f47600057a574eb/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/200ab3c3186265d2084631aa4f47600057a574eb/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/200ab3c3186265d2084631aa4f47600057a574eb/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/200ab3c3186265d2084631aa4f47600057a574eb/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/200ab3c3186265d2084631aa4f47600057a574eb/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/200ab3c3186265d2084631aa4f47600057a574eb/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/200ab3c3186265d2084631aa4f47600057a574eb/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/200ab3c3186265d2084631aa4f47600057a574eb/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.188f3f1c.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-txeu32/tuKTiYFAfd8UEYdkfzkc2MQtpjlXYaZkSFUC6el7wNbJuJMOt9V5tzaf4Uebc3wfbjveRrcSOAjJ4EA==","shasum":"26c4c5efa91bc75b387b9c1dd6c9f5f0bc6cab27","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.188f3f1c.0.tgz","fileCount":16,"unpackedSize":264685,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfKvbDCRA9TVsSAnZWagAAg4AP/RbTYVnRgblWdaCfjXjx\ns7FYwhpz5cQz/ADHCjBBjpMuNyUaYZN9gKB/aFzKCHL4yBdJxdH2DWWKqnVU\ncVlHDK8N9DsR59nWDwqBQHuLn8Pt3hZTgPXD7XBygF5h+dPTPcUEtUsN+7q5\nutGNKcadK1JHlkSBY+mm280mc7y0VoehvlZwJWd7pOG3W2YBm2k2S/wpyQXr\nsJwZ3nUe2OWxS3c50y5jr4DzT5z/TzwXXN20otAewzfpOSnUj2J+jVP+7DCD\nIiPJbwuCo/mGsAf0VnhyvIRoXA3rgiT0zGY201xffd+CfOZixvGzmG8+fbPH\nnVth2EIr+CBQmRySVxwJM2zwN4gu8dBF7YRbST9B+PtKVtIddsfUqpSQHd5H\nNqOZ9gw3P/a531MZOEN+2H24sI9w0UvH4ji7EV9cIk0jzOy+FIeTKgpgrvO5\nZMApV1hNH6Q6QuYV4AsWrZa0BB1UEfDdUL39vKtg1l4ze1sQ/9Fb3zMQN9Cy\nqOFURzmHIVKTQ1lrTbu8veZSHdDG8NHhDjY0j/WwOXb/wx+T/Ro2FIv4BUGL\nqTdpDfvHowpkJzos+Vr1jF3zKLLM3FffFwDb0bSlNdUCFLeS5sJpaSB9Xf5F\nhwz5OiPc8UpF/WqaoLTRHWgcC1s5olpKSFQVOptCx9H22vYGrEgkTYscbW8M\nMolY\r\n=n5/l\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDKqzhpHfkkArQQUKhKuyUuRPwpOA3zqN3p/0YcqxNNpwIhAIcCBXQkv6iadmgM+v+XCkzU1JJ/DY90QvjguBmZqwzT"}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.188f3f1c.0_1596651202726_0.7417146639170802"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.b6106add.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.b6106add.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.1b44b43c8.0","@material/line-ripple":"=8.0.0-canary.1b44b43c8.0","@material/mwc-base":"0.19.0-canary.b6106add.0","@material/mwc-floating-label":"0.19.0-canary.b6106add.0","@material/mwc-line-ripple":"0.19.0-canary.b6106add.0","@material/mwc-notched-outline":"0.19.0-canary.b6106add.0","@material/textfield":"=8.0.0-canary.1b44b43c8.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.b6106add.0","@material/notched-outline":"=8.0.0-canary.1b44b43c8.0","@material/ripple":"=8.0.0-canary.1b44b43c8.0","@material/shape":"=8.0.0-canary.1b44b43c8.0","@material/theme":"=8.0.0-canary.1b44b43c8.0"},"publishConfig":{"access":"public"},"gitHead":"9726e6593d779066f5b7158af254537ee9c9174c","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9726e6593d779066f5b7158af254537ee9c9174c/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9726e6593d779066f5b7158af254537ee9c9174c/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9726e6593d779066f5b7158af254537ee9c9174c/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9726e6593d779066f5b7158af254537ee9c9174c/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9726e6593d779066f5b7158af254537ee9c9174c/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9726e6593d779066f5b7158af254537ee9c9174c/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9726e6593d779066f5b7158af254537ee9c9174c/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9726e6593d779066f5b7158af254537ee9c9174c/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.b6106add.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-GQpBS7YtyWtaWslWlp90zjQIrJ9bERG4x7tgravylFygeG3qR5MYs7D4NUFY9N4SCuhvgJiQl9Gmi35n5gtXJA==","shasum":"32eac45ceccf6d8e62c1dccbc3e186e638aa7344","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.b6106add.0.tgz","fileCount":16,"unpackedSize":264685,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfKxtQCRA9TVsSAnZWagAAuvoP/1znuGovAGW0JeI7dHJd\nbQY74L5yMYT360Kr3yNT0qWRKOfTQ4WzvE0Mg65qOjYozmI6z7Em4xgoigaW\nmZuyM89BfzdHFYR4z/QEwrGz7RqcgNegC9NoelHDCRYGk2pbTi4ReaauaeCQ\nuMtUdAc5VttiMPfIFfLBMspLA78b2q9ra4W6ydUS2leorE2LB7HvE/uDhEPg\nzAfOYnmyDAdnLDH6c/TrgQ0dgu9fvQ2Jdg0hx6yifYhJlFqQMTg+PRfrl7ho\nJg0gx/skZobL9jLZJWSeAWPtfL7IiRy4FJicYz2hygGaWLDxYaoHN5SHvp4C\n8gBR38VkdK8qfXz2122op7bLW0ciZBIxote2Ju/n1BmtUOvxjz7Kc7nGvaBK\n9TojswMV9qvG1Lq9QN7dGfbxDrVSLj/kl62Z5RW7jeQvyVbzAStC/JOwirQN\np/OTs4Cmd6TLnxFJnKydUzlamRwtS8d5Y2+k1l5FYt8WftGhAt3fpXdk61aG\nL61GY8Ww47S65IY2vl29pUvsFQUPKEH6lBCZ19ZSaQYOktIb6pW9qoX5ZCZP\nTpIv7PSuDXJB7X5uC0cUQ0fnxTjKzMdm6DtMCp76LfKA0g/jqRcGubyn3isj\nh/B3S97onWRrIG3lKPt4/wxG7qm9NyF35jTDNRNewNupcqi+m6cno2ejsnSz\nwi0x\r\n=2SXS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHuvey3c7o8SFUVkABCRhUGTqICecceOqVtzEAxp1B48AiBYBaxY6/Bqz9735LdufjQEa8Ocu6rpUy0wIhUmtSYFzw=="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.b6106add.0_1596660559918_0.1037875469075018"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.ebb4c667.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.ebb4c667.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.1b44b43c8.0","@material/line-ripple":"=8.0.0-canary.1b44b43c8.0","@material/mwc-base":"0.19.0-canary.ebb4c667.0","@material/mwc-floating-label":"0.19.0-canary.ebb4c667.0","@material/mwc-line-ripple":"0.19.0-canary.ebb4c667.0","@material/mwc-notched-outline":"0.19.0-canary.ebb4c667.0","@material/textfield":"=8.0.0-canary.1b44b43c8.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.ebb4c667.0","@material/notched-outline":"=8.0.0-canary.1b44b43c8.0","@material/ripple":"=8.0.0-canary.1b44b43c8.0","@material/shape":"=8.0.0-canary.1b44b43c8.0","@material/theme":"=8.0.0-canary.1b44b43c8.0"},"publishConfig":{"access":"public"},"gitHead":"6911337bd0577b48c85e4d3502ed5111b12a7b4d","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6911337bd0577b48c85e4d3502ed5111b12a7b4d/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6911337bd0577b48c85e4d3502ed5111b12a7b4d/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6911337bd0577b48c85e4d3502ed5111b12a7b4d/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6911337bd0577b48c85e4d3502ed5111b12a7b4d/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6911337bd0577b48c85e4d3502ed5111b12a7b4d/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6911337bd0577b48c85e4d3502ed5111b12a7b4d/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6911337bd0577b48c85e4d3502ed5111b12a7b4d/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6911337bd0577b48c85e4d3502ed5111b12a7b4d/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.ebb4c667.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-a7bFt05/+LBih85AmF+qoqwYQ5T5NDNCTK/nVgnp9IRLhMkQttv9e3V1pdh78jhvVToxDr+m/bYpyDWwjtn+tA==","shasum":"440f09aab5bcf08355b9d49f66de16c8295e1fa5","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.ebb4c667.0.tgz","fileCount":16,"unpackedSize":264685,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfK0xlCRA9TVsSAnZWagAAmvsP/ijoD37Xaj+R4wayg3Dz\n2PaofAKCrYBRm1kjFsAxON3MfIgXQ7DJ+RYzQxAUcS2/YC5pQJlynsdtC4UB\nxbg6fyfrQwvgRKnkr9hdKLYfsg9/gdRUumVHVfGAJ0P1WUBFVEyL3biBBSiG\nBhVz4sN5aLgbUglNqxTR6qToQkf8LojEJYk88xNVMpk56CB+7+owQzpDCpF9\nlgZ89y0GkU5kN5H4mSwIdUkUM11AuWklCBwqswS+xdXkLUKg2FVgd0bYkq54\n1lYXblW59KvQEp0Suvx76KlL8jEf3WDP9JEbv2FnqtaScdT7CsKIrhfxDPwR\nusvXlVQEqr2dtkq1DgSQREBvJt1zjMNpEytMA+8J8+bHjc5pbBOWRcrXdX7X\n+zfGwib05WxeOL6nLpfmu40Nk4OAbOcmryr5izCIQYIrm/KQ5FTiHY1MMQX0\nzVRjfe8ou5oYW4b2aYpVm5r9pHL++6hCad9LtbUfPiFbfUKaNqUzJRrwG0gf\nmSf+HyWRuomGTiUZLaEKlwfLIVAmi5jOKca8GtXEwHLiwrZH833t41HDFjRT\nQZVoQn0t7gaONjg4Hi6x3ym5GhKI1GW5qGG56NoyjaUsNu0VmcVeA3aXwdPZ\nP/SgnlfZ8TyES4SNrL30tlAZXrBzMfSRorxJhTgQMCXibhzPv6YXwyQPY7xi\nfrnB\r\n=9APa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDTzBpwL03A7lwX21V71wibjfzxfRB4dXVN0fsd4l4nAwIgcN6FyKJgqJixzptjdDpC4jR4gPPt0x1lxncsxC7W86I="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.ebb4c667.0_1596673125355_0.5089038545065987"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.aa44289e.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.aa44289e.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.1b44b43c8.0","@material/line-ripple":"=8.0.0-canary.1b44b43c8.0","@material/mwc-base":"0.19.0-canary.aa44289e.0","@material/mwc-floating-label":"0.19.0-canary.aa44289e.0","@material/mwc-line-ripple":"0.19.0-canary.aa44289e.0","@material/mwc-notched-outline":"0.19.0-canary.aa44289e.0","@material/textfield":"=8.0.0-canary.1b44b43c8.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.aa44289e.0","@material/notched-outline":"=8.0.0-canary.1b44b43c8.0","@material/ripple":"=8.0.0-canary.1b44b43c8.0","@material/shape":"=8.0.0-canary.1b44b43c8.0","@material/theme":"=8.0.0-canary.1b44b43c8.0"},"publishConfig":{"access":"public"},"gitHead":"4d74632e3e1fce6fddaefd045c8f0b6f026b4e4c","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4d74632e3e1fce6fddaefd045c8f0b6f026b4e4c/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4d74632e3e1fce6fddaefd045c8f0b6f026b4e4c/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4d74632e3e1fce6fddaefd045c8f0b6f026b4e4c/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4d74632e3e1fce6fddaefd045c8f0b6f026b4e4c/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4d74632e3e1fce6fddaefd045c8f0b6f026b4e4c/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4d74632e3e1fce6fddaefd045c8f0b6f026b4e4c/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4d74632e3e1fce6fddaefd045c8f0b6f026b4e4c/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4d74632e3e1fce6fddaefd045c8f0b6f026b4e4c/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.aa44289e.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-ujqr2b9bExyrTZnOQUITdUETbfpjOcQrtIZ6atmL1V748lTRL8C5OcXtbMt7SchxjAbnmOOOl79yDORGzgmneQ==","shasum":"5158dd5c9b8ba1180d2ab82abb6f433539fb6187","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.aa44289e.0.tgz","fileCount":16,"unpackedSize":264685,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfLEuMCRA9TVsSAnZWagAAz68P/1g6skc27ngEuYCHYH8g\nQ8yjhYQ+Ri3VHAdeFW9hAH2Yi19EOun1aNA9H+0gySmNb3FBt28sh17Qv0wJ\nUsz4CL888eFT3r0hUig7T3mWYGdtwuUqD4mN0SBab+5Tnt3vNfDinRU8j4O0\nEehKHfVycEl/w39xFl4o1OGt2PEAEeO6F0t5Y6Jft5/XlYl2Yz9J1U3CgWET\nT+atFC01QqMvy0H1q9EdMH0pDGEC6or8tUdEUBSUjvpAPtXJEFAtu9vYDI0Z\nnwWnYtSQGyPwvdvGB9JTjVraCibXn/hC1DbQW/7K+qMpm4QAp680F57b7Luq\nERon+/idr/bNCuUtmGi9uHAGcMuxlbA9QDLLBl5pK8Z/Flgn0xy6k8I6F9f2\nxOKSf7AQR1K3M7WGKwXVzHWnotvr271WCPhhXuOufAU+W63uwXZUCSeRDb+o\nD6K3fCwOGnLjNvypTpkHDyD1coi9fVmHoof9ZIdsvXWvnydi3qbe0bbKZYfW\nZ+cqTEVbsO0h6bsOmAz7D0VWNCS2uNJ66vjHBLS+COTPbdHuWv3f6qarbuO0\n6yyE4vsBGpzpJwvqnYFWJkQstWUI8EE4/qckpgBYBL6dkQe+z25GOL9fGi60\nVChSUQTMdVt+y3ybco5I+lAl//F/IeocrU8Xub74znOFsDfonz0J67Z5jgqb\nw18Q\r\n=T7sA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCih72/y7hioYhdRue9Famvxoi33nGLxQmg438T4jmbfQIhAORUe9ngVUjpjLhzSudN9+r5rDDYtxgP9HmTbLcV0s8F"}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.aa44289e.0_1596738443756_0.7453232914676065"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.e6b0816b.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.e6b0816b.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.96a640534.0","@material/line-ripple":"=8.0.0-canary.96a640534.0","@material/mwc-base":"0.19.0-canary.e6b0816b.0","@material/mwc-floating-label":"0.19.0-canary.e6b0816b.0","@material/mwc-line-ripple":"0.19.0-canary.e6b0816b.0","@material/mwc-notched-outline":"0.19.0-canary.e6b0816b.0","@material/textfield":"=8.0.0-canary.96a640534.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.e6b0816b.0","@material/notched-outline":"=8.0.0-canary.96a640534.0","@material/ripple":"=8.0.0-canary.96a640534.0","@material/shape":"=8.0.0-canary.96a640534.0","@material/theme":"=8.0.0-canary.96a640534.0"},"publishConfig":{"access":"public"},"gitHead":"b80bf3f3363af2f1b704d5fe2fe2852cd416b902","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b80bf3f3363af2f1b704d5fe2fe2852cd416b902/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b80bf3f3363af2f1b704d5fe2fe2852cd416b902/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b80bf3f3363af2f1b704d5fe2fe2852cd416b902/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b80bf3f3363af2f1b704d5fe2fe2852cd416b902/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b80bf3f3363af2f1b704d5fe2fe2852cd416b902/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b80bf3f3363af2f1b704d5fe2fe2852cd416b902/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b80bf3f3363af2f1b704d5fe2fe2852cd416b902/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b80bf3f3363af2f1b704d5fe2fe2852cd416b902/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.e6b0816b.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-p6x9rKnKWvhyaWvNevT2N2NFHQ+Vsu0J84uHpXeuKqsMWUdldhZ8KPJRKjCFKLOsfiY/gX0OF+k6BpXV1FbHeQ==","shasum":"9392b358a71a77f1e216df90f7ab17cb306264d9","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.e6b0816b.0.tgz","fileCount":16,"unpackedSize":265030,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfLaDgCRA9TVsSAnZWagAAB38P/jjNtzAIHxPi9W4pPCdY\ntsK6S7DJTy/0wQZ/c/6xFPPBQt/ErgqMj1T4pRb1cTkesqCNyZ3CidiiEPZc\nEdu7ZJo3ycbSLAdfHO0rfxf1GsZ2sKnlTnJhUwjcwRdjWikA7rqR+9O0t8Oi\nGHKE8ha4AdMbfhj9vl9Hlt4t8e+9tEmDIjpCoKdZSRBc2P5DF5Dmkhy11cYJ\nZT6vhbpFjaiYETeL8n8gaMwQLq7vY311Bvrl/l9HrvsTHpCVTbyATZKw8VAP\npj+18w1uxDc0tQ1N8kVTw7t/gvMJZo93fxD07GhWuZ0XZ/iJjk2IaaMCZ0Hn\nywiPbVqWOVG23fvJjSAYtrK7z6KWZtKpQlFzwSdYkd11htsefg29MPWztClH\ncbq66ewpeD2CMqFsL/XwHoEoJfUkr9X1fgvvmuBPhB5LTLU3g0bDvIXFBEof\ndjgxVruuBuJsxLvkYlM9xSpkgTE5stXqRdOUA38tSXQj4/BBqCICEDhGXziu\no+zswymKGqT3C+33+UDPIuHTou7evVy6WeZf9aaobcZRNRZYK2VupXNn8El7\nRmdszJ3yN0lPzPlhia3LlJIKuJtlCZPUeKgTMH9ZIpL3cxRMmDG1Ql8HbvCZ\ncPbV6okJEiQFx/IG6nYBENbbZ+l8UooHT4iAYSB5z+WOwC/juA5zneNbZrRh\npDO/\r\n=1dV1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIExpD/wixelSb1tADC1AR0SdiEqg4dWg2C7NLoxVhlYpAiEA3ZZwHk97AZBUuaSz2FgM56pHSjFdXNo0vic3KjAn5hw="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.e6b0816b.0_1596825824103_0.5922757953043958"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.96d15938.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.96d15938.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.96a640534.0","@material/line-ripple":"=8.0.0-canary.96a640534.0","@material/mwc-base":"0.19.0-canary.96d15938.0","@material/mwc-floating-label":"0.19.0-canary.96d15938.0","@material/mwc-line-ripple":"0.19.0-canary.96d15938.0","@material/mwc-notched-outline":"0.19.0-canary.96d15938.0","@material/textfield":"=8.0.0-canary.96a640534.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.96d15938.0","@material/notched-outline":"=8.0.0-canary.96a640534.0","@material/ripple":"=8.0.0-canary.96a640534.0","@material/shape":"=8.0.0-canary.96a640534.0","@material/theme":"=8.0.0-canary.96a640534.0"},"publishConfig":{"access":"public"},"gitHead":"6e91207d87648ea038ff3d435537ba7b2014ec19","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6e91207d87648ea038ff3d435537ba7b2014ec19/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6e91207d87648ea038ff3d435537ba7b2014ec19/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6e91207d87648ea038ff3d435537ba7b2014ec19/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6e91207d87648ea038ff3d435537ba7b2014ec19/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6e91207d87648ea038ff3d435537ba7b2014ec19/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6e91207d87648ea038ff3d435537ba7b2014ec19/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6e91207d87648ea038ff3d435537ba7b2014ec19/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6e91207d87648ea038ff3d435537ba7b2014ec19/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.96d15938.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-/BHi++DTNUz1R9d21IVyxzMDFKQPV90U88vKQtDclQQkAPbOj4oHazFn+zxrpdHmaq7kKJ1aXdNJFJECiO0DBw==","shasum":"20b47eba6b2d06587f3f0460f3d71b1dca28da82","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.96d15938.0.tgz","fileCount":16,"unpackedSize":265030,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfLbmDCRA9TVsSAnZWagAAVvsP/i8/O4QbahuzfbdKELcF\nKxrhBghRsMDD01i8MQeJ1BWNwdG2iRavJohTab9DyUiQeV7lC4tbGdj/eWRG\nZcaP+4TbxQXIoZeGtsqlHtE05aqSKytZhFvKpuoyVKJO0H4UdHjwcngo/znr\nlK73NlKwsp7nqvUEIUEYNaKojfFGV4M1RUUfYps1tGCJI8MKO3+2J8huyYQS\nY4aJmT89mYpE83X5/W6UKXtL76zAXFDlT3B8synF/y/pfTnqBozSMa0R/AkF\n+yPQRruGHczLaBTC3fy6jRwnOg/Ml6Y3O/AyCKyVrncaVyJ5DjjtOk0X6bik\ni+1q464vi+vy5BEv5kKVua4gSdFbpBDnwXvvxW5XWosKNdx+yySYSXuIx4et\n/+NEoLOUcp0+F0iwMoo3wbWy2WaSm31TdAwSesSuSA2bP46PkmtxqgaGo/v9\nl3ggjpgD4yE/RXgjf9dR26/bW+AGuy/B+qzjeM8Maa0jbLVDxJnrum2m2wLb\nanihqHwqFMMfzYJ40mv/KRH7d1i+2MTHPo3+OCKNr1tq6JpdTziEQFEYsM6l\n9bwy8I98rYXBeLdvHMuB1Nweii7/dXe34GK6r1MlU4dhSbNUd9JYS3RarUY5\nTDctf14goutfcZ2qaU/9AOM8kuLggKVawVYPTD8Us5PNgnterVSYKyFbcGde\nwNWI\r\n=SiYh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICte6FzdlKY1dSnEiMlYCXww0dRjkaCkJ+FfqH86tHYLAiB0jFdHZwaLiWUpIASlByl7IQ9YgE0S8rTE8h7TwFrilA=="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.96d15938.0_1596832131089_0.7853565894758499"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.9d991c8c.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.9d991c8c.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.96a640534.0","@material/line-ripple":"=8.0.0-canary.96a640534.0","@material/mwc-base":"0.19.0-canary.9d991c8c.0","@material/mwc-floating-label":"0.19.0-canary.9d991c8c.0","@material/mwc-line-ripple":"0.19.0-canary.9d991c8c.0","@material/mwc-notched-outline":"0.19.0-canary.9d991c8c.0","@material/textfield":"=8.0.0-canary.96a640534.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.9d991c8c.0","@material/notched-outline":"=8.0.0-canary.96a640534.0","@material/ripple":"=8.0.0-canary.96a640534.0","@material/shape":"=8.0.0-canary.96a640534.0","@material/theme":"=8.0.0-canary.96a640534.0"},"publishConfig":{"access":"public"},"gitHead":"b96115b555701f0a2fb8299279aa9dfd1bf6b4b6","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b96115b555701f0a2fb8299279aa9dfd1bf6b4b6/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b96115b555701f0a2fb8299279aa9dfd1bf6b4b6/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b96115b555701f0a2fb8299279aa9dfd1bf6b4b6/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b96115b555701f0a2fb8299279aa9dfd1bf6b4b6/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b96115b555701f0a2fb8299279aa9dfd1bf6b4b6/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b96115b555701f0a2fb8299279aa9dfd1bf6b4b6/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b96115b555701f0a2fb8299279aa9dfd1bf6b4b6/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b96115b555701f0a2fb8299279aa9dfd1bf6b4b6/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.9d991c8c.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-exoNSNQhbEusysKuO5eVpYkb1EQVuyw7v7l/SrQsvHn5d3C9ibP86l2lofJpxopyNz8FLl3WvLoF3eeOTezXQw==","shasum":"4a82534175fd122fd7106fd9010d717f04c1e9e1","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.9d991c8c.0.tgz","fileCount":16,"unpackedSize":265030,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfLdDZCRA9TVsSAnZWagAAos4P/00HcEtFphS1sH4OGaD3\nuQtQrS+V2zdgIBFtLfykkA2ygSoX6tXoWeaWSEmsbmnmKrpcoo3rqRSz51Q8\n+akv3qkis2bpp448FRifd+gy7YgYQOc/mnDH4JOCrAXYyjbeYwcasyt+ET3E\nAm/QxOttYVM2DEDL9n3eTmegV38RCVJxhVl3Fzsbv0DYnCbtwiH8YgcMNArT\nAYJmvo3pVXls9r5A0D/fAsuDoxrIwCKORnYIGZC31u8X9oAAFB85Q6S0RMzE\nJO48JnyTvIYv9B3PCCiK+TMeZppL6BED1z4l5Vf6Ys3BZgkJW+mfkgdUjaT6\n2k3Sdu/W+CisbpYalhLbFDXb4FywBAHIJVu5vd/eGFJxG4U03GC+U0RDRlzM\nauTfCfCvYvdK6qWdgIUDlC0gipl7OEYURxDy2hMKwSbBAb3209iI2aHL4/eM\n4wP6MiR4FrOsJQZQHqPtqn7ML/QNc/S8JODCByBRXlVvl/fadhVEJ15l1R1u\n3Xv3lsLkNp4mBrTAFDSV1dtTkliKOnBdC1P3maMlh5uF/HxI7Jgm/2XT4jGJ\nyM6mpTI/WqcJ7cx4rDvUFGEZufLmUvWC2CVxAszlonVH8vD1TqSj6tSQQuzF\n6hLScAhs8rUs2eve/W1x8nFLputyG+iYv2NH644KYdmPdp4TQcqHIzcN5C9U\nMkry\r\n=yp5B\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCv0vv2sd9E1yztRptUuny1dLoW3tUbdOssZnnmvael4AIhAN+dSRbiHfvSnS46pGvtcmSLiXhesPnr5FM2P0/ywhx9"}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.9d991c8c.0_1596838105384_0.030564551101510906"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.13bfbd72.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.13bfbd72.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.96a640534.0","@material/line-ripple":"=8.0.0-canary.96a640534.0","@material/mwc-base":"0.19.0-canary.13bfbd72.0","@material/mwc-floating-label":"0.19.0-canary.13bfbd72.0","@material/mwc-line-ripple":"0.19.0-canary.13bfbd72.0","@material/mwc-notched-outline":"0.19.0-canary.13bfbd72.0","@material/textfield":"=8.0.0-canary.96a640534.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.13bfbd72.0","@material/notched-outline":"=8.0.0-canary.96a640534.0","@material/ripple":"=8.0.0-canary.96a640534.0","@material/shape":"=8.0.0-canary.96a640534.0","@material/theme":"=8.0.0-canary.96a640534.0"},"publishConfig":{"access":"public"},"gitHead":"801272b0ef15e1f90e0ba47c6a8d185052f8c48f","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/801272b0ef15e1f90e0ba47c6a8d185052f8c48f/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/801272b0ef15e1f90e0ba47c6a8d185052f8c48f/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/801272b0ef15e1f90e0ba47c6a8d185052f8c48f/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/801272b0ef15e1f90e0ba47c6a8d185052f8c48f/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/801272b0ef15e1f90e0ba47c6a8d185052f8c48f/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/801272b0ef15e1f90e0ba47c6a8d185052f8c48f/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/801272b0ef15e1f90e0ba47c6a8d185052f8c48f/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/801272b0ef15e1f90e0ba47c6a8d185052f8c48f/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.13bfbd72.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-TDt7vQRGRHMNSD53r5Uz5wbaXKtLaSGHpmF6hcsoXjqw4N+XUHUAOw3u1har5aE2uNCgsqG4UJSBlhelSESMYw==","shasum":"d00ee1ab5c1d7a9924ee9061ff9f4fafb14f597e","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.13bfbd72.0.tgz","fileCount":16,"unpackedSize":265030,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfMZ+aCRA9TVsSAnZWagAAJAEP/ij70HT+5mzhDcZmA6qL\nVGEtz89IhrRKfS4iHMpOBel9WFdhVxYjHgoMWqyzf9xZZ90QYy2aS0/BwoT7\nWiAwA836ExBiby7WD5jrV6YVPcQVgngJoqKgFgYLarlY4iH/YOz2ESRL7one\n7j2XWsoDAv+748neMPT2ioGm1I32+gub2UGjUxtb/go8mwn5BMD0dX4mTH3h\nWRbRv/M/EMKJC7nIX7+szcMAByYtAq9V3OQuKIwd52tU23sp5DuTFv2hLJBb\nTxCft+KdG170BAvsRdFVqSueMMCWtlXnyj2yGdyVa9A3noHmJE86WAqNILq0\nT2jF6oCHm22SP0Wee/mvpv1tgKLllPgbMdDbVuYxXD9iJSYMN7vQN7IYbWYd\nJsn3UmUNqnxab2ctMMRZ3k8YI9PPqdW41Nz39D9T2SapsIghJPqFA+K0vXxg\nWzYVE7NDe4cLyRmrB7bTLqvOGsWWlF6ko1z450TL7l3WvrOi3XQL+rn01fSs\nBLMl+b8YC2Xl2Ys0/ez+vEVyZvX7IakHb1hlD3gm/m7Fp7wDWwEtYheTCxDQ\nxMAfwdydvZlqgRDQo+JeF5qqawydqqOJz7O1nrP1aIqJvc+TSXBP/e22elV1\n5cSH9wY1zQf0IyyzRYvZKfxZf5GJlGK1vVwhTEtjdMW/pMtdZxjgyagfGbdd\nDQg8\r\n=Fqr/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDYPkTOWCRvULs1hxrzs9pmkfz4vtq5E8eepEE/4D3cEQIgLLb1bCslsiBevaeyg2v6aNwkFSTbvVi5IGILf/MgI8w="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.13bfbd72.0_1597087642394_0.3915749330966516"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.30b1b258.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.30b1b258.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.96a640534.0","@material/line-ripple":"=8.0.0-canary.96a640534.0","@material/mwc-base":"0.19.0-canary.30b1b258.0","@material/mwc-floating-label":"0.19.0-canary.30b1b258.0","@material/mwc-line-ripple":"0.19.0-canary.30b1b258.0","@material/mwc-notched-outline":"0.19.0-canary.30b1b258.0","@material/textfield":"=8.0.0-canary.96a640534.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.30b1b258.0","@material/notched-outline":"=8.0.0-canary.96a640534.0","@material/ripple":"=8.0.0-canary.96a640534.0","@material/shape":"=8.0.0-canary.96a640534.0","@material/theme":"=8.0.0-canary.96a640534.0"},"publishConfig":{"access":"public"},"gitHead":"e34fbf2f01b3504b83592cfdb8b30914bad24498","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e34fbf2f01b3504b83592cfdb8b30914bad24498/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e34fbf2f01b3504b83592cfdb8b30914bad24498/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e34fbf2f01b3504b83592cfdb8b30914bad24498/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e34fbf2f01b3504b83592cfdb8b30914bad24498/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e34fbf2f01b3504b83592cfdb8b30914bad24498/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e34fbf2f01b3504b83592cfdb8b30914bad24498/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e34fbf2f01b3504b83592cfdb8b30914bad24498/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e34fbf2f01b3504b83592cfdb8b30914bad24498/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.30b1b258.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-pe5g1+qMVK1i8iyhE4OXuyknil08J0FwNzCowHXatzwHFaDvg0OOOup0Ie6NfUIPOPcp5XtgxCy1HI8pgw1F3A==","shasum":"c0c800e2a6a592b0301956f2da1d9ca1b6f57c6d","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.30b1b258.0.tgz","fileCount":16,"unpackedSize":265665,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfMajhCRA9TVsSAnZWagAAipIQAIpFfQIH9L/GuPlzkBXs\nyMaJgp9ImHDss8NrCnVwG+uROxATFqm0QnF//B35a3neJleqeutB4jVNn5Sv\nLtHzYA93Kfrn11RlDFGkbgH74lGhua3gU/5eQ8YYBcr0TP/GJjT6WayzK+tE\n0CqGi7YOLORZyIDiwKW98sHoDkcs9x+zIn/Hc0uBKDOwMiffWZpcEwCBe0ha\nkAa0NfMO6dGwi8OXlRdJlhEfL8ogrwah2Mg8eZ9Y99ZU77wRH+1qtEXYuA/F\nUR1Sn3z01jGn5FMamSVxKxrlv3bsIPuLXcvh5X7b1gwYnVz7JhAScwIGExpC\ntLj+kWXME6DXe0gbQWnpv8s2fyjNMlhyH8Fpe/0VFoRwziA+2+6DnWvqMk+A\n+cL4xCvsMzNfWO3fbPNYrStZ4HDpsbqK3I+G1fbSAYa99RnHD782LJ4jwhHY\nZEcNyBqQlyAhgZ5em1elafjfhF3CP0tR3CCAQlylfwgwp3SaESoyWGx8/gX4\n8TUciIOY/mbLY+al1MuqSD7b8OVde4s6D919lk3eHANWKeWZs1F7Aq/L6miv\n+WC5qRTHNrLnCvD51Kq/b1PAL0jReLchx5dWx47xsB4Vo0DrQ9oeHGGPeM1r\nRZ3FstB8JsWh7bBF35IQlW+3dZG8UVZgcjdHHsPznF/dlHjadBM7Uwd+vvT4\nNbrA\r\n=3nqY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDFJx8OWYBG/AtEaNZoGzk+bDVTU7Qc4PzhdLcB50157AiEA9R9aXfp9gEBDN2Sh5u60xWNMtYe6ADZPpMQRlSdQx50="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.30b1b258.0_1597090016645_0.8487175196464427"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.1583e263.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.1583e263.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.85a5272df.0","@material/line-ripple":"=8.0.0-canary.85a5272df.0","@material/mwc-base":"0.19.0-canary.1583e263.0","@material/mwc-floating-label":"0.19.0-canary.1583e263.0","@material/mwc-line-ripple":"0.19.0-canary.1583e263.0","@material/mwc-notched-outline":"0.19.0-canary.1583e263.0","@material/textfield":"=8.0.0-canary.85a5272df.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.1583e263.0","@material/notched-outline":"=8.0.0-canary.85a5272df.0","@material/ripple":"=8.0.0-canary.85a5272df.0","@material/shape":"=8.0.0-canary.85a5272df.0","@material/theme":"=8.0.0-canary.85a5272df.0"},"publishConfig":{"access":"public"},"gitHead":"e9ee447b02f2731c33f126f2c3d32bc3f2808125","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e9ee447b02f2731c33f126f2c3d32bc3f2808125/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e9ee447b02f2731c33f126f2c3d32bc3f2808125/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e9ee447b02f2731c33f126f2c3d32bc3f2808125/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e9ee447b02f2731c33f126f2c3d32bc3f2808125/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e9ee447b02f2731c33f126f2c3d32bc3f2808125/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e9ee447b02f2731c33f126f2c3d32bc3f2808125/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e9ee447b02f2731c33f126f2c3d32bc3f2808125/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e9ee447b02f2731c33f126f2c3d32bc3f2808125/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.1583e263.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-E0zhZoU4mRls8y2RCF3H7ZN/GZGPqNOC8RYuf+IHB5dnBDI6LpxjWlIjPItSDHyTu5lJlHG6GwODo155jF8qEg==","shasum":"c6577db8e6af8ec6d6c0178df52edaff9c01f661","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.1583e263.0.tgz","fileCount":16,"unpackedSize":265665,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfMyVyCRA9TVsSAnZWagAANSEQAJZteJ7YcWqW1pvVeOtX\n+vXc+4vIvAIE929wWtYQDfKMcQWbDqKOGlBzdapxA/NW9UBP6ltGizwV3F3J\nbm12og2GeBsHEQyU9Fe36zw5KWq1qH+djdLgjlNtvAnEGHtAqTOv9KSrz7+1\nLeYK/bvW9/UuV+fcIx4Pc+ftr0d/S4EooRvIkZjjsdcireLDFnGQKajs0UDU\nYXUOS6RcNwrF7UK2GoFATrX/nn8Hx4BOFtLDWyC3J5KL6yhN/u1aUrO12Q7K\nEhtaBQl/Js3e+lO8iaB6s+OAqkrb1zZtK/pNXHzIIIksrpRSToX1kCPQLc5e\n4anRlVpZuZGUnkxx3gQANFryZsLIc8ArjV1zf3eGcz8XJGO/JYC/nEsGyoS+\nz4yzn9/+ZjZAiYd4fLDokcjA2GWQ26nGKT5oRsZ5EsfMONFVuR4m4fyqhm5I\n+RkV5CGpWd7sch6aoX9vbe19N5tp+zT3eF/y85WeNVcD9KTklzvKv1xwqoeW\np917c5rsBXzCNnvu9wpcKap2Qpbb4O5niL+DaPp1HiToel52DEB7EiwhEiUg\nbFFsUkpRZNrTRTLrgPJiRSNSn5AYGaMVfKfjKJUP+kmtvnMCv2ONDqdvwZFo\nkHTzHiwX3Vj9X0kcWXCTuCnt1/rRShKwM4Tkd/PkmDET+K2TJQ3gxUWk7Lj3\n+ggY\r\n=QZDE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGpjnx4m4wqQd5jQQs7GfirVZZB7w0w08f+3cWU33mRIAiBoqe+Rn+xvZZBh1WQELs6e7v49693tdpHpsfDh07HUgg=="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.1583e263.0_1597187441516_0.6089745916762179"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.fefb1a93.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.fefb1a93.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.85a5272df.0","@material/line-ripple":"=8.0.0-canary.85a5272df.0","@material/mwc-base":"0.19.0-canary.fefb1a93.0","@material/mwc-floating-label":"0.19.0-canary.fefb1a93.0","@material/mwc-line-ripple":"0.19.0-canary.fefb1a93.0","@material/mwc-notched-outline":"0.19.0-canary.fefb1a93.0","@material/textfield":"=8.0.0-canary.85a5272df.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.fefb1a93.0","@material/notched-outline":"=8.0.0-canary.85a5272df.0","@material/ripple":"=8.0.0-canary.85a5272df.0","@material/shape":"=8.0.0-canary.85a5272df.0","@material/theme":"=8.0.0-canary.85a5272df.0"},"publishConfig":{"access":"public"},"gitHead":"328a8921a50cd0f162f89703f12a9e58406fd111","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/328a8921a50cd0f162f89703f12a9e58406fd111/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/328a8921a50cd0f162f89703f12a9e58406fd111/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/328a8921a50cd0f162f89703f12a9e58406fd111/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/328a8921a50cd0f162f89703f12a9e58406fd111/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/328a8921a50cd0f162f89703f12a9e58406fd111/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/328a8921a50cd0f162f89703f12a9e58406fd111/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/328a8921a50cd0f162f89703f12a9e58406fd111/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/328a8921a50cd0f162f89703f12a9e58406fd111/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.fefb1a93.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-DTRMsu26yYJ9je1bU5AKhPvDSIqK+V5/NvQbLZzfq/euwPFrAF6OfGpwKuZzpiH0oREP3muRr31EkMnMO8cQgQ==","shasum":"bf5ef47de078a71e3c7dee7edba0f8f1933dabbc","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.fefb1a93.0.tgz","fileCount":16,"unpackedSize":265665,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfMzbjCRA9TVsSAnZWagAATDoP/jx6mlsI+mhdcAx5cp2z\nj5FfP2n624jcx7bjd6GuB1cyQh2Nc/yE/YtA95YceaL0KZ6dI6Dypm588m98\n2DTijB8V573A34rYrnrg6gXqhfaTs/llho99QX8kPo64tz/GjPP28IXXFhBp\nr6tfIzVAqGM16JuynZtDteIFaS5srUoPkWQVzRqLAKcfmuOmrc3T1JJiZxTN\nFvSkG5LgWNXkeTnok9iTtMEU7LTUG2BIgjUlvP6w0y9nQv05TWVIhvtDxQD8\nZVU3utUz2aZuQtgq6k759sre2aAwV542avIphrnzavFgruoKlZNfGQy1VFZG\naRlAw90SafMIAqLc6o77VAt+231B5eSGpjRPd4tLsu1KIRp45CJ6pE/Gc+Iy\n6WZJj8hVfnj/hUelDJyTaNA6NA6LkDdDeNWwWaFnVSGMJ7grimnPWROhxf6v\nrswW3rfNR6r1yPAwbk9b5L4PTj7cV+Xx5TIZz2Pb7IoOf8VXgQZhvg44xrz4\nKd4jH3SOpQ891hZ0TWNuircgnS9uo7vprxYJH1YgWVJZd7DOzfvXhKZ5MN5T\npCWrlbEpYhkZKxOdLLedMe2KDPsqrlTqdG/qFoOkbmqT3sGwETBozeMspiH0\nTR3kt7ViEp3BnEQ1zcVDT0vvg/ibnOlR1Sj/YuoXgpNdcvAToKRGqrvbodSZ\nBnXk\r\n=eQjU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDnAQZ4VBbFfnAgKRulojXWekIk4DHXuokagRGOkWMzOAIgJ+OX9/Y1d7dqAG7m+vGTdEdXwQawf8zcV9dNrNY1NJ8="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.fefb1a93.0_1597191907023_0.9998697479307417"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.1ac5b9d4.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.1ac5b9d4.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.85a5272df.0","@material/line-ripple":"=8.0.0-canary.85a5272df.0","@material/mwc-base":"0.19.0-canary.1ac5b9d4.0","@material/mwc-floating-label":"0.19.0-canary.1ac5b9d4.0","@material/mwc-line-ripple":"0.19.0-canary.1ac5b9d4.0","@material/mwc-notched-outline":"0.19.0-canary.1ac5b9d4.0","@material/textfield":"=8.0.0-canary.85a5272df.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.1ac5b9d4.0","@material/notched-outline":"=8.0.0-canary.85a5272df.0","@material/ripple":"=8.0.0-canary.85a5272df.0","@material/shape":"=8.0.0-canary.85a5272df.0","@material/theme":"=8.0.0-canary.85a5272df.0"},"publishConfig":{"access":"public"},"gitHead":"33bc5db0b752b7e0d3710150fbb0449121619692","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/33bc5db0b752b7e0d3710150fbb0449121619692/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/33bc5db0b752b7e0d3710150fbb0449121619692/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/33bc5db0b752b7e0d3710150fbb0449121619692/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/33bc5db0b752b7e0d3710150fbb0449121619692/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/33bc5db0b752b7e0d3710150fbb0449121619692/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/33bc5db0b752b7e0d3710150fbb0449121619692/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/33bc5db0b752b7e0d3710150fbb0449121619692/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/33bc5db0b752b7e0d3710150fbb0449121619692/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.1ac5b9d4.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-P5YMcv/3o721qhJBK+S9FBHXsD6/l3dlwiKf54KqwZ5KrQFmQr85jjNrrmB36SaajIGGX72QLUTco93RNKj5vw==","shasum":"a524f333d9930235fecdd5815a87e9ef7ec4eeb3","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.1ac5b9d4.0.tgz","fileCount":16,"unpackedSize":265665,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfNDSNCRA9TVsSAnZWagAAaKoP+gJSpXRQvsLe7q82zc0Q\nhqqenmvGqbLvnAznSGhNRuQwWxd1VksI2Nne77IjTDKhnMA3M0A1i6H1TzGV\nGJv9BsDMgrZ1OBvhLsixHpo+nGnaE3i2+MaP3rkd4fhZPuIAv5oF1y82Vm2x\nZmP7H16RzN5o4Fv3KVbQzGNmsB2ZE/bf5Deu2tf8KxBkntihW1NqrFnjFeZg\nUVDibe/bxKcWsUzhLATUu3FuzJO/gfZIJPTt0gJvgIqAD6ZwqkfJ/zEextPR\nUfBIpWLQzzHlx2uyFpVSqpBLAMhBq3t82rPpnWx6IvWA0zRLtFG3OEZXkZp1\nWtuHMw5GHIE+60U9LBrBOSRiGq2kFH4efKZg55xRYtXxt+ovagvlsQXzeWU2\nVc/M8Sbj1cGXp884nbqs12iGITuUzu6PMXRzzDEjYI1eCON7S+GEoBMoD8AT\nNbdULvEo/VOmMGTxNa7UeRrF+Tv29q5O2zICSmdn0cORI3T+VU1/W9Sve5ea\n3k3yQuLzi3VjaoHFavscYyLtgHo32CAbSQtD1A7Rm4o14jDKo4jpcNi9wrut\nRqLYxGE/iCC9M3mnZR13GsPwlOKw+foR7ctlBaxUDdX5VfqxIBCy4G8psfjA\n+1PQh6vwm7txn+O1ooKPgAOjEz/Cq0HgO8ObDE33DSYhSB4Av1rquLQmFPYA\nVrTW\r\n=2rnU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDgab39PGUjngRa3lkbOYkydjWkmpQJDSFVHKRa5cM8iAIhAOUURK7j47ATa1Sn516EX4HPvJTqwbNO+h2c1OKteDr3"}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.1ac5b9d4.0_1597256844808_0.26197909662451013"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.f17f5052.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.f17f5052.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.85a5272df.0","@material/line-ripple":"=8.0.0-canary.85a5272df.0","@material/mwc-base":"0.19.0-canary.f17f5052.0","@material/mwc-floating-label":"0.19.0-canary.f17f5052.0","@material/mwc-line-ripple":"0.19.0-canary.f17f5052.0","@material/mwc-notched-outline":"0.19.0-canary.f17f5052.0","@material/textfield":"=8.0.0-canary.85a5272df.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.f17f5052.0","@material/notched-outline":"=8.0.0-canary.85a5272df.0","@material/ripple":"=8.0.0-canary.85a5272df.0","@material/shape":"=8.0.0-canary.85a5272df.0","@material/theme":"=8.0.0-canary.85a5272df.0"},"publishConfig":{"access":"public"},"gitHead":"837a87ef49533f905c92ab0aa9faee12e51ea3da","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/837a87ef49533f905c92ab0aa9faee12e51ea3da/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/837a87ef49533f905c92ab0aa9faee12e51ea3da/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/837a87ef49533f905c92ab0aa9faee12e51ea3da/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/837a87ef49533f905c92ab0aa9faee12e51ea3da/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/837a87ef49533f905c92ab0aa9faee12e51ea3da/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/837a87ef49533f905c92ab0aa9faee12e51ea3da/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/837a87ef49533f905c92ab0aa9faee12e51ea3da/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/837a87ef49533f905c92ab0aa9faee12e51ea3da/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.f17f5052.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-qTrCRZ6ra4+shAqtkdRdMeXNpIlrjTip1DcbfgBYHoc9jfalv+v4FxEErc1CtankeQYKyjwC8YqBW5lpkyMIBg==","shasum":"aa4daedaddad0a22b3838e0dd17c9d77623eccc8","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.f17f5052.0.tgz","fileCount":16,"unpackedSize":265665,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfNXT3CRA9TVsSAnZWagAAF3YP/2fLEsvhGg44MhwmQFL6\n9SS+43F8T6rZSb27ogFAaN1O0NV6OM9mEfMc8PEGXvg3XWJRmMp0tliUKjft\nd51o8Qx61TY7Lp2U873hGZWIKF9jgCqsQLFY08LCnwgI6FQ4P1dPfEmfmoL7\n28wA+HPuZmTV6DKGqWZDJcsQUzyWnUkyeSmXaTuka/g06yTftXyapZ1rlNGD\nOlpWQdh+LeHLBq8SLVNFQZTqCbbwVey/AuTsDof0k/A9Me898TZhbXWk0akp\nAtvaMbGsnoyZCj9PKLKhSDurQYyycwm95EsJ4cB4u2LJqEcyACyZE8F7EaRg\nN48hQevFce/5f6Wdl2NAFUcgYATrEBbjHiqYKvrlrIkfCv4ya2uo/idhjSeo\ni2v5RTu/NzEx+EF5uWzmZKuaNLUy8vk7+E3c75zyXznIsWKq2Nv8tVXZfbqf\no23lxVZsOKjA8O1ORpLVap7R3rk+bbOIhK2juh+2m3NPpdSASlSe0f2T1/C9\nhCp4Ld34b6BRc8hytuvWPDgB12dQfTTXY1MAWi0r6eIFLXapMtRNt19X4JPO\neScrZX8BIk5VzYxm8ghIar/HBtNNV8P+Q1lXNDJwnFUxDSIKSK0w/H3gyzAT\nX7xLQc6Qq6P79M8uW5582+v6rDwStaeGaKUqZFYeOTQKwZ8+XGjAf5nanb8I\nRr47\r\n=fHf9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICX2M1bEoSgCnrSLlsNGMA8/SxbYQkhnENRbKrKqljp/AiBi5/YfL9lnC15eVshWxqrAyFmMnLFbZ65/4/iIl6OajA=="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.f17f5052.0_1597338870943_0.11165757129634746"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.80b5d20d.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.80b5d20d.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.a1dcfe97c.0","@material/line-ripple":"=8.0.0-canary.a1dcfe97c.0","@material/mwc-base":"0.19.0-canary.80b5d20d.0","@material/mwc-floating-label":"0.19.0-canary.80b5d20d.0","@material/mwc-line-ripple":"0.19.0-canary.80b5d20d.0","@material/mwc-notched-outline":"0.19.0-canary.80b5d20d.0","@material/textfield":"=8.0.0-canary.a1dcfe97c.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.80b5d20d.0","@material/notched-outline":"=8.0.0-canary.a1dcfe97c.0","@material/ripple":"=8.0.0-canary.a1dcfe97c.0","@material/shape":"=8.0.0-canary.a1dcfe97c.0","@material/theme":"=8.0.0-canary.a1dcfe97c.0"},"publishConfig":{"access":"public"},"gitHead":"2183b66216f3cc82a57427b3aa805795f18e0925","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2183b66216f3cc82a57427b3aa805795f18e0925/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2183b66216f3cc82a57427b3aa805795f18e0925/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2183b66216f3cc82a57427b3aa805795f18e0925/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2183b66216f3cc82a57427b3aa805795f18e0925/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2183b66216f3cc82a57427b3aa805795f18e0925/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2183b66216f3cc82a57427b3aa805795f18e0925/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2183b66216f3cc82a57427b3aa805795f18e0925/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2183b66216f3cc82a57427b3aa805795f18e0925/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.80b5d20d.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-yPjegcZAYPOqtskXFtJQoZ7vF+YvaNLCpxjpE899ld3Q+18eyOxYxxUGlrZmSjxDfL+eCMb4KzY+aFXyo62A0g==","shasum":"e6699ac20a36fd4fa1cf6c73af45e8ca2a0794f5","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.80b5d20d.0.tgz","fileCount":16,"unpackedSize":265665,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfNYOrCRA9TVsSAnZWagAA7PcP/03rxqGTtHG4/MaWCT4b\ntIg7JoYQ3aln+BXZfXQTqnwCwlJizhcTf/zDLLqhYEFQiSWrC+pxA/WbyJFH\nCZbOIFgWEwUYS4uhmWuzAKcjyvdh2muzVLUESZb+GjWBl8qstZNOWmEux9mP\neDKZQQ0e17fJkUu/03Ou/GBYmU2sIkHyAbYCI3FQeuXJ0Js/Py6VDwn15TfY\nVt/SgdeE7LVv3OjwjOZPlEEO+3IcL6fqu2XsXKvuvA84SLJTwqE0tsuxl47A\nfe1KElURdklX1yf0jcjjcguYdf7ImNJtASt+pz9dUZ6lmCkC4ydDDBkY2Gln\nvatTo5AFoNOOYWkwhW7y/MWyLGs/G/5gdw+ho+hfP3k5IsPYnHslxVgvlH2Q\nZ/O6q06Wf+yTKkEQJ4QgnptxD999W5kgP3iD0JUCwRxVy+ipzMy1KcmrjWNp\num/oK5c0rNPtdFYWTQUGRVIgZFQRvX+cA4rmJB4qgSM3k7P9WI4Qs6Wmpvie\nA6sys5605lkd+PDVZ7SgAiC96XZ9WMt5GD2LkExb/CpQOPPXKmqUf05ZCKjX\nKRLAUdMo3Mzs9mMiDc38nppQRPRr+AuO8DU9NoBDiy5Fj7hhN6FCLea+tS+S\n4ZUnkzIm+d/oh/CgTC3vOdwyVllvCFQql1EwctgyBiQQVx46hRTMLKJXT9em\nU8cM\r\n=mPoh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDrykxLUnpLgoeja1cVde76VIJN68YTAuGhuk39umpWQwIgPq7pswMfGuRNyL1UTIncLCtTQoOEPOdB5GLj5WZvDBM="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.80b5d20d.0_1597342635120_0.6671528452145183"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.758635ed.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.758635ed.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.a1dcfe97c.0","@material/line-ripple":"=8.0.0-canary.a1dcfe97c.0","@material/mwc-base":"0.19.0-canary.758635ed.0","@material/mwc-floating-label":"0.19.0-canary.758635ed.0","@material/mwc-line-ripple":"0.19.0-canary.758635ed.0","@material/mwc-notched-outline":"0.19.0-canary.758635ed.0","@material/textfield":"=8.0.0-canary.a1dcfe97c.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.758635ed.0","@material/notched-outline":"=8.0.0-canary.a1dcfe97c.0","@material/ripple":"=8.0.0-canary.a1dcfe97c.0","@material/shape":"=8.0.0-canary.a1dcfe97c.0","@material/theme":"=8.0.0-canary.a1dcfe97c.0"},"publishConfig":{"access":"public"},"gitHead":"dca431ba367368af1f858369557a0bc5db6783e2","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/dca431ba367368af1f858369557a0bc5db6783e2/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/dca431ba367368af1f858369557a0bc5db6783e2/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/dca431ba367368af1f858369557a0bc5db6783e2/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/dca431ba367368af1f858369557a0bc5db6783e2/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/dca431ba367368af1f858369557a0bc5db6783e2/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/dca431ba367368af1f858369557a0bc5db6783e2/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/dca431ba367368af1f858369557a0bc5db6783e2/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/dca431ba367368af1f858369557a0bc5db6783e2/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.758635ed.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-bSH7zJqpAVQhsDINNSGgWheEApOSkPvCbMW1ysDmTTtlyDaZLtRERv4duAlbtFRYd3cVqrk8s010pbT3g4eM9Q==","shasum":"9f6c59206e024f543c22f006e5c0d03a938c4aa2","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.758635ed.0.tgz","fileCount":16,"unpackedSize":265635,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfNsb0CRA9TVsSAnZWagAACd4P+wf4T/uwn1HUeLi4RfBC\nLBCXji9/IyrN/bLo4gB1cacd0xnaN8xtPy3g+OAVvsVfB/tsu8fasQ6UJLpX\nzqTsH1L5xpAwI2VlSV0C6eGonnvuFmojCViWTs0w42mIsvlXLnPmbQXFcMZF\nisge6UT4vTthyXhnGoD+dzcqhedNz6o+uarzf3Fr+2gngw0nl+CcbKqmJd1o\nGlFAlmBfC+n1t9S2Ur+O3z39wEeUWB2tfXxZqAX0NB2ctlBtJzm6xZ41+vZS\ngpEPG8aFOclDXo5kMF5a1SFiSn/wsmQVTEq6EicnLnhTid5L7Nf0vSIC0WFz\nWVtM4X4gOcqLAsfk90gSI0ZUvmUvZUFxYdBYIoTtk7J3o4gjuaqfJMIhseP+\nG8zIou+NqeOL8D3EYgMeQJvN/3cHdldeVZxZU02uga1/3Vev14XQIeOgqZt1\n2uxeEPDzeP3wyxlQAQJC2smaNFmdo7OW4spt7vOO6Ri8U5tTmKH26X5GLzgv\nXTbgEWGqKmZlPPQDBA91ghxursELktcvXOclxRLP9B1imRq0J9BNWf9cOt6d\ncuhWw99zT6b6vw+ESiNP87Jtgr6tNCxdItGvE6zgxf/hH4CG2ZaCka36xl+9\nQHIb+g0/xUEprCNFcXZxefb4b/txTLsTGrVWet3k94fcTXXKEx50xnYRI1Ps\nVGLS\r\n=Tcbb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGR3cB5VGjafqEvI6aVrpFtPqqsGCIcbpvt7gM/iTSscAiAjhiBOpqqoS3vEvSjkM5F70e8Q882Fw9dDh9v9gGjvuw=="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.758635ed.0_1597425395984_0.47714307934067945"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.18d6b808.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.18d6b808.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.150f427a0.0","@material/line-ripple":"=8.0.0-canary.150f427a0.0","@material/mwc-base":"0.19.0-canary.18d6b808.0","@material/mwc-floating-label":"0.19.0-canary.18d6b808.0","@material/mwc-line-ripple":"0.19.0-canary.18d6b808.0","@material/mwc-notched-outline":"0.19.0-canary.18d6b808.0","@material/textfield":"=8.0.0-canary.150f427a0.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.18d6b808.0","@material/notched-outline":"=8.0.0-canary.150f427a0.0","@material/ripple":"=8.0.0-canary.150f427a0.0","@material/shape":"=8.0.0-canary.150f427a0.0","@material/theme":"=8.0.0-canary.150f427a0.0"},"publishConfig":{"access":"public"},"gitHead":"7eb789f1eb17355bf97652cfec031e407c9e2fc4","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7eb789f1eb17355bf97652cfec031e407c9e2fc4/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7eb789f1eb17355bf97652cfec031e407c9e2fc4/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7eb789f1eb17355bf97652cfec031e407c9e2fc4/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7eb789f1eb17355bf97652cfec031e407c9e2fc4/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7eb789f1eb17355bf97652cfec031e407c9e2fc4/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7eb789f1eb17355bf97652cfec031e407c9e2fc4/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7eb789f1eb17355bf97652cfec031e407c9e2fc4/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7eb789f1eb17355bf97652cfec031e407c9e2fc4/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.18d6b808.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-GKNVDd/PWrWsX0UfkhiS3CKNcS+YiYaqyRrKRxer9UIbzcmEvvfXLuy+xZqilQ9ydNIdm2p0x4HT9ZEnSpt4xw==","shasum":"5254d5a90b69fe28d03fc926fbc8f86844b8898e","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.18d6b808.0.tgz","fileCount":16,"unpackedSize":265635,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfNxlSCRA9TVsSAnZWagAATdoP/RMyYf+PdDvEZk/pOfru\nEoK/PmhnfKrFwz+lGmdpJ49KUIZ4ewIQC3yMloYyUAoIZayUtq696r/OAge6\nsjMDaurCEDmSlw9bD8xveK60y3SZRDAXH4WX7FUN9Ez2Zi/Y+EHb5vlv3JKT\nhCefjnpIlZoPrwleSORAgtSpQErpQCCkv5Vtxc8KQZorN48USRVZkKikXPVE\nJVuqVHce7ShF9rI43FeW5myVG0g1fuUHcTrysvLnRfbTA8oAWhPCK/kLZ0KJ\nE8+C4/EiXbe6qxXvrWbS5DvyNL8UIFrXvHnBMSXBfMYhDtF1wtnS4uiEN3+F\nir1E+XZCV9dTFHqbzb5jy0arTKqNXe/KoeRE1LNOTz+pm8CAwuvJhcL6XvxT\nMJvx2F1WcX1O40wWIHlH6dAMGbT/SWpXjfg3JJE2l9inW/zCM5D6opqIxlKn\nwCdAC9EIehW0WtGZfN+x4nqxhbsYZZ90XasyNnYv6LsfpeK+CbiTRl14eNw6\nEwoRXICfRptz+b1wNSzQAYitmyksKCOANnwQiU+Vw+q68VP/4pIsdtqmKbIE\nKQRIo6OQUKPSerQrX/Qh0jnRd1LiBaK8Z0Csp7y6iZz6Xyjh4n34YsYW9Axy\n/VZ6uaXrkk3L/o7qUhDMc/0Yv0SDTEAGU83y9GIZFQHlrsKVOXephpUejyOb\nSa+y\r\n=l05i\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDtg7iQaT6scMvRR6E8ftKjbXIkt3N9FBWcyoST6USyPwIgeTc4BaQECbUZtlNmahIcVYvk4mhcGeUETJVeb8Rx4zc="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.18d6b808.0_1597446481625_0.23224777028463306"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.5f8ffbd1.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.5f8ffbd1.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.150f427a0.0","@material/line-ripple":"=8.0.0-canary.150f427a0.0","@material/mwc-base":"0.19.0-canary.5f8ffbd1.0","@material/mwc-floating-label":"0.19.0-canary.5f8ffbd1.0","@material/mwc-line-ripple":"0.19.0-canary.5f8ffbd1.0","@material/mwc-notched-outline":"0.19.0-canary.5f8ffbd1.0","@material/textfield":"=8.0.0-canary.150f427a0.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.5f8ffbd1.0","@material/notched-outline":"=8.0.0-canary.150f427a0.0","@material/ripple":"=8.0.0-canary.150f427a0.0","@material/shape":"=8.0.0-canary.150f427a0.0","@material/theme":"=8.0.0-canary.150f427a0.0"},"publishConfig":{"access":"public"},"gitHead":"c230db638d0171f7a47ff1f312ecc123b9bea4e3","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c230db638d0171f7a47ff1f312ecc123b9bea4e3/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c230db638d0171f7a47ff1f312ecc123b9bea4e3/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c230db638d0171f7a47ff1f312ecc123b9bea4e3/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c230db638d0171f7a47ff1f312ecc123b9bea4e3/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c230db638d0171f7a47ff1f312ecc123b9bea4e3/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c230db638d0171f7a47ff1f312ecc123b9bea4e3/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c230db638d0171f7a47ff1f312ecc123b9bea4e3/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c230db638d0171f7a47ff1f312ecc123b9bea4e3/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.5f8ffbd1.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-78VcyBlWHYq7BZ+7ycpLfh/tc0f3TkE1KIrtNGQzbDetaK1zrxOsJ6O5KEAbg0O91N/C2tZc2H+RDNO17TtvFw==","shasum":"b1cbe9d69a3a76398f3808b2e33aca69e1a797b5","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.5f8ffbd1.0.tgz","fileCount":16,"unpackedSize":265635,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfOwGACRA9TVsSAnZWagAAx9QP/RhZx4xYeTyXMRwvli3e\nm8/yL6u9DzPe5cZ40utp7mPtcTF1h0zBkCOETFPNdXhKm/3OtYNwcbF+XhTv\nObZyPZr5z3JjAp6dzgESkNCmwF3b2mUrivPrNRTNzWl8fu6i9Ecg6D4RO/5w\nx3kVG1rS/Mklts+N/n8mpLUqEYqdTwx5SFH92KDorC5Z2wEoOuZzGVMuK4Lx\nbAgA4o2xUeQkaTg0kVhsBmZZMg1eSA6iRmMy68rNZC723dNDiEyYbpwrQc1F\njgcJ9kqYA9zqTKkGeELNUMKhttyG6QtnFvk5n9FXxMVR51lq+NWArdJvSLIZ\nRGDLbaucixCBzj46FK4Vj9Rg1dIvI4oY02TzWSqaocjiTLYdOIzTS6Pmz/PA\nsFQOF8Xdd40R/kXoQZRmMxHz53Kfg/KVq7ag1kuXDH9FtOCY2akBmmjZG/ka\ncNdux0TXiFTczK4YQy+zPpzQuujNu4M9Qv9TGqwOOf7Lyqw0k3DqwhhPGB7s\nkCPA4ufmTbluhvrku8wzCY6CDxQ2KM0zarHtJwNZVwYDu0N3S7Ph91nynetB\ntXVwm4j4j6ia9EYqP/hkpnlz6lMXm3h9O1nLN5gISGZ6ODC42y27vMCatjOK\nBXVfvLcBM0KkcB4jGJXdzYH6+03d6H9VgXJFnYLXAPV/QoraydXq/3uhwUTQ\nJQrI\r\n=F0qd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCxn0jCrTByrl19+jYeWmZfQkRexlKuN2w6ctj26HicyQIgaXoazzjJhyAtELsXI4FRdIlUb49m57/2GewKFOvmhCg="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.5f8ffbd1.0_1597702527922_0.7094875081490122"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.8604d59e.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.8604d59e.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.150f427a0.0","@material/line-ripple":"=8.0.0-canary.150f427a0.0","@material/mwc-base":"0.19.0-canary.8604d59e.0","@material/mwc-floating-label":"0.19.0-canary.8604d59e.0","@material/mwc-line-ripple":"0.19.0-canary.8604d59e.0","@material/mwc-notched-outline":"0.19.0-canary.8604d59e.0","@material/textfield":"=8.0.0-canary.150f427a0.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.8604d59e.0","@material/notched-outline":"=8.0.0-canary.150f427a0.0","@material/ripple":"=8.0.0-canary.150f427a0.0","@material/shape":"=8.0.0-canary.150f427a0.0","@material/theme":"=8.0.0-canary.150f427a0.0"},"publishConfig":{"access":"public"},"gitHead":"6b87d240089846147032623e302121a478088f7e","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6b87d240089846147032623e302121a478088f7e/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6b87d240089846147032623e302121a478088f7e/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6b87d240089846147032623e302121a478088f7e/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6b87d240089846147032623e302121a478088f7e/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6b87d240089846147032623e302121a478088f7e/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6b87d240089846147032623e302121a478088f7e/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6b87d240089846147032623e302121a478088f7e/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6b87d240089846147032623e302121a478088f7e/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.8604d59e.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-qh+TETWtcPgUCGOm9J720n0D4xGf0ttTDBKx2+nF7JHl7427lvjsQDaViK7PbsBfuWXtttqvcDtCaxbaUK0Rgw==","shasum":"81699778c757adcade0a40b31dd7f608faaa9493","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.8604d59e.0.tgz","fileCount":16,"unpackedSize":265619,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfOyijCRA9TVsSAnZWagAASvYP/1KKch5JINF3h0K4sCtF\ndTk3a6C7MI/R1PJd3seGfpzAUKCFzjOuqxMzSPKmB0I25tNCiS5s75/fi6s/\nMIOBuetMQ1nKOgpDnYSbKuLvk8Afcv+BgjesXq0PGDmokKnjpN6tKDN4NaWZ\njceVOOPL8QRdluk2jqoIXHBKpgSk79tKnkCHLnKJqf5Fq/po+eFWEJX07LHL\nLt+0rINnCrQ66SranxIpRmV4rfuH4V+9ppR3MO3QiilsP1ekOQjrRaNwzjB7\nHtYmfEVSEcASg19KhT/idCF1W4Ki+gAGAURcOW4aPjiP37PJpFP0tOO8z1fo\nU14xu+vhlq5ubLwOROgdLJhnMNDl1wlXqa7PZMqEMN+vocsuHBvv2j/OJnRK\n4oFOf3uTYYncBUVzH6lK/AHJLD6tc1CL/U6TVZ/+0krglYau4iNvFIzF16Wu\nIcdSC+M9gHMxc37F1ZXZvb5bk+0lqwmXzCc/AlPl5FxxMkPmt5SZazXU/gJK\naz3gQqo/KiIFAOo29zIHmz7e4ht0nFtFMc7QcT2cN0Ko0vxG0w042d36pmyE\nUa5LVVBgH6dMuHCQHdyjbruqOABG7XPbzLY+YFFs0lTf1k5aoFEWzXf4is3d\nzaKOFueja1XIAjJd3flsmWCImeDkAkntFXKxbrHM89pRE9EcDczlPsGHqnbu\nGG0J\r\n=mq2b\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCPeEw2FpcxtYjw2A/elzzCaWGAMIn50XaaNXC/9u7fvQIhAJgApECNBsFHkI5tdCJ+v3iMit0fRXxyOz7SO2HJznuL"}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.8604d59e.0_1597712547244_0.08343827364012824"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.1d7d5e34.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.1d7d5e34.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.defa599a8.0","@material/line-ripple":"=8.0.0-canary.defa599a8.0","@material/mwc-base":"0.19.0-canary.1d7d5e34.0","@material/mwc-floating-label":"0.19.0-canary.1d7d5e34.0","@material/mwc-line-ripple":"0.19.0-canary.1d7d5e34.0","@material/mwc-notched-outline":"0.19.0-canary.1d7d5e34.0","@material/textfield":"=8.0.0-canary.defa599a8.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.1d7d5e34.0","@material/notched-outline":"=8.0.0-canary.defa599a8.0","@material/ripple":"=8.0.0-canary.defa599a8.0","@material/shape":"=8.0.0-canary.defa599a8.0","@material/theme":"=8.0.0-canary.defa599a8.0"},"publishConfig":{"access":"public"},"gitHead":"e5b1904570278e726a75457dd1d8c9a30c98669d","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e5b1904570278e726a75457dd1d8c9a30c98669d/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e5b1904570278e726a75457dd1d8c9a30c98669d/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e5b1904570278e726a75457dd1d8c9a30c98669d/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e5b1904570278e726a75457dd1d8c9a30c98669d/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e5b1904570278e726a75457dd1d8c9a30c98669d/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e5b1904570278e726a75457dd1d8c9a30c98669d/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e5b1904570278e726a75457dd1d8c9a30c98669d/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e5b1904570278e726a75457dd1d8c9a30c98669d/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.1d7d5e34.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-QmpE/g7l0OiZ/rJ+/tcNKtFsrktaeR2UqHeJMddyEsVHKqW5twh5Jsy+G7Dos5yHCVCPdZrD8GgZhMfi80txRw==","shasum":"c1bd064660e1ea9d04a3ebedc1baaf966bbd9a59","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.1d7d5e34.0.tgz","fileCount":16,"unpackedSize":265619,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfOyopCRA9TVsSAnZWagAAIewP/iCGflT4QoPVoyFMprmb\n465cm39bD704z/fUr+UiliA5/N8TNka4Mv+hsDYFb2YX7tj7Zo6uef0NZWQx\nVqME2AM3hctL+1tOHUJ4rVtgYzNYaMWJATuQYy/OZ9lUjMid3igMARx4xKaI\n5DIhkOVBP941jccd3cQBVa++T8B3iUGdjkuZ/SE8a3NSisnYWqpS0TS72RcT\n2rga70n27pRyBMapp/SNS8LOscGFqJAgEEuz29EwahsZ2crno8d0gHWjCllV\n9C03QIHMHrVqaVcGgroUvU47klUFyePSa0ZjmyE0gt6e0eWnEk7aB5fFFsbl\nzA3S8WdL5FzFrt3QXg7GjoCUu9Th07C4/S6ExUFiKhoJiuOv84tS4DILc6se\nxNtfVKXOBGV6HK0laD4d21Tpwkx6DF9BxnY9r+9z4arbG8WGI7y9UZuhnzQo\nebvkx9jgDxK6W4ggiJNBh7wn1qfuR0hlCYxF4VR7TWVXw1GcoGDxg1H3pkQ3\nX4zzZRii35iR5dDYJWz82Sr9hdJyHxUnmsW81uyfUyoIXZdQ1t+fH2L/+Hdr\nu21UoKwP3qI/bE7ayzMyFtHSi6gXqr//P3yn789kM0O5GR5RikqsCRm7b5q/\n5GOgT4vuz5MJ9e3utQeNNgDqCB9c4m7aJ0V1gm1nuo86Q4LNlPnIWlfRdg/m\nOobC\r\n=61c/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDSplEa7XDLaVlwJmjI4HB5Ci4HGSPQY7xGqEN/dAQNSwIgIp2zfO+6zbv12PdbCZ5OLCyt/DoDZRoCVGpGmNoGsgg="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.1d7d5e34.0_1597712937101_0.1297806027450381"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.9cc95c07.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.9cc95c07.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.defa599a8.0","@material/line-ripple":"=8.0.0-canary.defa599a8.0","@material/mwc-base":"0.19.0-canary.9cc95c07.0","@material/mwc-floating-label":"0.19.0-canary.9cc95c07.0","@material/mwc-line-ripple":"0.19.0-canary.9cc95c07.0","@material/mwc-notched-outline":"0.19.0-canary.9cc95c07.0","@material/textfield":"=8.0.0-canary.defa599a8.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.9cc95c07.0","@material/notched-outline":"=8.0.0-canary.defa599a8.0","@material/ripple":"=8.0.0-canary.defa599a8.0","@material/shape":"=8.0.0-canary.defa599a8.0","@material/theme":"=8.0.0-canary.defa599a8.0"},"publishConfig":{"access":"public"},"gitHead":"48f9adf6b09d7b2532669f3bb466d2dbc3970990","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/48f9adf6b09d7b2532669f3bb466d2dbc3970990/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/48f9adf6b09d7b2532669f3bb466d2dbc3970990/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/48f9adf6b09d7b2532669f3bb466d2dbc3970990/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/48f9adf6b09d7b2532669f3bb466d2dbc3970990/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/48f9adf6b09d7b2532669f3bb466d2dbc3970990/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/48f9adf6b09d7b2532669f3bb466d2dbc3970990/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/48f9adf6b09d7b2532669f3bb466d2dbc3970990/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/48f9adf6b09d7b2532669f3bb466d2dbc3970990/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.9cc95c07.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-gLwefIKoO021oU92pzWfHQGwt0ka7aij31I4s+tyRFmN5CR2xzbJH17aPnFblmLjIrRtOa2UNSMzfSoVua2g4g==","shasum":"1ac4a8d188435f81abbfe4cb0618fd347724eecc","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.9cc95c07.0.tgz","fileCount":16,"unpackedSize":265619,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfOyv4CRA9TVsSAnZWagAAIS8P/0cvgF7kTvHQk8Pddooe\nsliYRMBWjsYAaPHny3l1pwmcKl9QVhTEpDUefJyo4/wwbOPwcbkC7OvZFBoC\nQFeP62LkH3Iua61vkbVzScxXK74BeelZ5bUj787/ru6WBoqsewif7/MKU1RE\nKswz7Um2n8Iy23HEduC/YzwymnE+14W/nSx3/spShQmjE5B7TLCD1GYrmRAd\nNKehKMq4YrhX/O73ck9hWyhPwzys5PFFUeG/Wbx+8ah1QSNACqi1Y9Y7d4sU\nRsqWmta+bFZArUgxPJfEH7FoAq8PvbfADjwKgHlhjIMhPMGtIZ0HbeoNWnTp\nfM5Vwyp7PmlY1ChJE2RVlhFIKOrWQSkWXTJ0F3z+kiLUda84vleaiPqWPnPB\n9wgsE4KLflEbOpBEkeeKPPno/kcERPL2i8SodPNcbzWAIZsUZ99IzrwZXe1B\n02esC1T/N6PhQDMWVzdICzb1FEppykenVFnVFRfmQWgqnAvsEA6aBAYGkId5\nCqXXnt7n8cpTDj4y/8mWUaaOPiXA+g1sEY7can3j/8qhcBt1RM/ZMaaOeCFv\nrvkEFjxYt+CX9RZucMs0F3Q8jHLLz4LBUSB6slcDc3KsyOiPzln3ZvZWrkKg\n7mwBf61ef8CoszW+/Bi6WTV8enOk4daGrwyvYfEQXEXmh/mZqGwg1UtDd4k7\nzID2\r\n=Aqh/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICxugF3CGOfx/s/4jF4aR0hR/dKsf/YQtId9n27LZbt2AiEAqoRtTr07BYb3quFsVFW9shbxYVRlr+lwCgxdYyeJLdk="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.9cc95c07.0_1597713400303_0.12536074102575046"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.9f65ced3.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.9f65ced3.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.defa599a8.0","@material/line-ripple":"=8.0.0-canary.defa599a8.0","@material/mwc-base":"0.19.0-canary.9f65ced3.0","@material/mwc-floating-label":"0.19.0-canary.9f65ced3.0","@material/mwc-line-ripple":"0.19.0-canary.9f65ced3.0","@material/mwc-notched-outline":"0.19.0-canary.9f65ced3.0","@material/textfield":"=8.0.0-canary.defa599a8.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.9f65ced3.0","@material/notched-outline":"=8.0.0-canary.defa599a8.0","@material/ripple":"=8.0.0-canary.defa599a8.0","@material/shape":"=8.0.0-canary.defa599a8.0","@material/theme":"=8.0.0-canary.defa599a8.0"},"publishConfig":{"access":"public"},"gitHead":"5aed2922c67f2ad7133772e74310e121b406dec1","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5aed2922c67f2ad7133772e74310e121b406dec1/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5aed2922c67f2ad7133772e74310e121b406dec1/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5aed2922c67f2ad7133772e74310e121b406dec1/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5aed2922c67f2ad7133772e74310e121b406dec1/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5aed2922c67f2ad7133772e74310e121b406dec1/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5aed2922c67f2ad7133772e74310e121b406dec1/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5aed2922c67f2ad7133772e74310e121b406dec1/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5aed2922c67f2ad7133772e74310e121b406dec1/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.9f65ced3.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-HwU6Aejjhv+iUdQauAuxF4AV3MqjnqAqALTTGsxwQCUlrHLRGxKHpCGQF/y90GN269AmSAk4uL5I2fpeYzpiHA==","shasum":"2969cdf34fd5d569693972e5d8f6e7c066dd061d","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.9f65ced3.0.tgz","fileCount":16,"unpackedSize":265619,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfPDcGCRA9TVsSAnZWagAAeokP/298wvD8mnevyz7QRGfs\n9IS/kjA4lox5cczsno3AExEOkz8eigxZcJGU9ndn1zgmJamkbachC1AMkYi1\nkfG0WIZ38tACgs4X99intIsmiZFQBeYh3fM4uHY4lvYpTpXuVif4VUteulQo\nN/6apn5hTes6QLk4Fq5dDZ663OshQnssftwIlyiuML9vdSWUMfwW1DykcStv\nriIGKmS6cCI+hMo+7ONoGZ8XHtxL4F9Tj9zBA25NaDbTwfShl4/Qh/lkZnkE\npi8t96pyczEODoMFP8dLehl5oaDVP3MPlXEmspwNdtkUB8qaJUZW9VmyFm2R\nsjJiMTsjNP1o0SWoO4CVaqDMx+vZtfdlOSYRlMXlzRTfGEl1Ih1J/Jgp1pIP\nVXyQE+lZ+APlUXeAUWZ/3jdgG2WR/v8EuO0L9ZVo820kjCR7ydyP2zXgkJrl\no+rrltZKou2hZkM7DY+BUk5pvQ39lsacSHm4Ilz5NhiK7usJ1t5ePyoevJ9Z\nFtDqbT7yIhZrE8408I7C2OjUINfXu2DTvMC76FSAQnrQwh5M5EfL4xcaUi7M\ncB+XaNxyy0FeA4LsKzqprC4fL3BwYGnmBIVBfApSpcVrezbW9/ngX1TN30Ue\nGJuA5edZQeOhvKlUOGO2WJBIzdPqDeLAvlSKAHEVXc2+ZvXjqcUZyoB80SW7\nvjeO\r\n=l7Bp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBUvd40JNn2yk5W5dWhAVlZV/ApGr1AYolJfiuH0m8U6AiEA3ZU5P6h6NDQVjWILX0ZsDaSYXLMvUbbYiB1KngosEdw="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.9f65ced3.0_1597781766078_0.2668443586539986"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.5962b365.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.5962b365.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.66b8ed7e6.0","@material/line-ripple":"=8.0.0-canary.66b8ed7e6.0","@material/mwc-base":"0.19.0-canary.5962b365.0","@material/mwc-floating-label":"0.19.0-canary.5962b365.0","@material/mwc-line-ripple":"0.19.0-canary.5962b365.0","@material/mwc-notched-outline":"0.19.0-canary.5962b365.0","@material/textfield":"=8.0.0-canary.66b8ed7e6.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.5962b365.0","@material/notched-outline":"=8.0.0-canary.66b8ed7e6.0","@material/ripple":"=8.0.0-canary.66b8ed7e6.0","@material/shape":"=8.0.0-canary.66b8ed7e6.0","@material/theme":"=8.0.0-canary.66b8ed7e6.0"},"publishConfig":{"access":"public"},"gitHead":"454d30885df0a3162dac8184409307ee571c6215","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/454d30885df0a3162dac8184409307ee571c6215/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/454d30885df0a3162dac8184409307ee571c6215/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/454d30885df0a3162dac8184409307ee571c6215/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/454d30885df0a3162dac8184409307ee571c6215/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/454d30885df0a3162dac8184409307ee571c6215/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/454d30885df0a3162dac8184409307ee571c6215/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/454d30885df0a3162dac8184409307ee571c6215/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/454d30885df0a3162dac8184409307ee571c6215/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.5962b365.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-uCbn4XPpz+9/o9HIJHfOLk6Sbfgp/cclnwoRWnzo4RltYSdkVIpArGO6xJf5B2lxAoQpKp4xRVQB6L62os8oOQ==","shasum":"04de250ab768601867f4fec7c9ef8a143117374f","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.5962b365.0.tgz","fileCount":16,"unpackedSize":265619,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfPYuBCRA9TVsSAnZWagAAulAP/0WuzUk5k2KA3rGuHpLz\n3bvbdj9DKMUbghGqTlKOd1s7NHMpokvExboVWIaYCRkGFJJ4afnoa5R7xfAu\n7RiCowgeSQ4dTa4mDsQYGTgcXJgKZbXibElZdrqFkeix6S9qNOi1nrpX8kxI\n0kyztHxqx2n+rflQXJzslKrvysegYKx/OL2UpEM0QR9VP/xVneaZJbmStXNk\nUjpbGD7H0Q5mRxFF6jmmWfk8Sgf5VqJaKj6vSwA8GPl3UZ9G6ImLjkytL0xR\n4tE5dFB5Zjy1dc41LyCLhPke5XNymLtgQIWoIoaUYWHg9BWF+I5hFTskvnFc\ndiFyaIvgkBDt374Er0Np1HSX+s3HV86HHqzlVGNrWixogM7GFEUyARacylC0\nv9FGjMAgQt94GDebcAQ6VcIvgsJlJCLQ9/PRLmw40m99kgB6N1TJVvlrvSAg\noWKslbcdZHClddsY8tQf1FYdmRHnfM9o1DeSXDqXxwr1UP5vfipxRSbz/UTZ\nrGuNKMfs+qQ02Cv02up3zVmpIAChLh7Kg/uY83hKKWJXsIUs9PEGjXf6WTNy\nwridVGF/Iwj9DoNQ/sDoPkN1UAgYjwk9IivimBAI7NSxgZda16nYTyOmKpy3\n/Xs1mEtu4xuGoiy0zRRRCapUt+e+2AtOLe2JgvLvscuKTYb3N0jAbrMn8w4E\nVf3L\r\n=3dgo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCbjRgjKVnGXWKDqE1eHuDuIUgrmRvodoM8yXNTi1hZCQIgJze29zeNPaCR3cUPsL7u4bS4Nvbxt6JaQAS9v/xEtVU="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.5962b365.0_1597868928953_0.2322449016306114"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.9c9ec756.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.9c9ec756.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.da72839f4.0","@material/line-ripple":"=8.0.0-canary.da72839f4.0","@material/mwc-base":"0.19.0-canary.9c9ec756.0","@material/mwc-floating-label":"0.19.0-canary.9c9ec756.0","@material/mwc-line-ripple":"0.19.0-canary.9c9ec756.0","@material/mwc-notched-outline":"0.19.0-canary.9c9ec756.0","@material/textfield":"=8.0.0-canary.da72839f4.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.9c9ec756.0","@material/notched-outline":"=8.0.0-canary.da72839f4.0","@material/ripple":"=8.0.0-canary.da72839f4.0","@material/shape":"=8.0.0-canary.da72839f4.0","@material/theme":"=8.0.0-canary.da72839f4.0"},"publishConfig":{"access":"public"},"gitHead":"4c887788f2cb30e8b788a5cb0a1a13dcb78a0961","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4c887788f2cb30e8b788a5cb0a1a13dcb78a0961/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4c887788f2cb30e8b788a5cb0a1a13dcb78a0961/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4c887788f2cb30e8b788a5cb0a1a13dcb78a0961/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4c887788f2cb30e8b788a5cb0a1a13dcb78a0961/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4c887788f2cb30e8b788a5cb0a1a13dcb78a0961/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4c887788f2cb30e8b788a5cb0a1a13dcb78a0961/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4c887788f2cb30e8b788a5cb0a1a13dcb78a0961/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4c887788f2cb30e8b788a5cb0a1a13dcb78a0961/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.9c9ec756.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-PZ9aT/jgcapRkoazJwXl6oIi5CwVEp6P1MWUPPFur8GwtVKiLVxHs4ZRrbGXjgLdgQ6EmOr5lEjHpXJ89zn6ew==","shasum":"dc43282c12172c7b1e78912ff3d441bb2a406cb3","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.9c9ec756.0.tgz","fileCount":16,"unpackedSize":265619,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfPsc3CRA9TVsSAnZWagAA3bAP/iX2uZvQMPIF5XMXpfNW\nI16Ggixg9RU+K2r/TcQPzoTzQ1Awj9iXI0DqwwDFDNCLUrtJPmY81RvK0QqO\nXGEFM90Jd9HGm6qLbE6HNKVv368GhkU0EIapAnmp/Jq9XX+zAxH27hlGR0Ak\nqwVCLSJTVEBspc9sf3RasbnChb/9RlTJadKeY1JZdoXNFBAG9IEMr8R/79N6\nmCtA5UnHTrb0d3xAWS3yP5tyYXksAv+XAJVaweBmqkonOCrDYSFwn7RcgBis\nnY5SKgXeYe7IN84Y15SwRnQyOMdtvTOA1T5MmnC/2odamxVDrEb0kcDOHY9S\nljLvTIZTdtE8Bdc7I9aTJ+jFparE0+GF0EZU0f5dNjghBMFiTPHop2ueelZq\n4ElXMP8qeZJjXbLpIPgfNhxl4UEU84L5nPaEbPmcM6eATvTRO2+ZwI+LSfsO\n28kJtQJbUHvbxLV0m//YFWB4qBiA4YknrBLRv2teGszWLdCp/tix6Wy90rNa\nuXqNWr7wgvEToO3xMcDq5DvwD1iWKj3UpwYEu6H/akLx0XlEC6V726SwSjne\nIXPojOyixb9xEDZwhmNvZAYyClYENl/6DEf0uNACQwOnPdQsms7wnen3BhHw\nfHZvbBR8pZ6plpBs+AS5CDy34dYaOLnByLA+I43tLigvgAtefBxobf8BHHR/\nGmpv\r\n=S3Ps\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD7wn+XYccvEBJ1EbkoxG02+5EP+gjJlozdIu7St2oYgAIgA3Ex056MffY8EDtPYO2aqtaQZaURawA15URFwJ2KIVM="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.9c9ec756.0_1597949751284_0.2938647121498319"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.fa0ad66a.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.fa0ad66a.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.da72839f4.0","@material/line-ripple":"=8.0.0-canary.da72839f4.0","@material/mwc-base":"0.19.0-canary.fa0ad66a.0","@material/mwc-floating-label":"0.19.0-canary.fa0ad66a.0","@material/mwc-line-ripple":"0.19.0-canary.fa0ad66a.0","@material/mwc-notched-outline":"0.19.0-canary.fa0ad66a.0","@material/textfield":"=8.0.0-canary.da72839f4.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.fa0ad66a.0","@material/notched-outline":"=8.0.0-canary.da72839f4.0","@material/ripple":"=8.0.0-canary.da72839f4.0","@material/shape":"=8.0.0-canary.da72839f4.0","@material/theme":"=8.0.0-canary.da72839f4.0"},"publishConfig":{"access":"public"},"gitHead":"d4020241262a9309827adc8467ba4c499bfab71f","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d4020241262a9309827adc8467ba4c499bfab71f/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d4020241262a9309827adc8467ba4c499bfab71f/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d4020241262a9309827adc8467ba4c499bfab71f/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d4020241262a9309827adc8467ba4c499bfab71f/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d4020241262a9309827adc8467ba4c499bfab71f/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d4020241262a9309827adc8467ba4c499bfab71f/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d4020241262a9309827adc8467ba4c499bfab71f/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d4020241262a9309827adc8467ba4c499bfab71f/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.fa0ad66a.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-Gi91SEBpRGE5hpxhagrB9A8gD1hW36nSdYtHwlNrl2eAfoxzdMdl8yaSTwpgng55ctIoXZDzu6YkTQuoD9GpMQ==","shasum":"8ed63fc34bc3c3e58781974ba9223669c89ab77e","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.fa0ad66a.0.tgz","fileCount":16,"unpackedSize":265673,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfPt5zCRA9TVsSAnZWagAADK8QAIo8c6pzbnsg4gLK4v4T\nZjc8xJ5vfxzItqB0x1Boz5OSdVtwIFwZpZpptvCoAbQneuhXGYA3nAqWdfmb\nU1Oqq6lTjlZ0ecvHu2Y5y3lHTNHP3yLs+Ib+hiOBngBXlpIeLLbbUmy2Wb8I\nnaPAahGMUYAoDQYXxdwuzDQUFbq2pd5A+eRVhBf2iP845sb3ROcEtq2WMKl8\nNaQ4msagfgTNeMfpiPC2w08jY8aHvi+iLQkQ4gcGMz1ry/4RBA9c1vNjtM9O\nlKd7SUxPxYXcol9lulIVKLk4jPzzyRX2Fb32sLdDuzCtsn/X1xofLiOzCTXQ\nTp5z05aRioSB0x2+AhPApILXsHWnYktNOSryV9ep8vr/CS6B7axLLJ+1tm4t\n3EinhOQ999K8Xc/CMEFQtiTbDm2rBCqZ/TxOOLxQ8YjYov5X9vOMYql5duQA\nkWxkat3G5hmOhrvqTzu5OFJD7Ar4fZP7XCDIyw0XZrYJN4880YeqjPMTiy6S\nFH8aSPfVrwmGnl5neZHt7X0IGQ4+oOaB/Lgv5eMs1huLh5blSZd0rHg70rrH\n+KpHEvpCSiSvXGTZgkoTm85ui3lo/DOzU1BDaAto0WTSZVGq3I0c4du3OTst\nbT67IF3iia4kNc4vs08Y8ujjScFd85zFAWYYnfeJAeGXgbGzrBR5u/RhHT0x\ngTU+\r\n=jMTC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCbT1Ssr2p5q6Yg4fwC5EeRPV7dPfZ3FxZfv/fNwKuNNgIgR19S9TGHo5uNyZ6aFgtK7kqGnUxJeb6pCDsRRWfsU08="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.fa0ad66a.0_1597955699374_0.11290358698173919"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.06ecdd6b.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.06ecdd6b.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.da72839f4.0","@material/line-ripple":"=8.0.0-canary.da72839f4.0","@material/mwc-base":"0.19.0-canary.06ecdd6b.0","@material/mwc-floating-label":"0.19.0-canary.06ecdd6b.0","@material/mwc-line-ripple":"0.19.0-canary.06ecdd6b.0","@material/mwc-notched-outline":"0.19.0-canary.06ecdd6b.0","@material/textfield":"=8.0.0-canary.da72839f4.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.06ecdd6b.0","@material/notched-outline":"=8.0.0-canary.da72839f4.0","@material/ripple":"=8.0.0-canary.da72839f4.0","@material/shape":"=8.0.0-canary.da72839f4.0","@material/theme":"=8.0.0-canary.da72839f4.0"},"publishConfig":{"access":"public"},"gitHead":"35a2331f3c8450d35506d4f0b54075d121a2670a","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/35a2331f3c8450d35506d4f0b54075d121a2670a/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/35a2331f3c8450d35506d4f0b54075d121a2670a/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/35a2331f3c8450d35506d4f0b54075d121a2670a/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/35a2331f3c8450d35506d4f0b54075d121a2670a/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/35a2331f3c8450d35506d4f0b54075d121a2670a/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/35a2331f3c8450d35506d4f0b54075d121a2670a/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/35a2331f3c8450d35506d4f0b54075d121a2670a/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/35a2331f3c8450d35506d4f0b54075d121a2670a/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.06ecdd6b.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-9I6wNxhzxgj0QbFstq388xIiUzujxDDTw7S0leRSZpwkF3Wm/FOeLr4cRqy44KEtEM6ik0e/9LlAKOzg8YqJ3w==","shasum":"12937f546b0b6f8fc9c2343621419ca2a92fb145","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.06ecdd6b.0.tgz","fileCount":16,"unpackedSize":265673,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfPuxFCRA9TVsSAnZWagAAbiAP/1T2FMhBqIEt0j14rH1t\nKLi4aJ9dLK6NsPRHNYx2od8VLCgUu1zKXrIocvAHqiOV5ioMEX6U3i0KsNtQ\nV/q6biJXlCmgS/V3yaHy4FqqUTmKPM+eUDQalY6y95f1FQ5xh7I9Gbj17gkB\n6DV1d0W1cwBz2WA8Aw6Mbwosfs3QGDhlpSfuWoFatHoLE9XbzA09WdsLFesa\ngATxvK6qWWMMvuCCZZo5P6/ZNi57wPDmfDYZc1u5+m1LORX6uULql/0tLko0\npcDM4Rlgg7KPQBgmFP6FQx11kv4/CVBJVceGjUJV6La25evFZdMx0YBt9jPG\nqKbTllqzzVpGc78ypc4HPEHxVeR3Aa+dvOLIoZ4+WWknTNTvhaFNdunutycn\nbXQvfPxJmptz4P2gzkLONzZPtc5DDoEmp4xHkuNbNqs0fzK9xguJldPBwxgf\nxh9EUcPQHTbRfJu+BMRi2NLtzyVoLy1kCwGM1sfLB5f0P8YtIzGyhC/94rr3\nd4mLFgwyEWkj5P/UnThlUmg+9Rcjo2npA9gXu7GorFKyC3aPXk/DErXjPKmD\nbf08TkbPr1nKw4uBPiAZfOLvkcPrk8f1Z63sQI3+ljY3ghEmAeVUYcqO0441\nHR2wzLNk96kanOP/VJu2b4Aeh25pdzwqU7+ZfwwSsr4Yg56PguH1AuIXsej4\n/VWP\r\n=J14O\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHo/1w7B+4sjRnHrLVzpLNaygFjBEQHtrzW1wra8bkCsAiA3lWnb3Te5e2TQVygqnF76WF+pbA1na7lMMEeVSihkjQ=="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.06ecdd6b.0_1597959236705_0.597592019950244"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.2bca2318.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.2bca2318.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.95e4eeea7.0","@material/line-ripple":"=8.0.0-canary.95e4eeea7.0","@material/mwc-base":"0.19.0-canary.2bca2318.0","@material/mwc-floating-label":"0.19.0-canary.2bca2318.0","@material/mwc-line-ripple":"0.19.0-canary.2bca2318.0","@material/mwc-notched-outline":"0.19.0-canary.2bca2318.0","@material/textfield":"=8.0.0-canary.95e4eeea7.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.2bca2318.0","@material/notched-outline":"=8.0.0-canary.95e4eeea7.0","@material/ripple":"=8.0.0-canary.95e4eeea7.0","@material/shape":"=8.0.0-canary.95e4eeea7.0","@material/theme":"=8.0.0-canary.95e4eeea7.0"},"publishConfig":{"access":"public"},"gitHead":"2e3f0ca806ce8930df2251177b8dcedb9deaa8d7","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2e3f0ca806ce8930df2251177b8dcedb9deaa8d7/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2e3f0ca806ce8930df2251177b8dcedb9deaa8d7/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2e3f0ca806ce8930df2251177b8dcedb9deaa8d7/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2e3f0ca806ce8930df2251177b8dcedb9deaa8d7/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2e3f0ca806ce8930df2251177b8dcedb9deaa8d7/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2e3f0ca806ce8930df2251177b8dcedb9deaa8d7/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2e3f0ca806ce8930df2251177b8dcedb9deaa8d7/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2e3f0ca806ce8930df2251177b8dcedb9deaa8d7/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.2bca2318.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-wb0GoUPwCNNKncyqUfphFxeEubuTDjG9XU1M15VjmQ4jjf4X78OpztSN9+TpIHUi6ZEfKS+NE/2XzMUT7o37nA==","shasum":"a4221d56e2d3c3c3af49a17baf62893d68179871","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.2bca2318.0.tgz","fileCount":16,"unpackedSize":265673,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfQAnXCRA9TVsSAnZWagAA/tMP/1gfglRG6Jcy2f4woo7Y\ne7Vv8Epqx5jbnjKVyl6Dbm2p2Z4bp2ZaBJEgoD+cIUsqpeylvj6kCcCCEq6a\nhyJEdpYhy5NtS9WS0Va2z6yfZHG+gR6zf9Nc+BFAAN0YwmFCbpZMEJqiybW1\nz9o9dTWuk4ikmB3NHAbfiPNG3YM/OEsjEfaqjj/9q+1W0bi+3RGWoVDiC7Zh\nLnIsSnacurzJzSS7k0YBKf8RLxtydANKurG1KryU1tDXHFMKfofaAm4Qcifl\n3KAGo3wNYk3DI3zl0U6SdfV+ErGgh0cOykixslWKM96dN+g/T/WeUZbMDX2b\n2SwSga8k/nK8p5TFUf539tQQURiXD1hx4RUOO4dQ6OsfLzE+7hzsPsQ0Ax5H\nnPxiCWe5jgNd0UDuhWQoAiKdJW+lC5ZZtR+yqM5p/nql7GctJ+jlYn09U/wf\nxO2Tipzkkc70+rnGQoyYSaYc+s7a45tICjN4lp9C6cMJCe8WLdSTZAeUiyCL\ndhhVzK7JE8PaVyyg7D3cMa4NDYz4fYL+0BQo2Hjaxq5jxofdS+X24cjvSJAB\n6ueSAdgzG83I9wZcMQVWUVR67CkOcqF9OGWHcX4Mdpb922leLry0AJUArzOL\nGX2VPdkNwkZDiRUuHR3Z0UF7BfPUWEC+lPzfZpPxaBoQlOvT5Lc5/rC0t623\nMkgF\r\n=B/xB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICeIj+VI8hNP48sngo/CDIcGNtEYSkS0bQ0TeUoTol5jAiAKXUUBEl57Pz+a19JSXOVf2pZzIzrKb8ADz162HOD7fw=="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.2bca2318.0_1598032343221_0.7383527079454473"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.6aa47265.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.6aa47265.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.95e4eeea7.0","@material/line-ripple":"=8.0.0-canary.95e4eeea7.0","@material/mwc-base":"0.19.0-canary.6aa47265.0","@material/mwc-floating-label":"0.19.0-canary.6aa47265.0","@material/mwc-line-ripple":"0.19.0-canary.6aa47265.0","@material/mwc-notched-outline":"0.19.0-canary.6aa47265.0","@material/textfield":"=8.0.0-canary.95e4eeea7.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.6aa47265.0","@material/notched-outline":"=8.0.0-canary.95e4eeea7.0","@material/ripple":"=8.0.0-canary.95e4eeea7.0","@material/shape":"=8.0.0-canary.95e4eeea7.0","@material/theme":"=8.0.0-canary.95e4eeea7.0"},"publishConfig":{"access":"public"},"gitHead":"f13aa269065b757dd289dd89367756db80da1596","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f13aa269065b757dd289dd89367756db80da1596/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f13aa269065b757dd289dd89367756db80da1596/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f13aa269065b757dd289dd89367756db80da1596/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f13aa269065b757dd289dd89367756db80da1596/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f13aa269065b757dd289dd89367756db80da1596/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f13aa269065b757dd289dd89367756db80da1596/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f13aa269065b757dd289dd89367756db80da1596/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f13aa269065b757dd289dd89367756db80da1596/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.6aa47265.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-Fmx7YQcXp3p2zz/A+gnrr6TF9PzHnMyv/wWQLlasjO8ftLCMSQcnwM4z92K6md/2tN5yAjiQm+0PQIVzMsou8A==","shasum":"6c9e2d2a0977fb39a9dc3eb11c57dbeb5de386ae","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.6aa47265.0.tgz","fileCount":16,"unpackedSize":265673,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfQA9iCRA9TVsSAnZWagAACQ8P/2kf0Au4jp8Z+FUVp7Ta\nyf8gYjExabtgeTynyvaE5AyvhPtX37WTH1NX0M3kIIARgL5HvwvLACf8/1QY\nw9VIFGsdtWfRuoTUsxbDjhNPrciKknDkVNFVTTkFBdD2XA3Fkqx3LVWqToJa\nZbVsJO213xhuhkf2UYIufPlqHxzkkvtAlGh/bwGlgEOSyecaWuUTzlYOpACT\nAVs+mRi1bjt5P2WSwETVQO4kl99R7sP+FJXAkYkxU6oIQcjPV3z8QHWrCn/x\nr5ITA+/y7U8oM+eoaKfpxvYWhrILad1rMA67N6wvAWPwjoZurgcABwKbDnmq\nLGbFjDRqjfEL91vzR82H/xoG8rBIAXXO8dDHBNRrA8RXd95CuteZSke3dwJC\nB9MeyCI9NdDTdQM8Gnm50Y90iJb0EPt+ZndcmGX6K+Z4VBF/aDnb/ldQEsh/\nd04U7p7sju6efYuYwjwqkZpGGRVUBwHN8VaerxBA2l50jcEqYROP5S3PdnAG\nyQ85STX944iCg2r8qhgrZxhl+QRne3R8d98mUzekqpeM+7+eGEzTBpNE8zbi\nKs7PKkgq7+4/54SCl1R6gPmIBckFcnA5X9zOhOAeFN7DSpmIIjWkND77mNZz\nQZQv2fl07iGct5jQplCDhZJSCNw3PflORuH04XzPb/ITV4FLhfe1iZsUwA6s\nax1M\r\n=g/Un\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICObqnTe224x/nQ5ZRx/bgID6ejjRPDekgGwmEizeqwLAiAaucEYhAIrpo2xen+70ipXX51uqWkE3f51BqJY0/n0ng=="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.6aa47265.0_1598033761909_0.9849390910889695"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.e7202a07.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.e7202a07.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.95e4eeea7.0","@material/line-ripple":"=8.0.0-canary.95e4eeea7.0","@material/mwc-base":"0.19.0-canary.e7202a07.0","@material/mwc-floating-label":"0.19.0-canary.e7202a07.0","@material/mwc-line-ripple":"0.19.0-canary.e7202a07.0","@material/mwc-notched-outline":"0.19.0-canary.e7202a07.0","@material/textfield":"=8.0.0-canary.95e4eeea7.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.e7202a07.0","@material/notched-outline":"=8.0.0-canary.95e4eeea7.0","@material/ripple":"=8.0.0-canary.95e4eeea7.0","@material/shape":"=8.0.0-canary.95e4eeea7.0","@material/theme":"=8.0.0-canary.95e4eeea7.0"},"publishConfig":{"access":"public"},"gitHead":"9c2f6251cc1ab7c3f27cc51409b86305fd50bd2c","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9c2f6251cc1ab7c3f27cc51409b86305fd50bd2c/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9c2f6251cc1ab7c3f27cc51409b86305fd50bd2c/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9c2f6251cc1ab7c3f27cc51409b86305fd50bd2c/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9c2f6251cc1ab7c3f27cc51409b86305fd50bd2c/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9c2f6251cc1ab7c3f27cc51409b86305fd50bd2c/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9c2f6251cc1ab7c3f27cc51409b86305fd50bd2c/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9c2f6251cc1ab7c3f27cc51409b86305fd50bd2c/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9c2f6251cc1ab7c3f27cc51409b86305fd50bd2c/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.e7202a07.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-OMdDsyCjB0KIsCI/eS3w+LHzYR+s0o/Qq+f5rb/cT3qkVJXLvoSz/+x25hnnZhDKUj4oe9tTwTA+uoFTBSt9Dg==","shasum":"94c5041040d1d55354ba6f4625c4991f425ff8f8","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.e7202a07.0.tgz","fileCount":16,"unpackedSize":265673,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfQB8zCRA9TVsSAnZWagAACgkP/jKfrEWuFlU2cv7OZHlK\nm++AxBlFm/WKinNHFlExO5hDBNSywvRMDrmkUI6gsorPi0R4iD/sPc36fAYF\nDWKB606WgwrNmGHzgxCoDagnqom39KHkqtf1QeWaBTTk9fycg8ph92WRq6uw\naU55FOUtzx9xj2QN3AvWsONbspOhQQIMyYng51AYi80N51dWV5LWg6rEka+n\nlLh+sw3Shs9m0FuNkEIE9pqT+DylC8lKJDFohUMlSyvbLzfTpjnxXEAuQreM\nX39nMy9E8cpGGHHhUrk3DGckPaUbRBWEotbzUxuj8SOt5O7MzZIwuQgot31N\nM1zkQf3r+Yw8TRAryaFCjK6d9Dcqs6Bi1RAZo6d2i3H0k20ZHBH3nlBFiKdY\nqxtoPXnZmQoGBvUujUpIjJSilXXgqH77X3uun0en+uKvhTJC/KoA5AzeXN+k\nTvSEdkPwWWkC4Virl5FyLyzt/if5BwMC2RpUOp70r6PKCYrhCcgbqbKcXZdw\nfM68u5n8cRuyjFfh+bSLxSx7VBCM7D2xoiUCwqjziUAYJk++7QjcvLIyh+jf\nDRsHZ8j79lKQ+qupNrPz1qOLEEkC8BMdMhGmywGsN5J70FglvSA+oQiqLZ33\ndkKyz23xughXQu1T1IpMgWMgEh8gXpj8GV5Eg+iMsNixMH1B4bWD7VHDhIpS\nDmQ5\r\n=kDGd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD6QSul8jiba5v9I/d1OJUqOwACnY482699piFpHgs1kAIgFMN02JnTQI/I2/ERJGDNueLvO6f30J60nWNk6fNcaRY="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.e7202a07.0_1598037811484_0.7712427403535562"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.f208201e.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.f208201e.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.238216fc4.0","@material/line-ripple":"=8.0.0-canary.238216fc4.0","@material/mwc-base":"0.19.0-canary.f208201e.0","@material/mwc-floating-label":"0.19.0-canary.f208201e.0","@material/mwc-line-ripple":"0.19.0-canary.f208201e.0","@material/mwc-notched-outline":"0.19.0-canary.f208201e.0","@material/textfield":"=8.0.0-canary.238216fc4.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.f208201e.0","@material/notched-outline":"=8.0.0-canary.238216fc4.0","@material/ripple":"=8.0.0-canary.238216fc4.0","@material/shape":"=8.0.0-canary.238216fc4.0","@material/theme":"=8.0.0-canary.238216fc4.0"},"publishConfig":{"access":"public"},"gitHead":"c666b3346918d8521008d20fa3c20b4cfe3ee481","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c666b3346918d8521008d20fa3c20b4cfe3ee481/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c666b3346918d8521008d20fa3c20b4cfe3ee481/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c666b3346918d8521008d20fa3c20b4cfe3ee481/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c666b3346918d8521008d20fa3c20b4cfe3ee481/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c666b3346918d8521008d20fa3c20b4cfe3ee481/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c666b3346918d8521008d20fa3c20b4cfe3ee481/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c666b3346918d8521008d20fa3c20b4cfe3ee481/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c666b3346918d8521008d20fa3c20b4cfe3ee481/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.f208201e.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-kI3WTRYqAvwTIPF5srFLKU0nQLltd2Hc1PoHKE/U/j8PPkynnnGQ3Q5eOG/OEMH5067Uqi9foLb738Pgebz+7A==","shasum":"ba2b11fe4f2f82b43e317acc2297a43c744ef485","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.f208201e.0.tgz","fileCount":16,"unpackedSize":265673,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfRA7uCRA9TVsSAnZWagAAVnoP/16fCy1YhdboPVO8w/9/\nm/f+jLSIgJap5FDaJoLfWg0koPt2kliUsxGJ+nXDCtEqqwtIg1XasK1fzDH/\nrF05GmMlbzG4opruE9yRkRt30bQ3dbg8Hbe6lIGaliZu0vJy+uLK1Ckf+nuW\nRxUHa7NpclahPzRl3jmYppOK7k2+IU6nTGOejlQGuY5AecNXKrkJELznHzaB\nlEsZLm50Y0kvet69O1s7mdXfiP91gTAHeVqlW13g9FQVn6nDrJP5yuJNYF59\n+uRevHB9VUUipytzaRp2bP88k76cOjVruiY9K+ruifofJdkeAEO29cYmkHo8\n8XSksBhn4axVT5ERkGQfFBd/omAiSFE3Ye8Ia/AG6UlJfUzRMHqujS435fI3\n2m/7gSQr9eLvdQ9VbgzwbW5K9Kg/uKH1YwMEKqf7C9mmxRZahUdjCuCKo4XP\ncskgdnMwDhU+YY1Se7UuLp2udVGCMtczzKcQ7sBx0XIEJ29xNMwh1QA9PLPi\nNxqdvE8yoFaoYFJqP5bs8AaBTPQLQgsrJ8Y2SDtZPUEhNODAibMFYQFO++Fd\n3i2uWHklhSoqH/Tp8GLmzTTX2m9XkO7hu2BdQs3lcIv+50hSIaKJTgkMXB0U\nr4XfBfGm70pFsNv0N8CzuuiMxuY5T9mn5h1BVM8DkYdhXsBBOOmkx3WEy8OR\non01\r\n=mx3L\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDM+NfJL5efraCXmJ8hy2DweX7pkTUNBDFaEfqwBvdgKAIgR8BNAKm5jlGfMwvYNit3c0o1fiHhT8nQBk3CLX3z6xI="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.f208201e.0_1598295789716_0.779490956444185"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.14a172db.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.14a172db.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.238216fc4.0","@material/line-ripple":"=8.0.0-canary.238216fc4.0","@material/mwc-base":"0.19.0-canary.14a172db.0","@material/mwc-floating-label":"0.19.0-canary.14a172db.0","@material/mwc-line-ripple":"0.19.0-canary.14a172db.0","@material/mwc-notched-outline":"0.19.0-canary.14a172db.0","@material/textfield":"=8.0.0-canary.238216fc4.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.14a172db.0","@material/notched-outline":"=8.0.0-canary.238216fc4.0","@material/ripple":"=8.0.0-canary.238216fc4.0","@material/shape":"=8.0.0-canary.238216fc4.0","@material/theme":"=8.0.0-canary.238216fc4.0"},"publishConfig":{"access":"public"},"gitHead":"dae488440593f3d8bdddcbf01a3a6b5343d88761","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/dae488440593f3d8bdddcbf01a3a6b5343d88761/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/dae488440593f3d8bdddcbf01a3a6b5343d88761/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/dae488440593f3d8bdddcbf01a3a6b5343d88761/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/dae488440593f3d8bdddcbf01a3a6b5343d88761/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/dae488440593f3d8bdddcbf01a3a6b5343d88761/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/dae488440593f3d8bdddcbf01a3a6b5343d88761/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/dae488440593f3d8bdddcbf01a3a6b5343d88761/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/dae488440593f3d8bdddcbf01a3a6b5343d88761/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.14a172db.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-WcTVfipKocWd+eGwU3pakf/9NABc6xmKeCtTgJBfQAJcVPv161YrUEdhQw8mNeaCvudQzplOgEmRrCJZKQJrUw==","shasum":"8766770b00f4a1179b57abe67eb9652210cdf661","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.14a172db.0.tgz","fileCount":16,"unpackedSize":265673,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfRWrhCRA9TVsSAnZWagAAUf4P/A4xW8B5mgmC9tLCxTht\nW4jZkh4/oe6hxib360Ix/8hcgh5dpIUmsKDhCTEcI5PGZsoyh2d1TCyLuooF\nkemkXMuTZaZUAIxbky/LT1tfzWIaa6n3RRc4YV1EhXhK+Bot65sbpE3MYxE+\nmv8xcPKIAF9Gt1VpbNuB4N2sntOq08NHmBHvpDp7e6a1bEHJAFysABDgtXvt\nRY3hQg7S2q8CYvn0XDYFn4yUOckCZDKp89zGlmYjQPmksSPwB40F6fk+zI5Z\nJH1mNr2AYLVg4m6gqK/63Yhl6LX7ub/W2Ir+x/KFfGdXqR9nMT1CI+kAtaN1\n2UZ/vSwwWbvs/+83U9t/dc34TL7yBLsqAIdf4vkAq3eVTkcHkDGeJsiMsQSn\nTHQItIEn3TPryBY84q5JZTk100TfwN3wHVJ2qH9NHDo6zQyxKp3jKyRG7bHt\n7lZCgxmXZeCie2cXrrASiqsQkXq666f3L2EGDTB1dcD0IJKCsvbVPZis61Lm\nzKIqN3drks20IXRKfDqWW4vVDhciN9+XcKfrpiJ6ucg9EIxKh3IQ/JaMyrrC\nB8SVzAypEMmvsBZlfCTKMD680k7sCHtlYzUSaLt79a0RzvBgg2/ZKNttgGyB\nLQUiG3Lr67XrCkFFVnz6uCxK6TKlygelsQzLWiikWSPyapCGkunp1UySwAJY\n8iSl\r\n=oLev\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICHnsJVK/cJD+ItQnPQQKu/4MvJUWXDH1c2OOS5yxdYpAiA3lqgTDskR4BwU6SMC7jR32+7xHOAeSGBHQUQF1SEhAg=="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.14a172db.0_1598384864983_0.6894752419246262"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.e6c1038d.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.e6c1038d.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.a1c65593d.0","@material/line-ripple":"=8.0.0-canary.a1c65593d.0","@material/mwc-base":"0.19.0-canary.e6c1038d.0","@material/mwc-floating-label":"0.19.0-canary.e6c1038d.0","@material/mwc-line-ripple":"0.19.0-canary.e6c1038d.0","@material/mwc-notched-outline":"0.19.0-canary.e6c1038d.0","@material/textfield":"=8.0.0-canary.a1c65593d.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.e6c1038d.0","@material/notched-outline":"=8.0.0-canary.a1c65593d.0","@material/ripple":"=8.0.0-canary.a1c65593d.0","@material/shape":"=8.0.0-canary.a1c65593d.0","@material/theme":"=8.0.0-canary.a1c65593d.0"},"publishConfig":{"access":"public"},"gitHead":"6629a242b77f90688959f5a54abc55be3a2dae2a","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6629a242b77f90688959f5a54abc55be3a2dae2a/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6629a242b77f90688959f5a54abc55be3a2dae2a/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6629a242b77f90688959f5a54abc55be3a2dae2a/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6629a242b77f90688959f5a54abc55be3a2dae2a/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6629a242b77f90688959f5a54abc55be3a2dae2a/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6629a242b77f90688959f5a54abc55be3a2dae2a/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6629a242b77f90688959f5a54abc55be3a2dae2a/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6629a242b77f90688959f5a54abc55be3a2dae2a/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.e6c1038d.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-7vWwCEroGcpq7TwsSRzYcJDXJoQdMJEOl1z2upShOnAf1yFiUNuMhmcKc1xQIbYUejTXFcj3fHDLXFz3i73SSg==","shasum":"28b3c75230bbed0f3664eb6f6ec1f2a4c0e688e8","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.e6c1038d.0.tgz","fileCount":16,"unpackedSize":265673,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfSAtdCRA9TVsSAnZWagAAqR4P/ifz+NUfsYaDb26VCGKa\nY5vuWAGF2+CWZ/CmysaOICoDBq6duAeHt9axVDG9WNv8PGcGUDKH15dpmFEl\nICyCtCzf17GTwXhlVEbYZfSid0meyYBsppNGJsQ1IuEUiADP2cs94u2ct4k5\naaBVErUhqqbc3QIkWPsYpRJcZS/qoscSm8OiwoeyTZYMPpMVCPzPMJgOY9wz\nGnnfCu0tg8p/1AMN2d7SgT5UWDfJCz1qNlxXvU5Cz/sdwaurOYloXWIGikSC\nerCzdxm/Lm3aLkmn4nd9Ssv/aUQ+MdzO47WfHn/0JRJiW90FB8TLscbFahHa\n2d0+K/pVMLtzPeApgiLgEI4RZc+0RyM6swRkCvSQDoQ2/hlOvl7maKBsk+5N\nc5o2zcHBmuLldPQy+NLvptuhnITuW/EbLYIxLCmc2lEoC1YqN/+f9Le4qyR+\nI0hzpQaI3Xojdq5hkP046m12EsjhpifmoiOLzakwYJc7TIUqETXW+lk5rmaO\nSzT9dB0ECPD73oBNKPGn/jLHMOGk+34cc4Q0p473uYBzNFQrCPkYllgxRS0f\noSdHglGDzfyPoiZjkwrr48v77srSXVhsDULeAscEexgcW2hH9mcBjYFOizXE\nnojB4e92Yo1gSRKwvp8WYlNuzuVQe1se/ZXdkKLIWOQuIfnMVF5LqY4/2h2p\nJzp9\r\n=Qtl1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFHWQge6ng0loZ11GSw2jmSkN5rAlmhZv2ucO7scob8LAiEAyn7G+9cA0NzhJHQLuIK/BARBIBWaz1U46xRNHCyj2uQ="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.e6c1038d.0_1598557021140_0.3705236163038166"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.34012082.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.34012082.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.238216fc4.0","@material/line-ripple":"=8.0.0-canary.238216fc4.0","@material/mwc-base":"0.19.0-canary.34012082.0","@material/mwc-floating-label":"0.19.0-canary.34012082.0","@material/mwc-line-ripple":"0.19.0-canary.34012082.0","@material/mwc-notched-outline":"0.19.0-canary.34012082.0","@material/textfield":"=8.0.0-canary.238216fc4.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.34012082.0","@material/notched-outline":"=8.0.0-canary.238216fc4.0","@material/ripple":"=8.0.0-canary.238216fc4.0","@material/shape":"=8.0.0-canary.238216fc4.0","@material/theme":"=8.0.0-canary.238216fc4.0"},"publishConfig":{"access":"public"},"gitHead":"2df5ccd57b9ce1a3c2b3ddda99e7e7d8b185ef26","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2df5ccd57b9ce1a3c2b3ddda99e7e7d8b185ef26/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2df5ccd57b9ce1a3c2b3ddda99e7e7d8b185ef26/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2df5ccd57b9ce1a3c2b3ddda99e7e7d8b185ef26/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2df5ccd57b9ce1a3c2b3ddda99e7e7d8b185ef26/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2df5ccd57b9ce1a3c2b3ddda99e7e7d8b185ef26/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2df5ccd57b9ce1a3c2b3ddda99e7e7d8b185ef26/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2df5ccd57b9ce1a3c2b3ddda99e7e7d8b185ef26/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2df5ccd57b9ce1a3c2b3ddda99e7e7d8b185ef26/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.34012082.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-3b5XjE65c1jpv15kj+AuDIwsPCGfcFuWQUhLhfbVfJFEEpI9BIKUAdMp4+p9DNPEzkUUF/y14e90iXL/uUr2qg==","shasum":"106e6d6e2de1a8658e83763ea3ec3fcf6d4c0122","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.34012082.0.tgz","fileCount":16,"unpackedSize":265673,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfSA4DCRA9TVsSAnZWagAAQhMQAJzZIsyKjU1SoKJMzpK+\n2w6zZtxKQpAIT8FYY4dgZ430bbcKm2tAZDEhwhLZf/sHoRLBsKLyOmzFhXP9\nVvoLkwVKee4A6QG/V8zuRQ72sVqWmhKQn7JPZRolrNS//aKJxk0luQdIDKqv\nbrsT3N9BM0/JbQzlgk/QktFOGOZ17TXjiZw7qU+u7xeSy1+fgQaUMYWNjRtN\nTYg+hS4TG4oRRl+SN4MkwNQ7WLBy0ggyTq8A7fbTboKnsK/DWI4IF+XxRbeA\nmVZUW19krHesdoXdB1SumyJ3I9d4eNfjrae0JKdFeR+ss/HkWyK3yz3v6Xa6\njH2jBUB+2eKgtcAPtYsees9JW6KzYFBWRfHg4oVUVli+TtdQZTQzHtaPAvRD\nXh9B3jFYmuyF9d/ibMbRMO6HylvOkzE3fu6JMzF7oK29V55R+uOCd/E4xwyd\nFLjYNoSR5giNlBT+xwSNrGa5ojL4hqv72kidz4InGr0YqcOdX49dB+rNu83Z\nGoT3/Ww/36LXVatq32FtoGv+1ThGldBHQZJofkiEpYzvn50EX1HGtJWpnFVM\nOmeNL6EwFjS6wvlBFhDSK4Tl/I/3QPPs+oveYy7YSM8Z2iZJBE2gsc8IzBG5\nfxnBvcHxfe54DcemnvSHlAqEq9d1Fz+aDJRBG8qfBJqr9yCGqeEb5KN/Mpma\njPjw\r\n=ZL1h\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCPXtw54e6hn4//kyG6EZDaYQkShLWEyahNmJWdxu8vLQIgThEaw75lC/aNxN5JKYRPwRMjm2PwFDEbEjY1364OI0c="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.34012082.0_1598557699225_0.6376412261645863"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.c073f7b8.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.c073f7b8.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.911014711.0","@material/line-ripple":"=8.0.0-canary.911014711.0","@material/mwc-base":"0.19.0-canary.c073f7b8.0","@material/mwc-floating-label":"0.19.0-canary.c073f7b8.0","@material/mwc-line-ripple":"0.19.0-canary.c073f7b8.0","@material/mwc-notched-outline":"0.19.0-canary.c073f7b8.0","@material/textfield":"=8.0.0-canary.911014711.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.c073f7b8.0","@material/notched-outline":"=8.0.0-canary.911014711.0","@material/ripple":"=8.0.0-canary.911014711.0","@material/shape":"=8.0.0-canary.911014711.0","@material/theme":"=8.0.0-canary.911014711.0"},"publishConfig":{"access":"public"},"gitHead":"e16d759d8a3de4908c04fd08603483dbc37b1747","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e16d759d8a3de4908c04fd08603483dbc37b1747/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e16d759d8a3de4908c04fd08603483dbc37b1747/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e16d759d8a3de4908c04fd08603483dbc37b1747/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e16d759d8a3de4908c04fd08603483dbc37b1747/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e16d759d8a3de4908c04fd08603483dbc37b1747/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e16d759d8a3de4908c04fd08603483dbc37b1747/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e16d759d8a3de4908c04fd08603483dbc37b1747/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e16d759d8a3de4908c04fd08603483dbc37b1747/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.c073f7b8.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-QgGN0f9HmSxuP8HfaHOenpKZmxZN0WpTmWXfONomUwjt24RmyWYWOR02PLuztsfEX/PUajC6NLGlyM1N+IORjQ==","shasum":"36180c23051f355ecea7e52181706e7498d46a08","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.c073f7b8.0.tgz","fileCount":16,"unpackedSize":265673,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfSTrqCRA9TVsSAnZWagAAy0MP/21yMkHtJaWJGXYR0VZ5\nBB8/bT2ZiKSZm+Hj+FA3aCtwZVZiM2es+uaPx0SevIg4iIxNiVvx5GrIHF0v\nt1Qe7TeXzBDAcj6BK70R6NQGtq1m7AJW+EC+jkHCa04mOSPwZviub2LMlShw\n3G/mEO4e3KPj3bF7IweL7LJj9Wk0TRRb1YdXGeXUkoO9Uy2aw7Ho+/iM8jUS\n1g/9wHsvV+n1WKBZpH5cMzjo5XtDryXLcLmbCLtZVtIdzLC0/qWem9moTZFg\ndfn/wC3/d916JY+CZxClXxXUVYJtFjIty6Ep5Usw1r4xKMT69cuMaD1osSVU\nyMEuNSDP1jvWHJV1UvQ06Nh6POaj1nPd+7+z3zqa0bgpbOb0sQVjngsZMVJp\nuLpBbMU80tYdZrj/ZBdk0jHdruHivH3ljKG/H+pEUC6B2U+YT1/31IyOf3oL\naJKu5Yx91qW/Tr5+znMWNVr7rj4TRYBQv1CDmvIWx0P8rrHAQd+4HycujALF\nAd4nOzUijQ4OZvz1ZRvlN7iRPz14EdOe5FYmQzLifxUj8IpT9hz34ocUSIrW\nubSrjbxh2S5XIbhI3rpEHic4ygaTZQOt58x0IX9u8g2wfQn2m7iVrd2WxjZL\nhzUdqo+mK4AZf+q5gwIR7oHPimUTkI1WvmL7xsP/vzzdUZGYgUJOaQ3hxQGI\nJ+By\r\n=KLH7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD/yAOtzo7x2Fz/AP1E0P2JL9Xi14Cn2BrfFUyj30z3GgIhAP+S1l6o+1d6uRhVK/7dorzqH++t6G1Tw4zZLZjmK6iI"}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.c073f7b8.0_1598634729586_0.4468349831420071"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.b7ae68ff.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.b7ae68ff.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.911014711.0","@material/line-ripple":"=8.0.0-canary.911014711.0","@material/mwc-base":"0.19.0-canary.b7ae68ff.0","@material/mwc-floating-label":"0.19.0-canary.b7ae68ff.0","@material/mwc-line-ripple":"0.19.0-canary.b7ae68ff.0","@material/mwc-notched-outline":"0.19.0-canary.b7ae68ff.0","@material/textfield":"=8.0.0-canary.911014711.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.b7ae68ff.0","@material/notched-outline":"=8.0.0-canary.911014711.0","@material/ripple":"=8.0.0-canary.911014711.0","@material/shape":"=8.0.0-canary.911014711.0","@material/theme":"=8.0.0-canary.911014711.0"},"publishConfig":{"access":"public"},"gitHead":"2065ba1bc7a6ad7aa6a2c0404136a31018fba984","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2065ba1bc7a6ad7aa6a2c0404136a31018fba984/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2065ba1bc7a6ad7aa6a2c0404136a31018fba984/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2065ba1bc7a6ad7aa6a2c0404136a31018fba984/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2065ba1bc7a6ad7aa6a2c0404136a31018fba984/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2065ba1bc7a6ad7aa6a2c0404136a31018fba984/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2065ba1bc7a6ad7aa6a2c0404136a31018fba984/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2065ba1bc7a6ad7aa6a2c0404136a31018fba984/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2065ba1bc7a6ad7aa6a2c0404136a31018fba984/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.b7ae68ff.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-JkL2mQdGMGNpNepvQ5vnvy58lVQQhJKHqPVjtVhwQKUDXCGfw5EN20XQFLFgCuPe/M3ou/t0NTkLDK69DlRbnQ==","shasum":"8734e15d009991eb1651cce251e7e22602b98e92","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.b7ae68ff.0.tgz","fileCount":13,"unpackedSize":196231,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfSa7oCRA9TVsSAnZWagAAwZ8QAJgdzT6Gque9zUJJjuf0\n6QTDoRzRyw5nPSKaSk7oi6bckPu2efoc+2hha0bto7cVROny/O/oKPwlYUkN\n6sRSITEjhkTpGVrbce9Cl1KloDiseObwEw65FB8S1yrZZ/RHtv4V1PR6vBfA\n8zjYPMAqnLMHYwvEB+mhguYF2cn53jJzdHAX7GtjacyTWnSEDHik5bCyICoT\nbyT1Pt3Uyyo60PpaDPL8jKY4Ujax57X77LmlaDaf8ch+ZV03ObdLsooEv7gb\nNeQWDzS2x3fBcMfE4nJX5amIdeP9sGd1qbnruQRdIc0u2JsNfhXKWZsA8cn6\nG14/slWovulkqg49p/Qt+orvH5qyeRpHYWyLJ6OLAQvdS1LSnw8B+cskq1LO\nQhc42XXl4I3gWBZhdUyG5xmusS4SX/ftgfZstODta9FU5+kaIfT7guAtB+0v\nUh8KWglM7I3Rp9yCJ6gtNTsvX6huM9spfdVTZ+YwaeR1Ue5x/V9q6D6luO+k\nANJG4OOVLwIu3XL0UN0GFGiplRrpkckOrEGm9JEFlTZIC39OK8GKHvQl8GwY\nsQXzOeW0ax7HTUo6sx3qJ5Hvx8VyCrJV2zqIkXwv1i02ExqczFC9ZNUWJfCS\nvFujYL3W/hcznVlylmZzw4a1L3nvOZrZK1Js4J+bCis89J7CIxDYAm4D+TC3\nN7yZ\r\n=yCYf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICMY7n6cvpCaL+AVHLRH9w36b5PdJHcHH5wclBK8HQF9AiBVA90KbWtvSo1z/FHKX/jEzDQm+Lzx7aNH8bIfvqYHig=="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.b7ae68ff.0_1598664424203_0.7267903452028717"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.697e3879.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.697e3879.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.911014711.0","@material/line-ripple":"=8.0.0-canary.911014711.0","@material/mwc-base":"0.19.0-canary.697e3879.0","@material/mwc-floating-label":"0.19.0-canary.697e3879.0","@material/mwc-line-ripple":"0.19.0-canary.697e3879.0","@material/mwc-notched-outline":"0.19.0-canary.697e3879.0","@material/textfield":"=8.0.0-canary.911014711.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.697e3879.0","@material/notched-outline":"=8.0.0-canary.911014711.0","@material/ripple":"=8.0.0-canary.911014711.0","@material/shape":"=8.0.0-canary.911014711.0","@material/theme":"=8.0.0-canary.911014711.0"},"publishConfig":{"access":"public"},"gitHead":"beb4a106ec95684b6ccc8c4af64c083d8462c917","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/beb4a106ec95684b6ccc8c4af64c083d8462c917/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/beb4a106ec95684b6ccc8c4af64c083d8462c917/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/beb4a106ec95684b6ccc8c4af64c083d8462c917/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/beb4a106ec95684b6ccc8c4af64c083d8462c917/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/beb4a106ec95684b6ccc8c4af64c083d8462c917/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/beb4a106ec95684b6ccc8c4af64c083d8462c917/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/beb4a106ec95684b6ccc8c4af64c083d8462c917/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/beb4a106ec95684b6ccc8c4af64c083d8462c917/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.697e3879.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-1kyk9sMZ/QctQCYKMoTPlFE4xpayKOEkpoNdUbyf268d9BcbOnJncYivt2Vi6uHjXVAQ/Ds7OZvP3MMWVfSE2g==","shasum":"a22097e7f222dad67ffbc55ecd31eef72bd00e1e","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.697e3879.0.tgz","fileCount":13,"unpackedSize":196231,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfTuOWCRA9TVsSAnZWagAApzIQAJ4kQ9ouVtzXVCc4bQDg\nW1G75jr9+KAJk9V8LSrMjNpLxCLib3uXq8eRNY9pvXa39aYDJB/ihAU+jty6\ngx6Kd5OgUnQvwo+fEKV3vRBax0qphoIPWa7TFdrUMlDzRKCnobQYLs/leMVr\n1IVz0x0THDNSXCMmn/xGffouGhVvaJOXmEOMbyUp6Qeh5ypaujbElJDZUuWi\nJ4y1mHELSVgDSWD0spDhBklY4dATLGMv7bnmzWpMtSoUIWgEuN3ag+hBEcyi\niDI2PrsQTNnJ6nyAUwAnOxEohwRASOM9A3FSvxgQKrE2QpOBOfAaFu1/S4Qa\nYhKDPqBED21G2VS1Ntr+/ZK9+AMGNMXhXvI+uGSGQIxgwtljXjXzuJ/ce2Sk\nuZh9QesPsVUWAHzASFCStZPfEblLuu9Fe3vcnkYYGu7bGpCIkM5GiSTewnP9\npC6x1qPdAmty4iIlIZ0ZLt7r9sfkkEJ+9v/2AP58M3RFi1sLG/IociA863wW\nJzNuLrDmwS+BQB80AgKt0LpBqH/WncVkPxVPVofFHBOiEQn4gP9gPwm5HIxS\nGlMeeyXzv569+GsoZMZhtDpYU7al55T7ngMgh5SA043PUk7kAPoWbyMPi/cw\nkHshY2b4QzwA1+R7omTPoZNSDpIvkQXafVOhiFEcx3MPSfsPF/jPu0oTIPib\nzgrC\r\n=N37h\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEMCH2optDm0etBcjfAvq37/vPEEZZEayPsaZkb3GmH8A5kCIHhHM/WwKldHVFUovSyeE2pxXl6TEA481DuNAO39gMVN"}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.697e3879.0_1599005590096_0.7883217989751874"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.eafb7991.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.eafb7991.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.911014711.0","@material/line-ripple":"=8.0.0-canary.911014711.0","@material/mwc-base":"0.19.0-canary.eafb7991.0","@material/mwc-floating-label":"0.19.0-canary.eafb7991.0","@material/mwc-line-ripple":"0.19.0-canary.eafb7991.0","@material/mwc-notched-outline":"0.19.0-canary.eafb7991.0","@material/textfield":"=8.0.0-canary.911014711.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.eafb7991.0","@material/notched-outline":"=8.0.0-canary.911014711.0","@material/ripple":"=8.0.0-canary.911014711.0","@material/shape":"=8.0.0-canary.911014711.0","@material/theme":"=8.0.0-canary.911014711.0"},"publishConfig":{"access":"public"},"gitHead":"98841f8d9a2c624210fc6f0bdb87082222279e38","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/98841f8d9a2c624210fc6f0bdb87082222279e38/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/98841f8d9a2c624210fc6f0bdb87082222279e38/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/98841f8d9a2c624210fc6f0bdb87082222279e38/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/98841f8d9a2c624210fc6f0bdb87082222279e38/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/98841f8d9a2c624210fc6f0bdb87082222279e38/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/98841f8d9a2c624210fc6f0bdb87082222279e38/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/98841f8d9a2c624210fc6f0bdb87082222279e38/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/98841f8d9a2c624210fc6f0bdb87082222279e38/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-theme-primary`                             | `#6200ee`             | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`                               | `#b00020`             | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.eafb7991.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-ldzQKF61lN/HscEBhS5Anw6KR1gOJtWxfE7Cl8BzUpqJSxP9T3E4b87TGmVjXscTT6MWX2hvql6r+tVBalW/eQ==","shasum":"cc2d3a5873cb6f30907719ac36d87ae5765fa67e","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.eafb7991.0.tgz","fileCount":13,"unpackedSize":196231,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfTwDoCRA9TVsSAnZWagAAjVIP/jhW7DE3q1Jamr3lB9WC\nnAla2FX/EdRsdp/yYgsFxnT9Wvwjl79y65LtaljC4oTCT1oAfCMbpipqIFKK\nowyNGXB0Up+z5LJBq9HEPExF4DQxuJWqbDg9x6090l2bX5q6yy3bu5irTHs3\nyPxGeqsVdiFMCxxIM/rWbkCQJsEYptGJc/JcVfnK1lIzRkGujwtUmM8l5v0Z\nP6Jj11dOegZfFML9FBbjkKHDWPiVwZo8cB9quYMJCVQT3xLP7eY98ysZ+RUH\nrOdbtXozDTR1b4OILwHU6ztYI8Sx3wQGYETG0+11hdmaQWdhkwB4ugH9ODma\nyRaEtU2L0mqtabMX4HKNblxMiaQRARQoAC5ROSHtKzQpVF564rauGIE8dN6+\nMx1mu3sqwBn3pqE8gwql0TyrRmRBq0rOqN8xPW59NAijfF3An+HOWMZc8wCh\nLSanicKnpJlMiWRrUgSQOfQvWXUdkbBouilEWPskqLWzl5dU7Nm2SpV6JQaU\nLhbn3/4sQoGvdHtWRs4WDP76yhQIkkGFW6NyjjRfZyFUmWvATo0LVMLsFFEY\npLAqQely6OmIR+PvgIH2i8T35qc+HTvdwVf4exDu/4upq5HjtAr41rbfj//S\nWrP3LlKiJZcpyouHcSdXt5NhDqJZKyuGdHhUzIIO4sDtkbCm8xDA04LjJ4zz\nNEjm\r\n=lJ4t\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDwSH2dMl3rB0pA5REIB/94W/RWicVw8eAImfnxzo7cfQIgM7kOg4S/ijvSjeKQhJo4O69kmBBSgXTGrdS4LSgaELU="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.eafb7991.0_1599013095570_0.7615205737863093"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.606642ec.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.606642ec.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.911014711.0","@material/line-ripple":"=8.0.0-canary.911014711.0","@material/mwc-base":"0.19.0-canary.606642ec.0","@material/mwc-floating-label":"0.19.0-canary.606642ec.0","@material/mwc-line-ripple":"0.19.0-canary.606642ec.0","@material/mwc-notched-outline":"0.19.0-canary.606642ec.0","@material/textfield":"=8.0.0-canary.911014711.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.606642ec.0","@material/notched-outline":"=8.0.0-canary.911014711.0","@material/ripple":"=8.0.0-canary.911014711.0","@material/shape":"=8.0.0-canary.911014711.0","@material/theme":"=8.0.0-canary.911014711.0"},"publishConfig":{"access":"public"},"gitHead":"e02eff9a35c3b9c054d88cd2c45d44ac7d81db14","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e02eff9a35c3b9c054d88cd2c45d44ac7d81db14/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e02eff9a35c3b9c054d88cd2c45d44ac7d81db14/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e02eff9a35c3b9c054d88cd2c45d44ac7d81db14/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e02eff9a35c3b9c054d88cd2c45d44ac7d81db14/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e02eff9a35c3b9c054d88cd2c45d44ac7d81db14/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e02eff9a35c3b9c054d88cd2c45d44ac7d81db14/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e02eff9a35c3b9c054d88cd2c45d44ac7d81db14/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e02eff9a35c3b9c054d88cd2c45d44ac7d81db14/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n`--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n`--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.606642ec.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-qRJRzKCyWePwxyu6mw9s+/WSh1yzYE9ssjYHJb9oz42Mj4TgAiujeE5JWfA7O/41ICdEQacZJY/85H9SHVVP0A==","shasum":"fef5039970f31ef849b314230545fc73898d67cd","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.606642ec.0.tgz","fileCount":13,"unpackedSize":196407,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfUBAnCRA9TVsSAnZWagAA9dkP/1mYGB6t4PR0JfrYkBWx\nQVuSJumyKCO/zpvedhJon5z87OYddQ2Ak4uAfgS0a3JzvIT3DHttUdAChLW4\nfNeWTngZPlHw9y5Uqw2mPfvyIlmJTjnPE9TxCHMw8uD2EBbqB9V1775vxfyy\ng1XmGrU09l/gBG6dADiayCFlu9LCMk53/CdJA5V5IZY07jpeFQbzx2/FV8FV\n3H4Xn0KYXX5CUDOmJIKxwDmd8iqBrHeAO9qhTFlzBX9VvG+ODPNnrkjNztX/\nI6GJw5HlX3FF08gDjWhBKBvDe4fp4QO4gxPtmqAZCf9lk5287cWEe9gYlOWb\ntcu7Ih/FzPdIC69aKEz0yXZnGEqrYZ4TPo/4HUewb70jsUyavTh2gLq1+E+O\nXRsPZPvExXQc0gq2Ygg69lC8eXMjpJ1y9DvK6A8DrLHN7o+aXU21qc/lvFQO\nQwFEEtPIaD0LOXOeLfHgQ58WLShWhPvpjxDtdVjBRiY/kPEi2JydJz3xi0ew\nQpkblroBZ5O8QaMjRF23/CMUk3owJ3EurzPT7jFFoIUMhs0hXFj8SPylHJUR\nufX9dJDMiWMFemJkNn+Yl8Q3inS4rDEaQVvfOcdC4UPQMbUklkA9//H7wQKC\nKDpZjgUvdlpFlFi9JoCB4u87klR2MESoSof3iG5kImWXmNsBqPCF4o/cDcZt\nzy8U\r\n=IbNi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH1XZ3LvWeCNbV8hzyzTJZduhuu1+C45detoB9edjGiVAiBLafHLU0D4KpkotWp1nfTUMiZgrRR1jDRW85IQ49h1/A=="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.606642ec.0_1599082534780_0.6788438445393872"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.ddf05c42.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.ddf05c42.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.911014711.0","@material/line-ripple":"=8.0.0-canary.911014711.0","@material/mwc-base":"0.19.0-canary.ddf05c42.0","@material/mwc-floating-label":"0.19.0-canary.ddf05c42.0","@material/mwc-line-ripple":"0.19.0-canary.ddf05c42.0","@material/mwc-notched-outline":"0.19.0-canary.ddf05c42.0","@material/textfield":"=8.0.0-canary.911014711.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.ddf05c42.0","@material/notched-outline":"=8.0.0-canary.911014711.0","@material/ripple":"=8.0.0-canary.911014711.0","@material/shape":"=8.0.0-canary.911014711.0","@material/theme":"=8.0.0-canary.911014711.0"},"publishConfig":{"access":"public"},"gitHead":"1733e660bd96fac32b417696613437f27b2841e8","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1733e660bd96fac32b417696613437f27b2841e8/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1733e660bd96fac32b417696613437f27b2841e8/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1733e660bd96fac32b417696613437f27b2841e8/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1733e660bd96fac32b417696613437f27b2841e8/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1733e660bd96fac32b417696613437f27b2841e8/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1733e660bd96fac32b417696613437f27b2841e8/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1733e660bd96fac32b417696613437f27b2841e8/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1733e660bd96fac32b417696613437f27b2841e8/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.ddf05c42.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-3aOL94m23t3Fu7m2oCwvn38l1ahp3q0IgYp7Vyz13a39TWnZ/n+uXQQV2FXCNHVIIBTb8dCGWwnv3CA5KIcEhg==","shasum":"838e1d2203038a1986ebae1df812a10665f7e53c","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.ddf05c42.0.tgz","fileCount":13,"unpackedSize":196495,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfUPVACRA9TVsSAnZWagAAEAkP/RDlErFki1sq+1oODzqr\nXKI1Nq8wL/W/gs4Ejap41FfvheQVTvv1g4gmTckLdgXf7rDG04ZH6BEs+As8\nK7K/HMGhYpRrphuDKIbz80/e1Jhl6uaicTtJEAonkghnfuwtiBNx30UdsDuv\n3VjmYc/rLqe0bYNiTdg/48R9YzQKzGTXUQvioIsDqiKLT37Rxwukgfa8GahU\na9mvAbgVU1Wi/kCBhaFimgDnl2bqQsPV0q9k/y18RNiLXKv1Qe9zaN9ZV6Pn\nOGfJ2sMU5L+eOWGgr2uEsYHbyXoe/o+fi/dqtjRO2XiayUTDkjHIeh3+hoLc\nWaB0Co4Em6CL0huri9nZoJoWsBqIjICI4tSJerfWEwQ2hnuFLuO/1fHV8ymN\nJB9SG/yCkm7xEGRQE67mu2Z4hAhPcDD2WsYzLtGCXbqr9MwVTFaesx/sjMbi\n3PZb+8t+qZkaxQ3QJOoJAqkObEGasED/5G5+uyxIKQlV03bsmXkVX67krfWS\n3RgiIQ8kNjLPoWLeCkZF2om4IzU/pl8JZAjmVEQSMCZb/MHFUA7Y3XGC45Jh\n2rVUXF6EFS9NsdEdA1zDLIvgwVToCxqrFXr+XTYKH/3GdvqY6M4oGD5XeNkb\nTQ4dmfcYUkIWPVcnvdRGOjGJTgZcgmUVgYE3ifh7ibUEmaeV3k1k7Xhrb3F1\nIlA7\r\n=d3UF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD/alAQOKihDCVrY65YOUOC5KBzZIXJih/p4vkOx4mhVAIhALATa84Y24lkwgERQ2QfsLIjXMqD+opTlS4WxPGLHjtZ"}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.ddf05c42.0_1599141184372_0.8447440810579157"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.b889e6dc.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.b889e6dc.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.911014711.0","@material/line-ripple":"=8.0.0-canary.911014711.0","@material/mwc-base":"0.19.0-canary.b889e6dc.0","@material/mwc-floating-label":"0.19.0-canary.b889e6dc.0","@material/mwc-line-ripple":"0.19.0-canary.b889e6dc.0","@material/mwc-notched-outline":"0.19.0-canary.b889e6dc.0","@material/textfield":"=8.0.0-canary.911014711.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.b889e6dc.0","@material/notched-outline":"=8.0.0-canary.911014711.0","@material/ripple":"=8.0.0-canary.911014711.0","@material/shape":"=8.0.0-canary.911014711.0","@material/theme":"=8.0.0-canary.911014711.0"},"publishConfig":{"access":"public"},"gitHead":"9c47011345ccf89ec21a35053b80a0901ab1d6f3","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9c47011345ccf89ec21a35053b80a0901ab1d6f3/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9c47011345ccf89ec21a35053b80a0901ab1d6f3/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9c47011345ccf89ec21a35053b80a0901ab1d6f3/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9c47011345ccf89ec21a35053b80a0901ab1d6f3/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9c47011345ccf89ec21a35053b80a0901ab1d6f3/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9c47011345ccf89ec21a35053b80a0901ab1d6f3/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9c47011345ccf89ec21a35053b80a0901ab1d6f3/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9c47011345ccf89ec21a35053b80a0901ab1d6f3/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.b889e6dc.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-zw7l+ZCR3mFoSlZh8N7T21qnWZQUcirZUrsyX6apQICWdSdAMfcCoEViZJxauoTlKUcH1k0NhjU6pHfKd1jx9Q==","shasum":"4cd779a237ef51715ec2f20f7d0f1befffb1ce71","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.b889e6dc.0.tgz","fileCount":13,"unpackedSize":196495,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfUPl/CRA9TVsSAnZWagAAzjoP/jyxrrawF3c/EOxwpLLQ\naY28z/i6rnhh7lErsDQzC229Q5ml6GjXlmx4rUHBf5SJlRihhmfQNE8nf8Ip\nqrzRomiPD2JGmGLrHKgkWhDIgK4v16r3ezSFKsRykXYraRV9jdqVnBmXg8hf\nCIJoVc3d6wOhR9B+6qkp0B1M+O6wO3ABSEAqdu+DdlRt57oAKJrnQV6PuPAU\nKqlv1kGPGaib0Ky4pn2lQTeylezg/VpMO98Z3i0AkEvfTxa9J6yUod9/WZst\nnr9JYLdHKSd+X6Y+3wt3/FYfYa421g73PpSSCW7DWkPCB1VANe0rCXvxKyLZ\n8jkhJr2HG1f80PCOLBTIB1kBrcDvWYjOeORZiEBdfXitoQn30gO/Ei5uySEr\nb9YX8j/ggwgw2JBRvkNTWsgUKMVYHVD4OUAAdDKZmSeoKFtqYq5tOS9F70fb\nlvAG+QV+0Jthmx0Icp3N4yjBXBTSKu0fCbktbHZ8Iu9NuFPknRNZio3lhPw4\nB2OH6UQy07S2mfq++fLH7RYVz+xzC8U7SHn1ncMf8pS4671EegzqyrcRILxR\n7KX05y90Ct7/a8SxUVzbLIfXWvtcwwyTUR+If6rAuyEYq6iDIj1wOrxYvX5v\n2DlUpB+F+9Eg3QsFjgGBHzppYWGl15eU8DZePwmd8Zx25w5901SKXm90PAJr\nSYQb\r\n=SVwG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCb0I1yFdY5G3wNUavpNeiqac96U3EKk+IWIONT7Ok43AIgMgyiF/LsmwPxaDaS89+os5qIslmuBolPcve5aK7+6EU="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.b889e6dc.0_1599142271482_0.7448350037882354"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.aabeceb0.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.aabeceb0.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.911014711.0","@material/line-ripple":"=8.0.0-canary.911014711.0","@material/mwc-base":"0.19.0-canary.aabeceb0.0","@material/mwc-floating-label":"0.19.0-canary.aabeceb0.0","@material/mwc-line-ripple":"0.19.0-canary.aabeceb0.0","@material/mwc-notched-outline":"0.19.0-canary.aabeceb0.0","@material/textfield":"=8.0.0-canary.911014711.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.aabeceb0.0","@material/notched-outline":"=8.0.0-canary.911014711.0","@material/ripple":"=8.0.0-canary.911014711.0","@material/shape":"=8.0.0-canary.911014711.0","@material/theme":"=8.0.0-canary.911014711.0"},"publishConfig":{"access":"public"},"gitHead":"f699717c41dd2fd6f77fc62da010cecb621e6991","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f699717c41dd2fd6f77fc62da010cecb621e6991/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f699717c41dd2fd6f77fc62da010cecb621e6991/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f699717c41dd2fd6f77fc62da010cecb621e6991/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f699717c41dd2fd6f77fc62da010cecb621e6991/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f699717c41dd2fd6f77fc62da010cecb621e6991/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f699717c41dd2fd6f77fc62da010cecb621e6991/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f699717c41dd2fd6f77fc62da010cecb621e6991/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f699717c41dd2fd6f77fc62da010cecb621e6991/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.aabeceb0.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-tlJcJVkb0f31atx56uBSB1qeYC2TCsyD2pgtZh1Iid8Nap8YwkuKXDPg0mLJZVf7HuEHZBZ9tzo36sdkNDPz0g==","shasum":"9e087f2a1a7c306706494747acd8f1292b14d65f","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.aabeceb0.0.tgz","fileCount":13,"unpackedSize":196495,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfUUquCRA9TVsSAnZWagAApBIP/3Hq8lfbX2N/u5co+tqZ\n0mnU+ajwfh5JrwJXBsX8ynrcDMKcUIiPSmqdkN7zvbrDVZTp+aqZaLTT+gLS\nFDHU+yb7BHxxygwVGg5zrG1OZaUz90wNXsF6xKj98m+POTkGbdRvk1zhKPQw\naatLA/e6Sre/PO5CHPXcE3wHnIzjzQfqGvkpF0HcamDBWnlHGELltflgmyU/\n8PBAi88rtu8qlpRoyC03ZpnMx2p8f5tVVTy3Unqut2T3F+AI+y7r9Ue64Pg/\nHDE6RvlqYp4BHN4AG8LOMHqbUqLWqHLhh+m8yDhYMh0jPW43wBIkj4z2499o\nGsomPto8HGpWOx8oTxwCQwyCPnncr2d2usID0AHxfkTFDLGcKntqMPKHp+mt\nlu5HwYQofqO4Z3H0gRoaceDvkgZ8J4w6EJWL/LQkoSM/Ikyb7pMk7FJ8UDMl\nPD4y05Hi1DRtA41viDatmyxy9aI43gTYM5Aa2o8JdXr/0b2ngHSEnMDS4oCV\n2gp4kTWA2oHJXF5pRZb0d6x1ji8RaX6yVLMaIYkTEJPir5lt1g61tUUIjoxG\nyoRyLvEjxtLiMKI4HaKtof18ewERyY4egNsehZuVcxV/rros32P0oaek3iZ7\nNEzSHS5kAB9HgFeZCxM6kVraBkzBTc0lJF1bvs/i0Z8x+I+qGjoaUu4ZXcX9\nzpZ7\r\n=NAF4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCE0BZZxZsA9ft8/ebVawDo+hrzHPAg/X84MA6WbdpedwIhAPTEMBSZtTdvUo46d252AunHfiHAtqC3YMPg11uuSCK6"}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.aabeceb0.0_1599163053953_0.3694434372138484"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.d8cca3a6.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.d8cca3a6.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.911014711.0","@material/line-ripple":"=8.0.0-canary.911014711.0","@material/mwc-base":"0.19.0-canary.d8cca3a6.0","@material/mwc-floating-label":"0.19.0-canary.d8cca3a6.0","@material/mwc-line-ripple":"0.19.0-canary.d8cca3a6.0","@material/mwc-notched-outline":"0.19.0-canary.d8cca3a6.0","@material/textfield":"=8.0.0-canary.911014711.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.d8cca3a6.0","@material/notched-outline":"=8.0.0-canary.911014711.0","@material/ripple":"=8.0.0-canary.911014711.0","@material/shape":"=8.0.0-canary.911014711.0","@material/theme":"=8.0.0-canary.911014711.0"},"publishConfig":{"access":"public"},"gitHead":"db99eec046a418490ab66f7fa667607aefc5b26c","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/db99eec046a418490ab66f7fa667607aefc5b26c/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/db99eec046a418490ab66f7fa667607aefc5b26c/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/db99eec046a418490ab66f7fa667607aefc5b26c/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/db99eec046a418490ab66f7fa667607aefc5b26c/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/db99eec046a418490ab66f7fa667607aefc5b26c/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/db99eec046a418490ab66f7fa667607aefc5b26c/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/db99eec046a418490ab66f7fa667607aefc5b26c/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/db99eec046a418490ab66f7fa667607aefc5b26c/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.d8cca3a6.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-4QMAwDFS7Kr1K/Ec0L07+MAA9N9lgRvUDksRB9t3bBOAZ0kgGfVnOAAdxs5C3DiTs+gDlRLmZt2QWAY2bKJvew==","shasum":"3569ccd1012686da52e0c56e47a7a02952f4bc95","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.d8cca3a6.0.tgz","fileCount":13,"unpackedSize":196495,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfUWC2CRA9TVsSAnZWagAAvZAP/jXwASXkH/ddMt1t9lUg\n3dd6qvr54d015/a6KqST04N9tfapOgWNoGobCHEYFm3AD2u5ysSVSdsOUw97\ngN9uDRKi7mT9vEbgHeFMGcnM+E/jz+GQOrx4IaHWa4lpsUaby7GM8gQZxq/b\n9DYGoHLgb6Wtwk7bh3BwrQiiYvmxuj4+Wtd1zZ13PXV/thlXF5ywdZ2YI0Zc\n8TQN/22ihPlHQbatLBIrRnGCJNLTDJdf1rs+DDNY4ZDZhf8gWCmemQ1cIdQq\n7qv2X6L1NEZH1mzv+CCv01OQ+YAFbRhsdBOGoeGK76Y6w4GhIVDssgDBM2z+\n8urhzbJYJDNZDrlEjJgFksi+uRTNymI49A+elgyaueA0A9O9XT6LAAoPuTcH\nNdxd+MYkzQfr2Yc8t0tA7T0bEB5bJJ+JkZ2GWueLUAV2YXXvkQXzBKcNaa+L\nT/AVgoVpQTwC/1HuQb5zmOdgTPRFeDGfQohMe/BtdC7K4EtW0X+Vin4FzGf3\nIvHTxzFfmp7SD6hNOMP9R6Op18ZiylAeL/gWncBfWDJ5tyrCepvOD4pqzoL7\no3hYlu7mFm9ZBf2iQaxTQ7yrAaA1DIfY/LwNldlW7NQ0r1VZRXidyePG9m0u\nrtHChCqQZNVsJYHjFgvjS3O2kH+s6ajkSKx8FvAKNM4+ftvsg4BjzGkHQqzD\n0rlR\r\n=HDGY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC/1QlDRtQ7Alg7qclGwb1B+EQg1/m0j2Uo5GHz1p+CKwIgAIfEzDHl4mDKsgb3oDKD+/pDRZOxEliM6p6kCgfVoEc="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.d8cca3a6.0_1599168693831_0.7173375829801905"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.26d34b2e.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.26d34b2e.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.744bfe5d8.0","@material/line-ripple":"=8.0.0-canary.744bfe5d8.0","@material/mwc-base":"0.19.0-canary.26d34b2e.0","@material/mwc-floating-label":"0.19.0-canary.26d34b2e.0","@material/mwc-line-ripple":"0.19.0-canary.26d34b2e.0","@material/mwc-notched-outline":"0.19.0-canary.26d34b2e.0","@material/textfield":"=8.0.0-canary.744bfe5d8.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.26d34b2e.0","@material/notched-outline":"=8.0.0-canary.744bfe5d8.0","@material/ripple":"=8.0.0-canary.744bfe5d8.0","@material/shape":"=8.0.0-canary.744bfe5d8.0","@material/theme":"=8.0.0-canary.744bfe5d8.0"},"publishConfig":{"access":"public"},"gitHead":"52bb6b8fb277d5ec6b66932a0683e4f2fdeac872","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/52bb6b8fb277d5ec6b66932a0683e4f2fdeac872/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/52bb6b8fb277d5ec6b66932a0683e4f2fdeac872/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/52bb6b8fb277d5ec6b66932a0683e4f2fdeac872/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/52bb6b8fb277d5ec6b66932a0683e4f2fdeac872/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/52bb6b8fb277d5ec6b66932a0683e4f2fdeac872/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/52bb6b8fb277d5ec6b66932a0683e4f2fdeac872/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/52bb6b8fb277d5ec6b66932a0683e4f2fdeac872/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/52bb6b8fb277d5ec6b66932a0683e4f2fdeac872/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.26d34b2e.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-X6ibm4+fKvpTspN6ez9BIyqjvd0tkBLFBYzc+jwtlDofbCNpJK9sgZn3sf5RTQb9pAx5j+mGy117X1293Cw6QA==","shasum":"9c30727a7fde2b7b8d9b5ff2690e364f18d88327","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.26d34b2e.0.tgz","fileCount":13,"unpackedSize":196495,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfUWahCRA9TVsSAnZWagAA3g8QAIGP1UU66qZ5k1Zy3tp4\nXuqmBs2iFr2udrCoqOiKnbIRxVus17w1azI0y1bZBjV5AQ6Z/aayUxNw8smd\nYr1A2lim4pIhA/uJnxdIR7mhfiPhNgSLGxipQf8I3WVQMNzLNxvB64r7qxq9\n05ajAoTjob7q9fr/EOA1FFwLiPhn98nOmJ5ar1GEXRck6yG4v+x0Z5gRMwlc\nqTm2Hio4P4UnV+8Rrj6Lw+xwPwJcqBKWqyCvl26PQvElh+nhMychrXjcUb1k\naq/UQzAAvezqYeA3sAG113UeHcUdvz3RbONNvvRkZNam8RwYzN5Cvf9vIAQg\nzxsC6sG8ycafo8ueVWn2k7ymJaZDTak3vpn/8kO0ap7dkMXyi5JL5RGP7v+t\ndFNoCGB8REiAnn8akQ75dl1kOMq4xG1jVSoX/Y5RrrcvMzhqgvLe4z3XjBv4\np1/IKAz68HIcOK8JPQy+nkbBRTIlT+lJhXMOlkBUw+RIJOOxY+fo0CJQPio6\n9mDvokSf/T/9NrvXAYYEj/LiqNRad3HOyEG64rHC2y5JwtGvpNBI59vJgkL1\nuVjzJVTaaDQ+BaTzIenM5bOPwuDb+4DpfJsWhfDS/oMf9wy5N6KOpW0RmYmD\nRPmxf6brkbeRVDxlUN5N1r+RY2SV4lkMRX/85BUYNR0xVf10o0ZOa9GtN2tV\npLy6\r\n=VosV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDhg5zPJEc2CSWlDIol0NpdiTVceN/9D6MnXWNzu+J9cgIgDWEbjgVNFpkwjDZSB82WN7GJfcT3wlJMAjUcXoustO8="}]},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"acdvorak@gmail.com","name":"acdvorak"},{"email":"allanchen@google.com","name":"allanchen"},{"email":"aomarks@google.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"bonniez@google.com","name":"bonniez"},{"email":"obrien.test@gmail.com","name":"bwobrien"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"kenneth.franqueiro@gmail.com","name":"kfranqueiro"},{"email":"lynnjepsen@google.com","name":"lynnjepsen"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"mattgoo@gmail.com","name":"moog16"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"williamernest@google.com","name":"williamernest"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.26d34b2e.0_1599170209130_0.6527159327971777"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.a1c44494.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.a1c44494.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.744bfe5d8.0","@material/line-ripple":"=8.0.0-canary.744bfe5d8.0","@material/mwc-base":"0.19.0-canary.a1c44494.0","@material/mwc-floating-label":"0.19.0-canary.a1c44494.0","@material/mwc-line-ripple":"0.19.0-canary.a1c44494.0","@material/mwc-notched-outline":"0.19.0-canary.a1c44494.0","@material/textfield":"=8.0.0-canary.744bfe5d8.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.a1c44494.0","@material/notched-outline":"=8.0.0-canary.744bfe5d8.0","@material/ripple":"=8.0.0-canary.744bfe5d8.0","@material/shape":"=8.0.0-canary.744bfe5d8.0","@material/theme":"=8.0.0-canary.744bfe5d8.0"},"publishConfig":{"access":"public"},"gitHead":"ee68077e51a883c9a0728019c33ed96d4563758b","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ee68077e51a883c9a0728019c33ed96d4563758b/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ee68077e51a883c9a0728019c33ed96d4563758b/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ee68077e51a883c9a0728019c33ed96d4563758b/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ee68077e51a883c9a0728019c33ed96d4563758b/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ee68077e51a883c9a0728019c33ed96d4563758b/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ee68077e51a883c9a0728019c33ed96d4563758b/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ee68077e51a883c9a0728019c33ed96d4563758b/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ee68077e51a883c9a0728019c33ed96d4563758b/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.a1c44494.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-szuMcWMTdt/ozvNsebXuv3FtCbF0VZtFdf3O7g5DRw11Hi4x0ZGLw7dO4HldasIe2hyCcJfTkjY8x4Je5XYUzw==","shasum":"e68ae11bcf0da21e0bff897ae77f89269bc33d66","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.a1c44494.0.tgz","fileCount":13,"unpackedSize":196495,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfWVIlCRA9TVsSAnZWagAAUfEP/irLq6CE4C2e2ZLxl2AG\nALieuta2AhhFpdEmmIjuxKja8YAM0xdXpq9Cd8mmZqVezfpREc8jLmOeiHts\nSuhcsVDrL93jcIFlr/+BvXsr7SeFx8cwuiP5xE0ho+rR53697WjHD0UywrYF\nYKdf7x0bI+eludCYg0TrDD+ORtoM4lKvAe15Qi/dezr8WIsW7/HbahndFcM7\nMjK6CV4FlfJQoc699m+Lwl1wFeknRYdgmu04sPNL7iutcbpZbBWJBYksuVIf\nhi3GlG/vWOPaOP8nre0gHA40fEx4VaT4KmQ4Fpqs0Wz6QFhs0J8fvmQU0aHT\nsnMuG3/ConjEEFnf45ePHYokCUzhyIe8MJS2dUiDDfuglyMbYrZCosF4FJ09\nTPgiJfFLA1M9ic1iztClWUjxuOB/dgxeszV7cXYqUUEKOgqROLM0v7L3PPX4\nvkulvBmNaShdA6rzHMpnuonaXcfFUPxZ0WmxULx/9rdImHL4wwPCdOFV8OuL\nmb+ajOKzbpS2uJur2X25UyOFZiJ1/gas7srMndgzqFuPFb1hSFoJPExJqS9o\nzflKhP+7RT+AHZSgOyrc5pGPrrQT8wZS8HLEnMibaOHkhn73MnqoA50Z90/B\nKRLgh8xF92uVcpreZDMl52w63VHsFKQjOZKa9o2g1GMjzOoEE4vayeLAwF8c\n22Od\r\n=xxuI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHB3ZhNt0K+wUVmrDHW7e/ZYzNrOgeJTRVkH1mRgj9eYAiAHKqkVyCSz1fw+5KZ4PNAl6A/tSq5NxTgarPK1kuSEMA=="}]},"maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.a1c44494.0_1599689253270_0.08650056769092784"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.be1cd1e9.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.be1cd1e9.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.744bfe5d8.0","@material/line-ripple":"=8.0.0-canary.744bfe5d8.0","@material/mwc-base":"0.19.0-canary.be1cd1e9.0","@material/mwc-floating-label":"0.19.0-canary.be1cd1e9.0","@material/mwc-line-ripple":"0.19.0-canary.be1cd1e9.0","@material/mwc-notched-outline":"0.19.0-canary.be1cd1e9.0","@material/textfield":"=8.0.0-canary.744bfe5d8.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.be1cd1e9.0","@material/notched-outline":"=8.0.0-canary.744bfe5d8.0","@material/ripple":"=8.0.0-canary.744bfe5d8.0","@material/shape":"=8.0.0-canary.744bfe5d8.0","@material/theme":"=8.0.0-canary.744bfe5d8.0"},"publishConfig":{"access":"public"},"gitHead":"e4ece959ee320d67e92b5c9add79f6f7eb4b2be4","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e4ece959ee320d67e92b5c9add79f6f7eb4b2be4/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e4ece959ee320d67e92b5c9add79f6f7eb4b2be4/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e4ece959ee320d67e92b5c9add79f6f7eb4b2be4/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e4ece959ee320d67e92b5c9add79f6f7eb4b2be4/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e4ece959ee320d67e92b5c9add79f6f7eb4b2be4/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e4ece959ee320d67e92b5c9add79f6f7eb4b2be4/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e4ece959ee320d67e92b5c9add79f6f7eb4b2be4/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e4ece959ee320d67e92b5c9add79f6f7eb4b2be4/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.be1cd1e9.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-5iPtwnL1hlyr9ZH7y8Q2bfi2JS26zBhfBf6nbRsS/MWjJpff8HvL9iTiURGtAemqR+ECo+fmM8YThT94ifAmsg==","shasum":"4a0de28c7dd185a391f85a08b3c5287ec1932164","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.be1cd1e9.0.tgz","fileCount":13,"unpackedSize":196495,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfWlcgCRA9TVsSAnZWagAAVpkQAIdttM/IYX8LO7Gq0U+V\n/459bJHhWWoqFyYmt1L3fNV/Ie2042wEIlKc/9ou8c8yftvnTZcmI5iWQA9K\nHgi0IrS4J8izQSf/MTv+5EynDWtnUDduzuPTqaS/VcmjiqC33EM9bNc94gw/\njC3+MfHWnkQGJUwl3t+TCWp6/l9nsd5N6Y9ujhG63B73hUQYrUSKy8hwj3SH\nfnUf3iUGKcZ17tOsgWQP0KFdMW382DLD4G830awntSzK3KlMpqiXG+y5NA+U\nGNL66xbQyW3gNq5i6PSbB/HjXRXWIaVxbC3ihcVYnpaqEqWR3Ym9UyVDAJe0\npixu879DRjPQCOHfmVHmLsU+KfQbk9V9/U1SVNuhTzixPsEJ2VmYJ+vu19gv\n450tJA8yk9Y1lPrVOb0ovfJeuME3mcalkFygeyL7ffzaqqd64SNudU49LqEu\nMikv+Z5rWpJPot4vRIGmdM+T95z8s554ca6yS37CCIKRDiR32MnXKk5cHWc5\nz/hJN/0EB/9mRdYiZloGVtQYX2aEAJWSvn4bq1x82Ms9kJT67ziUiDIHtYPn\nj2cV5wsnjD+M20sBSBloJoS0FjTZGg3UHyrjgllFbfJF0T+ZP8SdQpl32oHl\n71lWPNd2XV0xBNUjRND+Fc9hQDlv/j4I+yhKuZEZK7voZLHeuooQW1vqjuJ7\nkLPp\r\n=FCyb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCoHh5tujhefrH75NdnmYu41ckrM9wscwgGJsT+f4dBxgIgaysVlN3HvcnR6zHXxEebuephyBqeyb269MKWCa7MhWU="}]},"maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.be1cd1e9.0_1599756064007_0.45460718969963443"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.f094c0ce.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.f094c0ce.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.744bfe5d8.0","@material/line-ripple":"=8.0.0-canary.744bfe5d8.0","@material/mwc-base":"0.19.0-canary.f094c0ce.0","@material/mwc-floating-label":"0.19.0-canary.f094c0ce.0","@material/mwc-line-ripple":"0.19.0-canary.f094c0ce.0","@material/mwc-notched-outline":"0.19.0-canary.f094c0ce.0","@material/textfield":"=8.0.0-canary.744bfe5d8.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.f094c0ce.0","@material/notched-outline":"=8.0.0-canary.744bfe5d8.0","@material/ripple":"=8.0.0-canary.744bfe5d8.0","@material/shape":"=8.0.0-canary.744bfe5d8.0","@material/theme":"=8.0.0-canary.744bfe5d8.0"},"publishConfig":{"access":"public"},"gitHead":"de510bf2f44db6ede47942c88abfee6266225354","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/de510bf2f44db6ede47942c88abfee6266225354/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/de510bf2f44db6ede47942c88abfee6266225354/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/de510bf2f44db6ede47942c88abfee6266225354/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/de510bf2f44db6ede47942c88abfee6266225354/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/de510bf2f44db6ede47942c88abfee6266225354/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/de510bf2f44db6ede47942c88abfee6266225354/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/de510bf2f44db6ede47942c88abfee6266225354/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/de510bf2f44db6ede47942c88abfee6266225354/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.f094c0ce.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-9WV1uY0ykCr4hxnltqgjyULeGm9YTWAj3j505WBQ3FPnlSsywcRoJ+jsUknk6eCjTVXBsubvBnBm4pIUY0nTpg==","shasum":"9f9d44571eb63f3a29e9b4ea991edd05125da704","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.f094c0ce.0.tgz","fileCount":13,"unpackedSize":196495,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfWmQOCRA9TVsSAnZWagAAEXkQAKLMc8FCBFyLSs8TbqMD\nFJgWCSsTeAEJxFRK+7azn166I8SMGg87xdgxCRvTo/kObNa3gGVhGivPg+/g\nCd9VHk1gThYyIV9vn38r8tPEKp0nZydL3EvY0HP2ALPaFQUaz1FvX6cb2hhA\no/NLuEvmK1wOfPAy2JqBNDiFg5petoiCJFDSyX8cIKtH/s3bYX3BwT4RIMXQ\n+OcYlO+esYOUYGmW+hDWsGGEfVmUdpTMRybjmsZx2WKJOFMMkWqP5nItnr2U\ndW7jWV1/Ab3yYTOr8IhNTjfbrul6hKIHZ1fairEluYpJXSe9mL307OY0P0i6\nSum5EruGYbE+988BJB8rKmmd3m9AR1H/wqzPmEMJWIeiVUHm/Az68yT0OETZ\nQy29W8taCftab3l+Epm2cnDVErZ9RtKhDuD/cOZD4YzbUlUX9YDAGwcpa2sq\naFzE/wAJxAvfzYEOxji91HF1IYJP/LLjMNdKbIP9QlZrlwIZn0ZwUKcbabIA\nORzGRSZs8Bs10pmP9fB6PrTbzAg0h6YrJN+K3+3vDjYwcxPNp+FTNFdUS/1H\nlOfcDd33uL7bi+KFnt3WeJj4hjuhkT/KUwP9bGcWH7oDlSsjRiuo+UKU/vAU\nKAfb6ivQmqYrFv8PYSXPi5Kd3ttwMfUvvSQj/JABBF6HAzDCzU605w82lXAR\nT7m+\r\n=pdWN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHShaqSEjn+5iBZFhomvZfjMFZ328M6AT9c+KoNTcee6AiAiPkMSg1RrtofcQUi59mFwfkbAjj61PK0QwHHwmwQitA=="}]},"maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.f094c0ce.0_1599759374478_0.12805808732988933"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.c1261e7d.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.c1261e7d.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.744bfe5d8.0","@material/line-ripple":"=8.0.0-canary.744bfe5d8.0","@material/mwc-base":"0.19.0-canary.c1261e7d.0","@material/mwc-floating-label":"0.19.0-canary.c1261e7d.0","@material/mwc-line-ripple":"0.19.0-canary.c1261e7d.0","@material/mwc-notched-outline":"0.19.0-canary.c1261e7d.0","@material/textfield":"=8.0.0-canary.744bfe5d8.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.c1261e7d.0","@material/notched-outline":"=8.0.0-canary.744bfe5d8.0","@material/ripple":"=8.0.0-canary.744bfe5d8.0","@material/shape":"=8.0.0-canary.744bfe5d8.0","@material/theme":"=8.0.0-canary.744bfe5d8.0"},"publishConfig":{"access":"public"},"gitHead":"d3ed845121c57e24ccb397b137eccd91a179c1d5","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d3ed845121c57e24ccb397b137eccd91a179c1d5/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d3ed845121c57e24ccb397b137eccd91a179c1d5/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d3ed845121c57e24ccb397b137eccd91a179c1d5/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d3ed845121c57e24ccb397b137eccd91a179c1d5/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d3ed845121c57e24ccb397b137eccd91a179c1d5/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d3ed845121c57e24ccb397b137eccd91a179c1d5/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d3ed845121c57e24ccb397b137eccd91a179c1d5/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d3ed845121c57e24ccb397b137eccd91a179c1d5/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.c1261e7d.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-yvJBWW0uiwjvK1u9O6fLxb1tgGacN9ZnsXoMbsMDPwXbLYAM6zLy50VSLILNWtQ7bJitcXrdRyxyGq9DiXUaAg==","shasum":"23d785c9fc4dced36deffb0ee5d518b6850dbca0","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.c1261e7d.0.tgz","fileCount":13,"unpackedSize":196495,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfWuBJCRA9TVsSAnZWagAAc40P/22dA8BYDrb2qbJnEw6z\nNloIbn/LydO7evM8jJIDsVqjSm3wOtCOnPuBTDag6lbM5+eihPwBbk3PY3pH\nKe3noPDaEy21PeWSPIUoK0AI2SpaDz5DxfOHTq/mZEv7i2i3YyQ7qGVxWjrx\nh/t2gRSxCTabgnlFyKQ/+FC/I8puZOM2awl3ZmxZWSPc8kP0QdsLKDe35HvO\nMLcZg1+HnOpp/XhIl3NlyiY47to9E4Vy9dAPMztQ+60dRALrYOGUgBe20JXR\nH1kh8Erz2WtmAJMYEb7yIrT+JCz34hvWMmXvyhHZwSBowSkiWmedcVp/xch8\ni6bKtHTDXrcrGdu5wxnqF7X9MH2DglOFcNndNDKZ/Wkz/NIs8RF56n2LzzJf\nHEp6NF1pwZKIbfzThZIRu531pA8/shMitWsm2QdgjsGtUOQ5yORYRy8csHF2\nheeXkFRn2kcTQBDLOF79cB7EprYwyCSCqNHG53Pw7d2c7J9RqEiWj2J7hNwz\nBuEcu2bFlC3qd1pBDzDpOckBqlSRCu8GMi9hpGVpljA94o4tH+QMXyG6F36Q\n4nrjDcMpDHdVudPFXkI68smqiG1Dv4X4wN3xSVVDNn6KWCWur0mw81DpuwhQ\nmEQJfpL0rxfEz+iwjZQiejzn4GWw0iOGhXatmlRZTqypYzUPnpH1X18N2kb1\ndGID\r\n=KoHe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD6ICzTwJSXjIIzAeDn5g/krhtBFECtP6YOasMJWWVIzgIgI/oyRc3zInZWH6SPqqmuNXbRG/Uq7411p4Bk/djoHCA="}]},"maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.c1261e7d.0_1599791176698_0.302561289525733"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.9b39ed1e.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.9b39ed1e.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.744bfe5d8.0","@material/line-ripple":"=8.0.0-canary.744bfe5d8.0","@material/mwc-base":"0.19.0-canary.9b39ed1e.0","@material/mwc-floating-label":"0.19.0-canary.9b39ed1e.0","@material/mwc-line-ripple":"0.19.0-canary.9b39ed1e.0","@material/mwc-notched-outline":"0.19.0-canary.9b39ed1e.0","@material/textfield":"=8.0.0-canary.744bfe5d8.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.9b39ed1e.0","@material/notched-outline":"=8.0.0-canary.744bfe5d8.0","@material/ripple":"=8.0.0-canary.744bfe5d8.0","@material/shape":"=8.0.0-canary.744bfe5d8.0","@material/theme":"=8.0.0-canary.744bfe5d8.0"},"publishConfig":{"access":"public"},"gitHead":"8fdf88b38d36782496195681d3b1d340ae36fe12","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8fdf88b38d36782496195681d3b1d340ae36fe12/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8fdf88b38d36782496195681d3b1d340ae36fe12/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8fdf88b38d36782496195681d3b1d340ae36fe12/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8fdf88b38d36782496195681d3b1d340ae36fe12/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8fdf88b38d36782496195681d3b1d340ae36fe12/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8fdf88b38d36782496195681d3b1d340ae36fe12/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8fdf88b38d36782496195681d3b1d340ae36fe12/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8fdf88b38d36782496195681d3b1d340ae36fe12/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.9b39ed1e.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-/aERN7TeyK2HIMLvOOZnjSO4nixB77Cq2A9mbPWbizhhteVERj/qxXDCHbFYECIIpOu8ARI6mXARsBPdDLO3OA==","shasum":"29b7eb4c36c16bddd60f75da3f0e02a81d2dee0d","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.9b39ed1e.0.tgz","fileCount":13,"unpackedSize":196495,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfWuB/CRA9TVsSAnZWagAAsJQP/AnvQ1oI157IkIEHE3xb\n3AU1V1bhqFJwetDmHVELhB3wIekq2b8a5NuhMURVM7w4rELgA25Zjt7UoflR\n0R2NEaPisNpsCLWZ+wxFYXYVpdhVNL3wExLIn/sSDyYiwSxSjIV0dVZ2FnLq\nWyrPxx5UBOwqgQkPQxkqxuv2+RHEft0Mj/dWUWFII4yo/POnna/0GUM2Co1X\nHObPZvdIJ65zvl2bHfwx9/Vh585tZPsvuQUVJfYuXHJcpXihggInYLvy4muS\nd3e93O82l2dwATYpCvMI2Fl06BfuwLwrMX74Q9MMPNpZNYvbzS3Ejn1yDR2G\ng1/5EwTl3wpof1Z0EBsI8lbNfHWQUalJBxVw9SwJaI62p7FzN3Y2oflbh+Gc\ndBIab51XAJ2Jy38Q4xKu7Ji7zDqYNPeXYoSbMMrt4R4XZVDAs1ELMwkxaszM\n5rWTHCCPhrqnKiAGgotxvVV7XVaAH+z5Dn3uW9rJDu4uhIbgW6OtJyThQtMP\nVqBZmt9YbRxn9KYv/CuIru1OJG5HQkGbFx8h6vHURakYVIQbcm2IS0Sb4xtu\nixnn/aWZACiaumXEB8Qpwrwa3obSYVc9xBboUKFQABfe3hy4Z0KZ6ATVYA4d\nZ3pIS5AHboQDR7hnnfveSeRtJDCHYp0Ld9ofcY/RCLHI1bWPDig0R1d+WBam\n/l7I\r\n=5OZX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDFANA2Ern9OBI/c0CnVtg5YabSf7HmWLqSkZ9AN78boAIgVxb1gnDZsAu3Ef2XNDyDci9O4WxI1gANWdy/f6NH/Yg="}]},"maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.9b39ed1e.0_1599791230580_0.4918276289976149"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.e67214b3.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.e67214b3.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.744bfe5d8.0","@material/line-ripple":"=8.0.0-canary.744bfe5d8.0","@material/mwc-base":"0.19.0-canary.e67214b3.0","@material/mwc-floating-label":"0.19.0-canary.e67214b3.0","@material/mwc-line-ripple":"0.19.0-canary.e67214b3.0","@material/mwc-notched-outline":"0.19.0-canary.e67214b3.0","@material/textfield":"=8.0.0-canary.744bfe5d8.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.e67214b3.0","@material/notched-outline":"=8.0.0-canary.744bfe5d8.0","@material/ripple":"=8.0.0-canary.744bfe5d8.0","@material/shape":"=8.0.0-canary.744bfe5d8.0","@material/theme":"=8.0.0-canary.744bfe5d8.0"},"publishConfig":{"access":"public"},"gitHead":"9d09adcdde4c822614f34fd4c8fbf1e1b07e558a","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9d09adcdde4c822614f34fd4c8fbf1e1b07e558a/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9d09adcdde4c822614f34fd4c8fbf1e1b07e558a/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9d09adcdde4c822614f34fd4c8fbf1e1b07e558a/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9d09adcdde4c822614f34fd4c8fbf1e1b07e558a/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9d09adcdde4c822614f34fd4c8fbf1e1b07e558a/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9d09adcdde4c822614f34fd4c8fbf1e1b07e558a/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9d09adcdde4c822614f34fd4c8fbf1e1b07e558a/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9d09adcdde4c822614f34fd4c8fbf1e1b07e558a/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.e67214b3.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-GAA4T3PM5nX/mgB+PkmI01c6feJ5R4pYMw5WdFtMlzq4EN9w031VcXj6uPyET3hOMh1FRGguSPicOj95bGFGSw==","shasum":"3c04945d97eebb0a7482c80e2f1d5989817c74f8","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.e67214b3.0.tgz","fileCount":13,"unpackedSize":196495,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfWuGDCRA9TVsSAnZWagAA+f4P+QF8mha3w3TjkUZK2ZKV\nswR8NdnKzJJQdFNZVF5aStV0A/7cTk+B2WjZ4A2UmgCYHZEkdqD6uJNShaZy\nEX7g3sIicl6JE4URw/2+6s2GfG4/PmZKN9qqnNIZU2ZftrnXxK0mbiGbOCvH\nwRgGBn3OTcVtawD1I+1Ayn1W7H1xN3mCBlDvwIkA/G4FAPF0yeYkKCyJaiAc\nGoJFRIHtHx9drK3aDT9t3cc4CWvV21s23ad8UerKkPStgQecZtYjeCgKs44N\n21PbIoz5HSNnpOX0T35ta5qPuXruJ8DJO9rzht8P9ZPMt7d2zQf7EUdaoy5J\nlExsL5rJNi3Jtr8segl0Im+ECraOmiB+KNLOJVKxvPyFl4aYABhtDtV6PqXM\na/NCLcH+HHa/LNH0U6rQ/CHjD3CZqV9JLYrZfAScSRKr2Rg0dKja/W1fLkln\n7PtkunsBmDOcp0XgPRq2zVRhmS9iZIt8YKDeDIUqKomSgpKRtmmZEsFrqvjG\ns31btCdPK+mE4Zt/LXXh305aayH32FeMqJbTqXFCc9oM98M4ReqUMc5gKKhm\nyBeO3MpOwEHZMKVu+TcHAwnOqECrteuTyTuQR0YpkntObtQ1H6lhCTOiFm6u\ne1zEI+grPg8KZRH6sPuLIE18o5Ak3jtjvA1hJypQIZ3JRhRf4tR+/vhnv9E9\nJIXu\r\n=UoX4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCMwIt8EI3r3QDjPcT4APhHPQdOhMpYwdN8XR9Q0d0bawIgdhuGZ2+o2GrSof0uK9cQDYqHrei27EKXImOhqatT8dc="}]},"maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.e67214b3.0_1599791491077_0.2403964174632316"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.36f5da28.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.36f5da28.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.744bfe5d8.0","@material/line-ripple":"=8.0.0-canary.744bfe5d8.0","@material/mwc-base":"0.19.0-canary.36f5da28.0","@material/mwc-floating-label":"0.19.0-canary.36f5da28.0","@material/mwc-line-ripple":"0.19.0-canary.36f5da28.0","@material/mwc-notched-outline":"0.19.0-canary.36f5da28.0","@material/textfield":"=8.0.0-canary.744bfe5d8.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.36f5da28.0","@material/notched-outline":"=8.0.0-canary.744bfe5d8.0","@material/ripple":"=8.0.0-canary.744bfe5d8.0","@material/shape":"=8.0.0-canary.744bfe5d8.0","@material/theme":"=8.0.0-canary.744bfe5d8.0"},"publishConfig":{"access":"public"},"gitHead":"eb828fe61bd1e331e8d6f63a24f6e78d58858a93","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/eb828fe61bd1e331e8d6f63a24f6e78d58858a93/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/eb828fe61bd1e331e8d6f63a24f6e78d58858a93/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/eb828fe61bd1e331e8d6f63a24f6e78d58858a93/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/eb828fe61bd1e331e8d6f63a24f6e78d58858a93/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/eb828fe61bd1e331e8d6f63a24f6e78d58858a93/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/eb828fe61bd1e331e8d6f63a24f6e78d58858a93/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/eb828fe61bd1e331e8d6f63a24f6e78d58858a93/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/eb828fe61bd1e331e8d6f63a24f6e78d58858a93/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.36f5da28.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-jptRXas8z5JAKZwSqecDJTLY5Z1MPvGfa9RsMOWxmQwQN3AjZAruvs3zWndURHmFOQSxVEOnVMgOkBtNZ3rcKQ==","shasum":"9c387aa5db9bbd84abc9e865e7ee8bcb6aadb6bc","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.36f5da28.0.tgz","fileCount":13,"unpackedSize":196495,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfWuIkCRA9TVsSAnZWagAAfrAP/AhlDVGVSjToBksugpyM\n1TKLN8WK07cdEotGhsV6DBzOMmEp7yIqe9jVTHFJVXFNuW5YkLpInMX5i4I1\nArBXCVQpGcZSl85K0D3JKkp3S87Zr33M0YDB/r+NUTQGjeWDpAlY5wflMoH6\nmXqxj9jTtbxPTdTKj9/pcgETDAdkIVteb6ycrAs3iqDJ5+ZvO7HH6lyYOg+K\nhC/42yhhGciVXJA4wOfT0K7JLqvcgb6qF0TsejpTdFzd7/lZV297oWqXotKk\n6Q4pwZ31q/j8EYil5+ceUU4MYB+U42T19i4an4n1ilK7rhzymMVsbjlz90BT\nKImsEAGDvg81j9L9v6/QLdJp9Ex6Biv7PDDo91Dx3mZe+fsWbx2n0l/4mwJo\ng3yhf1BDkHVDjbMZQ282mrSMELY8do4cwayK2FegX63+vXJUgqLakLQavPBc\nGr+GRoKN4GdnPNBh4w2xl1MTp6rK3Qx+lKfh2SRffHdiraRWvRUZDGpRHW2x\nANIQtYyGah9z6NZfwKWjp9NYx/xcId/st9dJcCAHu9gyq7eRSj0BzVcvYoeX\nkrX8yhbe+w2ofW1aC8hFH4Yo7umYhuEvQ2LG5EJwbnal9eyEUgIpqAmTr7c8\naLTxdaY94rbQIj6ByJ6WG1P1noQ7e3DaVLED7EjeU80b2YAEErRkDBeBNTkA\n4J9Y\r\n=o4pn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBNEWi5oCiOOswKyGGTgwMPPLRL+WRI4mc08xgZ4TBp8AiEA7aQ1FccxpR3P+aMMLrue3Pt+UO+SzbC3z0IrTvg8V9c="}]},"maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.36f5da28.0_1599791652017_0.7550168364042951"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.3babab12.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.3babab12.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.744bfe5d8.0","@material/line-ripple":"=8.0.0-canary.744bfe5d8.0","@material/mwc-base":"0.19.0-canary.3babab12.0","@material/mwc-floating-label":"0.19.0-canary.3babab12.0","@material/mwc-line-ripple":"0.19.0-canary.3babab12.0","@material/mwc-notched-outline":"0.19.0-canary.3babab12.0","@material/textfield":"=8.0.0-canary.744bfe5d8.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.3babab12.0","@material/notched-outline":"=8.0.0-canary.744bfe5d8.0","@material/ripple":"=8.0.0-canary.744bfe5d8.0","@material/shape":"=8.0.0-canary.744bfe5d8.0","@material/theme":"=8.0.0-canary.744bfe5d8.0"},"publishConfig":{"access":"public"},"gitHead":"3c0abab82c4079d265dbe68e3b3ce3dcac8519b4","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3c0abab82c4079d265dbe68e3b3ce3dcac8519b4/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3c0abab82c4079d265dbe68e3b3ce3dcac8519b4/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3c0abab82c4079d265dbe68e3b3ce3dcac8519b4/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3c0abab82c4079d265dbe68e3b3ce3dcac8519b4/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3c0abab82c4079d265dbe68e3b3ce3dcac8519b4/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3c0abab82c4079d265dbe68e3b3ce3dcac8519b4/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3c0abab82c4079d265dbe68e3b3ce3dcac8519b4/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3c0abab82c4079d265dbe68e3b3ce3dcac8519b4/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.3babab12.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-4S9OZdk7+nJqvMl/s3RR13/T4zCoUiSuUeynWji0LJI0BR3LtlDVRcBppL5GgHhrFcIP/mBMpo2+784kPtgwGQ==","shasum":"a0f9876a8c59511c356f0d79256e0f0b5565c693","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.3babab12.0.tgz","fileCount":13,"unpackedSize":196495,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfWuLTCRA9TVsSAnZWagAAGGkP/3KCLnzG6M6nYpTn2FFm\nkgjw+Yh7Yp4huo2BbKPVhvw6UaQGn7GbGYxfcK1XSsp91lDbJA0Y0uwkUrCE\nSK9GdgCF+ejemFK01bymUpNupMjM06OnCzqkqz90kj+InDZ3QLQvKVLB7xKR\nWxqRWCbq5fr5KQPYXN2fQnkHos3dbHKDCJ7o8gHOFykx14UmW/DDKDtiyex1\nUH38lVOfUc6atbpaWC4StH0WSPL/Z+pWe0SaMOyZShKpB3kTZQ6xESJAX7R0\n2rjgxuMY1tq5m8WyovGgCg5qtTpxkAL6KKg3UwbOT2PvNsDr8MJKvjtWVPtW\nFYv2AoLzfiPOAIvHcWTsrZ8wRqlNL7ojIETLc23UIE05QoLj27Vu1DCCmFrE\nwAUOV6hzb7mVQA9Qef0u5PQz2YTlXgB9423/2d8h5Kd5MA9bpSCuI+MMF3Kl\nEBSQRjuzFHbxu3+mTinV+F8uh7lqHG1kY0FhfJo0ukUeX4YM1vYtWmg9Fmt+\nAB3t86+V9pgWmbgh4tzQqgFRsGBpI+xx/AoJLQjkeyXRCaLqAzkSFVdjweNh\n4awHvLNEiSu1CV0AIbtKmSECeQJFRaAy/WaTS7zl2nPicFJXgt6LTc0/hN+d\n0NMY6BBETVMCznFMmluIwKjupWWI/RtZutO+PJKq+MHF+odPT7m/ioyKWvR6\nIJND\r\n=e7QH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEAQBCPpQHPRY4scV+b8zGftl8H5TtDb0naJPgM5JRNgAiAT3+yfEMKuFq+c54pSBLg29mAvdowrKSmam5/IqVDvrA=="}]},"maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.3babab12.0_1599791827257_0.8119017383034426"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.a4481e6f.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.a4481e6f.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.744bfe5d8.0","@material/line-ripple":"=8.0.0-canary.744bfe5d8.0","@material/mwc-base":"0.19.0-canary.a4481e6f.0","@material/mwc-floating-label":"0.19.0-canary.a4481e6f.0","@material/mwc-line-ripple":"0.19.0-canary.a4481e6f.0","@material/mwc-notched-outline":"0.19.0-canary.a4481e6f.0","@material/textfield":"=8.0.0-canary.744bfe5d8.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.a4481e6f.0","@material/notched-outline":"=8.0.0-canary.744bfe5d8.0","@material/ripple":"=8.0.0-canary.744bfe5d8.0","@material/shape":"=8.0.0-canary.744bfe5d8.0","@material/theme":"=8.0.0-canary.744bfe5d8.0"},"publishConfig":{"access":"public"},"gitHead":"de37747ea53bd97e6674642d17f239407a14ba71","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/de37747ea53bd97e6674642d17f239407a14ba71/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/de37747ea53bd97e6674642d17f239407a14ba71/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/de37747ea53bd97e6674642d17f239407a14ba71/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/de37747ea53bd97e6674642d17f239407a14ba71/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/de37747ea53bd97e6674642d17f239407a14ba71/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/de37747ea53bd97e6674642d17f239407a14ba71/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/de37747ea53bd97e6674642d17f239407a14ba71/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/de37747ea53bd97e6674642d17f239407a14ba71/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.a4481e6f.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-QCS0hIGm+o0cY9qS/HPKB21op60Wrdyx4Ud8B2L98Fqo9a4cTcteURoouVafOwF7SvT026y01mLJKbSuvsm/tA==","shasum":"43057176702dde08cc10140dc7887c05ab23812c","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.a4481e6f.0.tgz","fileCount":13,"unpackedSize":196495,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfWuWwCRA9TVsSAnZWagAAM24QAJAdcj8Yg0mIO5KlpHj0\njLqLFFTycRRnlPe38nNnEFpLMPCyHQ2Gg1EwePtv3GUpjju3XOpuJncrE8sX\nDo2JilgdsrN7sKW2YMLLuYNsX+smGSaJvbnUnAblxYNtWdnqJ1ozKMf+srtC\nEgu3U4lPrASs/OaSJ6aCRybaS5bby385Q7t6EUeijFmPHENZvVfygYeXkZwZ\nk8ehbGi1ccNEKLcTAIRMP5TA7FnzRtjYKcGzEGxvYPBtpmcQsQajNmaNE9Xw\nTOszvgtbKSbOcAb5PDIxaXJozw2HUFuOIfnDv6nC9b/NdArnsQMIE3qMOhX2\nRa4afhUfC4yt6I/Be4JfK3ouWEhLG7AOsPi7UR86PtkYvsvIfzxywvu+ITsc\n1Bb7ffB50oLOvcyBwyhwumSUy0DA1qbrpQyhL2n7fB3Jw/odq3LJf5WwWDU8\nd3wzJRYQcwSx+a0OK1eN4R7Qy1iHq3I7ynFmA+Q6S3D8h+qyu73BfRD/tsJZ\nU5cFn94IR5XPZynZbP2TtqUVdDxBOEHWLj7dLprjRWslp6SYQpk8GDkUhOPU\naBHpP5+e2Ta7vnNW5r2VyJXu2dY4EUppr8t7w797QOnKSO4XqbMinTibhbko\nRG6lFKhQASquyL9wydW4g7AhzGzGi/QiNUsF77o5e2+Rl4XCJJdYmSaWy+xK\nI9lw\r\n=7VzA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGmLEFM5/2q2eMQRB/2HFmx8d0NqDJbws3ExKIPMQPFzAiEAqobh1vnkUgeMtGpTM0Mx8B1r7agehhrdZm4Lf1e13tI="}]},"maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.a4481e6f.0_1599792559552_0.13428272888076664"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.a9177836.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.a9177836.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.744bfe5d8.0","@material/line-ripple":"=8.0.0-canary.744bfe5d8.0","@material/mwc-base":"0.19.0-canary.a9177836.0","@material/mwc-floating-label":"0.19.0-canary.a9177836.0","@material/mwc-line-ripple":"0.19.0-canary.a9177836.0","@material/mwc-notched-outline":"0.19.0-canary.a9177836.0","@material/textfield":"=8.0.0-canary.744bfe5d8.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.a9177836.0","@material/notched-outline":"=8.0.0-canary.744bfe5d8.0","@material/ripple":"=8.0.0-canary.744bfe5d8.0","@material/shape":"=8.0.0-canary.744bfe5d8.0","@material/theme":"=8.0.0-canary.744bfe5d8.0"},"publishConfig":{"access":"public"},"gitHead":"172468b3d6a388a8fa5360f5754a4a7dec5b878e","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/172468b3d6a388a8fa5360f5754a4a7dec5b878e/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/172468b3d6a388a8fa5360f5754a4a7dec5b878e/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/172468b3d6a388a8fa5360f5754a4a7dec5b878e/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/172468b3d6a388a8fa5360f5754a4a7dec5b878e/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/172468b3d6a388a8fa5360f5754a4a7dec5b878e/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/172468b3d6a388a8fa5360f5754a4a7dec5b878e/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/172468b3d6a388a8fa5360f5754a4a7dec5b878e/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/172468b3d6a388a8fa5360f5754a4a7dec5b878e/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.a9177836.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-SVPkrg74QeblcBKdsFxWRUv+ggya5bRZdtrmJ/Ij8NmPLIQWkREaLa8donSINZBycHxZ02kcO5k6tb5xmb4Ujg==","shasum":"9d67a2a9746b27978b7bf5b4e8f78049ff73572a","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.a9177836.0.tgz","fileCount":13,"unpackedSize":196495,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfW7gwCRA9TVsSAnZWagAAaS8P/3lfTxZMGaHPfX6FWs98\nrAq2vl7Cc5+rmp8KZIvNsjeXmcXLo1IW1xfOBlUuq/XU5Hkkg3zyf2rv61q+\nqgYkq2ddEzsRy5n5CPU0QxDcuTEEHeoIKc0nEEKX/LCV+v2eFJSrZG76MRQn\nQ68POcIwE8B1keootSklfeQMuHfDVtVGpih5jF8VUAOjAgvsSWYfEdEDAtxY\nnXiQrxtOLIE0TqCH/LiwrN81JmPyjdX1yWBmcZSmY7cjOdXmfV5V1VQbaWYl\nugTEydlOi1UBe2rp6QN4p4hxNuU23uO0+UIBMgiQ8Ph/r46ySHYTRvFnl5zP\nHZFZ2iKT9M4FRNBoUY60xJhkp+oDaoZVmACEBjyIbdh5OEkIDc/cdcsH5h3d\nT55n6EInx4AaCot1gFQZKrw5uVT8KyImJTeiRSLNHhkcW0WbHgRGFW7+xaXi\nlR9cUVslFdh7Y3WnTwLmlxenaFfk5yrFtt+0ra+2r8cJleW5OZy8qEw4kKZK\n/pYABcUilms7/8jXTJKIP3Led/vZY3CZFwSe8LPfkM1gmpdBIPkMkLflvVaF\n8g04iDBnpsZUjZ0MGSP0NdprOY/54LunWyw97iMAZYXbO5muRcRfcLbse5qo\n9+HYOnsI0EFzA8j+5WLP/m4FzzLB+PIyu3OYbjuca8ICgvNEzbc2lMFSSHuM\nL3mZ\r\n=7jf0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD+9TJI9ducU1gSLCH808eg/A7OjOBeMUp7Jj8DJv+FPwIhAJN+sq7jTIOhlSTJYKXSjtP1Dj2KuWkzs2urojZ2H4zo"}]},"maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.a9177836.0_1599846447746_0.46681726734503437"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.b102a3c8.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.b102a3c8.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.319bf66de.0","@material/line-ripple":"=8.0.0-canary.319bf66de.0","@material/mwc-base":"0.19.0-canary.b102a3c8.0","@material/mwc-floating-label":"0.19.0-canary.b102a3c8.0","@material/mwc-line-ripple":"0.19.0-canary.b102a3c8.0","@material/mwc-notched-outline":"0.19.0-canary.b102a3c8.0","@material/textfield":"=8.0.0-canary.319bf66de.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.b102a3c8.0","@material/notched-outline":"=8.0.0-canary.319bf66de.0","@material/ripple":"=8.0.0-canary.319bf66de.0","@material/shape":"=8.0.0-canary.319bf66de.0","@material/theme":"=8.0.0-canary.319bf66de.0"},"publishConfig":{"access":"public"},"gitHead":"6e9858879b6405bc690bd677e308d5197c609741","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6e9858879b6405bc690bd677e308d5197c609741/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6e9858879b6405bc690bd677e308d5197c609741/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6e9858879b6405bc690bd677e308d5197c609741/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6e9858879b6405bc690bd677e308d5197c609741/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6e9858879b6405bc690bd677e308d5197c609741/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6e9858879b6405bc690bd677e308d5197c609741/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6e9858879b6405bc690bd677e308d5197c609741/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6e9858879b6405bc690bd677e308d5197c609741/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.b102a3c8.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-IlNNH2uS4hOnK+5CE2SgkFfhFl9SBjA0s/hzNozEn7gwJd8Y9hhE9bZSJJ7rd2E5NExUa1v5V6W3j0Gx/LDK5A==","shasum":"74b76bc9c33a728c673b0672357106eaba438d85","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.b102a3c8.0.tgz","fileCount":13,"unpackedSize":196495,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfX87eCRA9TVsSAnZWagAAXMsP/iMAomUpq/KCPthd18Pj\nUDUWTLmvAXaOh1BPEQ0UYURjDPU9mN2IZFTLA4bUdRRZ2IlOz44VaiR/F/ia\nLSCAxnthY2wFCHFAleuNxpK9Gk4Ts5KKAIMm1LMtYqLhByOiS9Lj5NykAiG6\nhuZsK7p2so/ehPrJ7LxEUm2wx9KJYEgOMYVY6VPpK7EKcCkkPR3Z5dkydTAm\nQ4gGPY5DeRplZ5MYaR5dqMCCZwUk1YqwsuuIg1WEUp0yzvypI0u4sU0djHVd\nsx1F9z/PnR20jQ246dvTYvTle8KjCx5gD7dsX3bbHLnieCy4gexU8AAMyYZc\nYN9/iL5PtoIDvL6j+cWl+8nwAYwsM/cxL2GI85/TbS+yHxxv/Fm+k1zZ1d1M\ne4SKKMR1donCYs13uDt6ZJ5VqupNSF5qmNrxHeMhF0/J+SWxPKEPrak3t9b3\ng45ZzGesEy2G1FLadDyeRkmhL/gUVpsMA3pIBun9CkQN6rQ/nUijRv0BUF9T\n27p5vmUHILAYxFcSN0nmDSjlau8mSBw2Uv8dyjPcSLGalH92Czi2g7Epc1z3\nBUjISqX4bqvWu12vMhjVI/Oc3ZCGIejTDy/ENxM/gpZAsfIPEUJSvj03zs5X\n36iRieyjo0ETtNxA5sGgfYhpB0ZJxFjerOArQ4s+TuOS1EjwIzJHg+15nF1n\nZMAy\r\n=vv6N\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC4trzv3ml5ftF9/X3rTgysz4oIbTwQ07b6iN7z7eyJxgIhAMBz+Fjs06xBaZwd0gSTeVeF2R/kYYMgH/fzW1Qi2m1L"}]},"maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.b102a3c8.0_1600114397849_0.8957191489233094"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.a7fbc707.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.a7fbc707.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.319bf66de.0","@material/line-ripple":"=8.0.0-canary.319bf66de.0","@material/mwc-base":"0.19.0-canary.a7fbc707.0","@material/mwc-floating-label":"0.19.0-canary.a7fbc707.0","@material/mwc-line-ripple":"0.19.0-canary.a7fbc707.0","@material/mwc-notched-outline":"0.19.0-canary.a7fbc707.0","@material/textfield":"=8.0.0-canary.319bf66de.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.a7fbc707.0","@material/notched-outline":"=8.0.0-canary.319bf66de.0","@material/ripple":"=8.0.0-canary.319bf66de.0","@material/shape":"=8.0.0-canary.319bf66de.0","@material/theme":"=8.0.0-canary.319bf66de.0"},"publishConfig":{"access":"public"},"gitHead":"02e804c299cde57ab03b33a403a43803fa9868dc","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/02e804c299cde57ab03b33a403a43803fa9868dc/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/02e804c299cde57ab03b33a403a43803fa9868dc/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/02e804c299cde57ab03b33a403a43803fa9868dc/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/02e804c299cde57ab03b33a403a43803fa9868dc/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/02e804c299cde57ab03b33a403a43803fa9868dc/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/02e804c299cde57ab03b33a403a43803fa9868dc/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/02e804c299cde57ab03b33a403a43803fa9868dc/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/02e804c299cde57ab03b33a403a43803fa9868dc/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.a7fbc707.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-n2JyYXwaCslQuWFUN0lX9E1RVJV/M27clIKOeSfmxlJWKbYPEii2SRGOhBhDeLj2DMdGSdboFa6KbVnRPOtQ5A==","shasum":"0ff8041df40794e8ce24044360c62df1cd47f225","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.a7fbc707.0.tgz","fileCount":13,"unpackedSize":196495,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfYOZKCRA9TVsSAnZWagAAKQUQAIlsPqczKoTepLTsJGM2\nQq6DQoj7NDxVRjLq6gX/wLlbONPhVfAVRHJbggaa+6kCTUtwn1kPrYw+cXn3\n/rno8+02N9/8tK4pxPY/ak7rsWa6/OV0NIlYlSIe7QWA5aXMybRupvJAnNat\nBP6TvptX17hD4bQnpz5/yijxWfCMDjeFuWqoq/WW+XM8zCuYKc7OO9KRYBdt\nHHzGSjFhETR3mvd21azFGR7gBmlcGIFiQkgY5G1Nmg0hOYspv2WmHotbTHIg\n+6R4KB59qxJa9yKONbJbOt7oSSCa4i6sZtZXbWMNCL4a4WklbA05gmLHDPOx\nwN1vpWF16k4MiKh2Kq5JjNXDrbRBZo36YkBS/AvuoLOt9nKTxeMiF04yKeeA\n8X+ICiSujek7bfkzuCIQbbN/RPLaNHmm9WHKybSFv3TKlPRPq2ilwjxdXRvs\ng8VvZzptA5ssTTA16ouLnaSEZtI22YLxmlMetNMb8EaCHJt7ihSlO9wynw9T\n2TzAIwp8yEsA/n8m0brKT9EdwkHyFgkE5cz5Qv/x6m8fv22vrHda2sNCohAD\nsUSSkpaBdDEbP21BangolE4xqr0MitoyxPhjtSNUhYz+kgWwTfvYuplufIs5\n2RoUf1x6+tSCkW92pErVW01Rntkbpm9/oOzLW2YcD1cZxSUcEZZQ71lXtVDT\nOPSy\r\n=lPp8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF2errMMY2Pqw3fagEISTupxCHX1apKrJrWRAaIGTa6NAiAfXLjQzeeANeMAb6el2z2OLETZaOPYfL6T0SY9ffGEpg=="}]},"maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.a7fbc707.0_1600185930149_0.10987723993919163"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.ed6b8660.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.ed6b8660.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.319bf66de.0","@material/line-ripple":"=8.0.0-canary.319bf66de.0","@material/mwc-base":"0.19.0-canary.ed6b8660.0","@material/mwc-floating-label":"0.19.0-canary.ed6b8660.0","@material/mwc-line-ripple":"0.19.0-canary.ed6b8660.0","@material/mwc-notched-outline":"0.19.0-canary.ed6b8660.0","@material/textfield":"=8.0.0-canary.319bf66de.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.ed6b8660.0","@material/notched-outline":"=8.0.0-canary.319bf66de.0","@material/ripple":"=8.0.0-canary.319bf66de.0","@material/shape":"=8.0.0-canary.319bf66de.0","@material/theme":"=8.0.0-canary.319bf66de.0"},"publishConfig":{"access":"public"},"gitHead":"1367f8f205fb56c27d6146b261ef87d62751f903","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1367f8f205fb56c27d6146b261ef87d62751f903/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1367f8f205fb56c27d6146b261ef87d62751f903/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1367f8f205fb56c27d6146b261ef87d62751f903/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1367f8f205fb56c27d6146b261ef87d62751f903/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1367f8f205fb56c27d6146b261ef87d62751f903/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1367f8f205fb56c27d6146b261ef87d62751f903/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1367f8f205fb56c27d6146b261ef87d62751f903/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1367f8f205fb56c27d6146b261ef87d62751f903/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.ed6b8660.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-U9c5FieW5Kn6j1KzbvkxlgsPa2o/s4kqfbPuCs9KU7rhujWGw8QJ+OTu0MNaqo1Zf0ALAXZKiED0WaQDHIDT0g==","shasum":"b1bf2c817ec22e1dc3d27a0f5f80618d173564e6","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.ed6b8660.0.tgz","fileCount":13,"unpackedSize":196495,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfYPjzCRA9TVsSAnZWagAAP38P/idzBPebbFEHvTXsftXL\nqHGlzfVXQOCt2zHGFN/xPNX+tDfRHZMFYw+1Z3FHdxRWEW8+Jz8+S6Gw6b8h\nBe7RHxwZfouCs89FeZgxmi0SaykqTtjk+b4OT/z+mtNAcc8d7TZyBmdciZbn\n47rTK/w26LcFM6PpujFtIkYt5Mfa3OSGM00gJ+NV76J/pM0iqw5yDaozDObO\nsf8iYlbTyMLLp+dxAw7+3rZU+csii5gR/VU4mZQJiFnlkYT4FpO0mlmJk1NP\nKE7dVFBH4Yt7LyEzlsWR6ZZdXyWmwOImBAvYf0Lx5ltpubjktfWKSxbphK4u\n2Yn8IF+13ZPl3RbKtnCc06yNY8eEm4ivM3LXwuJnAw8rd/grcyh4ZP6DcJZ8\nGaURwOi0nrYvFdL1/WfVNpnwqkzMeydnsjyaE80UESQshMgG0lBcxxNO4tmf\nlkQpIRMCv9dlFd8TsTIOkPLnchSCOIOE79/2BpvBLthI/hLM6GEZQ29g1GNy\nK9wjG+CXfVeOC5FQoYYJZkp/guGiSJ4Mb6Id8179bTneM2aV2wCLmfZX262y\nSDaS7DuC4KwQuH2oPu3WMPN7uMCVlQciTXjlWkAQR9mPv24ZVerV6Ppztr2G\nvL+Pr/JnQrg5juqGq5Vlo/Rr5TldjKzqKWtWy3U+h0E7IuS21bky2uRah5nw\nHKkK\r\n=80wu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCehvPz31Dqf2HP3UIPMjePqehGoYSW/HxJktxqxrGsGQIgM9f1VnI55mcda14yk4v5IyKl+jys+cxkMwGJWbkpRoo="}]},"maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.ed6b8660.0_1600190706982_0.0439590153995979"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.9c2331f5.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.9c2331f5.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.319bf66de.0","@material/line-ripple":"=8.0.0-canary.319bf66de.0","@material/mwc-base":"0.19.0-canary.9c2331f5.0","@material/mwc-floating-label":"0.19.0-canary.9c2331f5.0","@material/mwc-line-ripple":"0.19.0-canary.9c2331f5.0","@material/mwc-notched-outline":"0.19.0-canary.9c2331f5.0","@material/textfield":"=8.0.0-canary.319bf66de.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.9c2331f5.0","@material/notched-outline":"=8.0.0-canary.319bf66de.0","@material/ripple":"=8.0.0-canary.319bf66de.0","@material/shape":"=8.0.0-canary.319bf66de.0","@material/theme":"=8.0.0-canary.319bf66de.0"},"publishConfig":{"access":"public"},"gitHead":"59f9c402cf61ed25b9563e2c228a24b4fb13e1cd","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/59f9c402cf61ed25b9563e2c228a24b4fb13e1cd/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/59f9c402cf61ed25b9563e2c228a24b4fb13e1cd/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/59f9c402cf61ed25b9563e2c228a24b4fb13e1cd/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/59f9c402cf61ed25b9563e2c228a24b4fb13e1cd/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/59f9c402cf61ed25b9563e2c228a24b4fb13e1cd/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/59f9c402cf61ed25b9563e2c228a24b4fb13e1cd/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/59f9c402cf61ed25b9563e2c228a24b4fb13e1cd/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/59f9c402cf61ed25b9563e2c228a24b4fb13e1cd/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.9c2331f5.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-3FrB6mSIpO/YeU/HfQ/P4FdOxprvt5wX1Bmb6TCKztL9gHf5uOKGugCe+Z5e8Frrj3MnCOx9qHKial9arlNxfQ==","shasum":"d6841f025abc0059fb61055f8bd853c0cfd35aad","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.9c2331f5.0.tgz","fileCount":13,"unpackedSize":196495,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfYP6eCRA9TVsSAnZWagAACEgP/3PLP8fC1wL3wRJjZn/X\n3W9dcZL2kyuAeMnVT57RvknxH9TJvGfZAtM4n54vFeqZ3rKJfdfGePwdijSm\nt+jwOtYgK1uQUxmm9HvbhWtTfP1sYOF3ETzoT17+KST1WhKruy1UbcgPsO0z\nMpCxZDQSwFIluLVye+nwKqtXFcNpLyciCrM7dSQUmeGWa7vLt+X1E8NwXUTs\npTIcY+H3mTfd3pOL7kQutMGsbjCtg10/Pbr1GZn1qwAUgoATLYnpQeYOYp4N\nB8iOSnzjOxCyrMSMT9wvR17k7PWb+hLqS7pBRwb4tCmbJMpbbbeNOLQNl9zn\nbl+8ER1OgGlm1BOJCnCWGTHAIAarvKA5ncuShUmutvp6gWPnXBf1qNLbFrzb\nJckc98Kx1wcLfZNS1i/g3BDy0VybC2CbhN4dQy/oLlKTCYgQTMj1pL1kD3fW\nNtLc54kRyt4XIp7lcZy4clePx9bppO6KwWn5NIr05jUQPN3PgtIsH4PwHKaC\nuvU5YmjZntkoU8EP83iTSFUxdotriYqmVBpS+DryPuTqqcGmjsJC5srPaR6I\nXVALEu9koP8X3BM2K702OmI1O+I37EN7mR7Vt1PShwGhsLZ843o13eJDcdjk\n8rFQAYkj+rSaiBOuygZ7+CwRMtfqvzlDwzl4MXdtZZCoRabN5ubIiP4/s6gI\nrzq4\r\n=32dV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC4zyK0ShfNkeacvk8Nhbg6Bo2C5iSmoXrS+CF9sLEW4AiEAxx3wl5B8jHgFenk9Po5eEN1GqLMubaYvZeWLTsaDYdA="}]},"maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.9c2331f5.0_1600192157831_0.8848364068877008"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.63a5f088.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.63a5f088.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.a831d4799.0","@material/line-ripple":"=8.0.0-canary.a831d4799.0","@material/mwc-base":"0.19.0-canary.63a5f088.0","@material/mwc-floating-label":"0.19.0-canary.63a5f088.0","@material/mwc-line-ripple":"0.19.0-canary.63a5f088.0","@material/mwc-notched-outline":"0.19.0-canary.63a5f088.0","@material/textfield":"=8.0.0-canary.a831d4799.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.63a5f088.0","@material/notched-outline":"=8.0.0-canary.a831d4799.0","@material/ripple":"=8.0.0-canary.a831d4799.0","@material/shape":"=8.0.0-canary.a831d4799.0","@material/theme":"=8.0.0-canary.a831d4799.0"},"publishConfig":{"access":"public"},"gitHead":"e26f8baf20e7e3a7056a6b95b14cbd94c380a1a3","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e26f8baf20e7e3a7056a6b95b14cbd94c380a1a3/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e26f8baf20e7e3a7056a6b95b14cbd94c380a1a3/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e26f8baf20e7e3a7056a6b95b14cbd94c380a1a3/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e26f8baf20e7e3a7056a6b95b14cbd94c380a1a3/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e26f8baf20e7e3a7056a6b95b14cbd94c380a1a3/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e26f8baf20e7e3a7056a6b95b14cbd94c380a1a3/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e26f8baf20e7e3a7056a6b95b14cbd94c380a1a3/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e26f8baf20e7e3a7056a6b95b14cbd94c380a1a3/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.63a5f088.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-eDBEhCW2yFidLDcrz1Vug2ZOMElLJIPZcQT1VWSdrntCl/66/uNdObmfDq00mE7R7KU1rIDiPhG+84FQleIqqg==","shasum":"5356ed11d473c220a4f01655e9d74ec8a9751cee","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.63a5f088.0.tgz","fileCount":13,"unpackedSize":196495,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfYoWxCRA9TVsSAnZWagAAa94P/3m2BuvSuyChepK4T30J\nnEHXS6a/vq3Bn8OP31rdyYmR9B9t1T7Qj/1u1LPTaZLrW1OJ0PkjA6gB6Knv\nkeFGMIZs9gp6GplMUTUc7Zh1f4n/drswaLUaAChudv3EOoLRvnb2pss0YVNC\n94Nn2ck9CncjDlrqdtVnAVV0DkqcACVNDfK+GUDIay1VGd/VHBEmPvyJTYHp\n0VmASU+20t9dsF9ehloB461UydRnrdmbRXlEBxP7wVsbUjhTJxv45n0tgFVx\nhNQpkQQZsoAHb5JhKsMYQ/Yss4h0F4w+XLfyowWcyy/ejKZh7Edx5xxmCMJs\nNotF0z0jdTYu0C4G1OA5lYiz2WuZzknafja/LJKC03Erxs2aurURqW8t/Ly5\npg90WqSz2I4Q7kqrGQdVW2NV2+bWoLVqfbeBfGYG2l+lghDhnGc3K4airc3k\nszAWhcC0ATc2mPlJYj9FYc82+3Z9Va6dJJoe6PVuzQ56o+09gR/2OJWFrUCL\nDan69vjqANpLFBqK2xYl0edAbjNAHTO599zgTVQt+ExY6TWktS6VhTbJtEKm\nIX3yNjvPTuKOfTCaatfXPX46KkmrvE0Ensh/S/56HMr2UpTXB4HP9zhFdpO+\n9r2CB8oapHDp4Y5lNf/zJithNssIz8vr/m9IfycuFWW9PD7JzHiR6l0kywRH\nUFuU\r\n=McuF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDKMVw8NHaBXQR2MtWA88ZdksTiDY0h0wqAKjjZiq41PQIgTyYbVNS0weWZ2P1eAgDQbokNYkygVi7U1usOtYVBY4g="}]},"maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.63a5f088.0_1600292272609_0.3852672808352222"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.b7995e49.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.b7995e49.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.a831d4799.0","@material/line-ripple":"=8.0.0-canary.a831d4799.0","@material/mwc-base":"0.19.0-canary.b7995e49.0","@material/mwc-floating-label":"0.19.0-canary.b7995e49.0","@material/mwc-line-ripple":"0.19.0-canary.b7995e49.0","@material/mwc-notched-outline":"0.19.0-canary.b7995e49.0","@material/textfield":"=8.0.0-canary.a831d4799.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.b7995e49.0","@material/notched-outline":"=8.0.0-canary.a831d4799.0","@material/ripple":"=8.0.0-canary.a831d4799.0","@material/shape":"=8.0.0-canary.a831d4799.0","@material/theme":"=8.0.0-canary.a831d4799.0"},"publishConfig":{"access":"public"},"gitHead":"18f169aac3491f89184c2463a837b86dba845e82","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/18f169aac3491f89184c2463a837b86dba845e82/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/18f169aac3491f89184c2463a837b86dba845e82/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/18f169aac3491f89184c2463a837b86dba845e82/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/18f169aac3491f89184c2463a837b86dba845e82/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/18f169aac3491f89184c2463a837b86dba845e82/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/18f169aac3491f89184c2463a837b86dba845e82/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/18f169aac3491f89184c2463a837b86dba845e82/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/18f169aac3491f89184c2463a837b86dba845e82/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.b7995e49.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-ofgdzWF8oR8toHsRrBJUbJ9YjBJyMb0S16twFuvNtHsMtffCE6JW2DLySQRIiDctH/q6fGqLYd/o9OjR+x53ng==","shasum":"8171956e1a88d668c06d8d6821cecf2e654cfa0b","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.b7995e49.0.tgz","fileCount":13,"unpackedSize":196495,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfYp8oCRA9TVsSAnZWagAAHgoP/jEbPmaRVlp/sGgqr2Vh\nZksweme1vPnz6qLBcdRhVAYE26m4nfj6HmiQR9DwP2KvVM5Pv3XZ+tyD8PCd\nsPYbgPTRcImdw3KWVZonXaIi2Wb9Oazv43qPsFrQ3V2Zqceh4/v9LB/VkDMr\n4M4XGqUDfkgc8rC+qICmwdVg9Ksp4QkKEp4/C01B/hoWLx396pqiK7wrP63q\nuPlIUQNf/TNa0+/9Q/kNrTUSrG5O8+46zfRLPCPq8ZDDHDDGbKPvkbdWufwa\nIJ65IzR89VfjG6Op36XFeD1aPWTuZzGyVmyP/Heo7QHBQGY93SuC6gFLMjnd\ngeclv3ro5Elj9qx4SQI3n9pWBtqI8r1fy68x4/p7YioK49wB5REvW5VErbzN\nqeQJGP3avu9+jg74/ISZ/iJQM2s5tky1E+fia46nPrSrZIFEfc1nnjxTgPeO\nv++55CGx21bqp8UsHEWruPyXHuYdctQvcP17G/yOM5P41bygnZ39AiDeMaph\ngjGG+i0WtlIy8opiCxtXvdqV/JDYRxkt/MhGUIDy3HwVaPZ5koTw9KKt7Yww\nXNP3kM/h0ivb7rrE9B3vx/RIHVaf4JTbU+gS+uWQbz1hZycAkamD/Yzr+y7l\ncooa2j7Xke1qG3aotW/wfrtvv3n8pSR2U9uFVKgXODpGyHeWNp0V2Z588S7z\nHibx\r\n=Lfxs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDFek1+PSoeTsr4bwD1GjQf3jzLhluCl0ZAl/QI/fhoGAIhAJC9sJHklluUUUVdEjHMyV5XvDbe+DNuHXGJjQbaXc39"}]},"maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.b7995e49.0_1600298792075_0.10604293053078795"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.0da3ec97.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.0da3ec97.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.a831d4799.0","@material/line-ripple":"=8.0.0-canary.a831d4799.0","@material/mwc-base":"0.19.0-canary.0da3ec97.0","@material/mwc-floating-label":"0.19.0-canary.0da3ec97.0","@material/mwc-line-ripple":"0.19.0-canary.0da3ec97.0","@material/mwc-notched-outline":"0.19.0-canary.0da3ec97.0","@material/textfield":"=8.0.0-canary.a831d4799.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.0da3ec97.0","@material/notched-outline":"=8.0.0-canary.a831d4799.0","@material/ripple":"=8.0.0-canary.a831d4799.0","@material/shape":"=8.0.0-canary.a831d4799.0","@material/theme":"=8.0.0-canary.a831d4799.0"},"publishConfig":{"access":"public"},"gitHead":"5f18f76403ebea15763db5e696b84d6d20a3768e","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5f18f76403ebea15763db5e696b84d6d20a3768e/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5f18f76403ebea15763db5e696b84d6d20a3768e/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5f18f76403ebea15763db5e696b84d6d20a3768e/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5f18f76403ebea15763db5e696b84d6d20a3768e/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5f18f76403ebea15763db5e696b84d6d20a3768e/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5f18f76403ebea15763db5e696b84d6d20a3768e/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5f18f76403ebea15763db5e696b84d6d20a3768e/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5f18f76403ebea15763db5e696b84d6d20a3768e/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.0da3ec97.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-p9PGMk2cS0AbG7BbKwgEVWzmIX6nYdA6Nq4GYUzpuYFbCAy65GX0ZO82Oe5sAiJiMJ24vK1FaMP2ld9jofjubQ==","shasum":"72862c5b2747d9d974c72295e27b12db90e72263","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.0da3ec97.0.tgz","fileCount":13,"unpackedSize":196495,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfaSR5CRA9TVsSAnZWagAAMrcP/Rf4cKnZYWkKC6OPE1up\nPhBHHKJK/Pjehfik3VunnPAkSRnVPjYuwsEhag9MsBt/zzay64MkuQ9s6sqp\n1tYdKDx03qaDQD6hXwJ7PyJ/zxi/dqfo1I1Zd853lpMWbWULiiT29KZ20IXf\nun7+l7XTVaBcpMXBekG0L8TCiosNACBZ0+HnV42AhntYUJJuMnQTM8C8oyaQ\neQgjjSL67g6zLF13sFL1yneNTyp/t6YmdvmSD3NnjrKIxSGS030OohQiq661\n+8rNSt1OueTFz8JBP1aA/VTBG0uq6x51B1XXViSqVAFljlCh4reqb1Gw0UX8\n+UbfMLYnVtn51pDpqgZy12G10pcPxGqQYq5sW2dpZFYm/pwvQco6lHKjtP8V\nrOs2o9JlEYWoM0MEL3i37Z8nlpNudp8jPycH2BOKDjHNy5exkUGbTWuPXLAS\nhTo58XzugaerqZcE+7ymzGfZfMgXa8w9gFLiiWFZDDjFTK0Sl6ou2ZF6j7eG\nNyDIjGOyDjx/V/n4/NJQ0+M6Nb/eei/utocC85UwI3IQWFADJL0lCV+oFZya\nTQmKp+jo+y1rSFhz+2/3lIMbxdQBXc+vPG6U0OxGtnM14dmER2sHvbv2pbFi\nhU6k+B9nNV/l3R+uvbBNwjySC1ssZIyGIKkSs13vqgdB4FHddYP7EYbGWnry\nWxp2\r\n=Vz3X\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCBW71caqyYISyW/kbgrdxefD7SD+vjuYe9XRtsPB41JwIhAOnocJcp/2QhjnHaiNQiHDKqC5EYVMCaoAVnnoI+tJmK"}]},"maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.0da3ec97.0_1600726136874_0.35264648449710756"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.a0793c96.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.a0793c96.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.4e5c350c2.0","@material/line-ripple":"=8.0.0-canary.4e5c350c2.0","@material/mwc-base":"0.19.0-canary.a0793c96.0","@material/mwc-floating-label":"0.19.0-canary.a0793c96.0","@material/mwc-line-ripple":"0.19.0-canary.a0793c96.0","@material/mwc-notched-outline":"0.19.0-canary.a0793c96.0","@material/textfield":"=8.0.0-canary.4e5c350c2.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.a0793c96.0","@material/notched-outline":"=8.0.0-canary.4e5c350c2.0","@material/ripple":"=8.0.0-canary.4e5c350c2.0","@material/shape":"=8.0.0-canary.4e5c350c2.0","@material/theme":"=8.0.0-canary.4e5c350c2.0"},"publishConfig":{"access":"public"},"gitHead":"4332e148b28dc28d9b324306eb18987b31a80ca5","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4332e148b28dc28d9b324306eb18987b31a80ca5/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4332e148b28dc28d9b324306eb18987b31a80ca5/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4332e148b28dc28d9b324306eb18987b31a80ca5/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4332e148b28dc28d9b324306eb18987b31a80ca5/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4332e148b28dc28d9b324306eb18987b31a80ca5/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4332e148b28dc28d9b324306eb18987b31a80ca5/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4332e148b28dc28d9b324306eb18987b31a80ca5/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4332e148b28dc28d9b324306eb18987b31a80ca5/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.a0793c96.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-ZNvnbDi/556ZudfBD28bBWmv+9zPbPJtd0ROGgqjzGbQvJ479GcLMpDAoRf9uD6xeblQZm0a/lPPz8XBXMzOPA==","shasum":"2d5af7706a27262b17baf6a9522ddeeb814a5049","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.a0793c96.0.tgz","fileCount":13,"unpackedSize":196495,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfai6fCRA9TVsSAnZWagAATT8QAIDCBaXxyI6KpOsLZIbs\nKDJpJbDGR1O+mSdrEPCWL1z8VcOMGsxQmH+nrGjcige3KbEleAEU+gO7jgnk\n0hUAvCmbium86S/mDi5Qlk7j6rNfnkvHSphBo7Ied3jhPU4wF5MMfzTzwaBg\nXGWRK107o9ZHfxWeTpiHYkf7uQYoCwAP257ByRL+4UmzWlRsv5jsQtTReb+2\n2mekSYuXmAsNo5FYJm2MldFVdup4XZHBx3GyKeWUiRAKhpOE7xI4RFirEdQh\nJhp0Bf/ulsiYrFafB1ixHAxRzXZ6A8y2ptgZpaMx5OeWJpvIfSLJsSCbf/7G\n6oXgn5D2Go97PHekM9ywlwmd/UJXtHZ5SBJvWq7ZLxrJGZ8uDFSlZYVqQnNj\ni0pXfq6DWXnzD/qDm4KPQWTlVD+FWP4HPKa7qmUiv02BKvtFcTgA1DPyU7T0\nxbfWiYC5V0Uo7E5K0iV75wXy4Ypi8IA2w61mn6+Qn/YTA8bEyEJWvqy1yoXV\nVQE4V5Xr0Zl/J/bAdM63hQfbyMfvCoSSAc2MsHSthGAOTTKvDRjQCSfhH9Xu\nQ9ffWRgENiBBy0I/7Og4jTxU8S2XEXFRFuVSI0Zf7/RkINTsfv3eLQzfoy/+\nvmUYJFq6gjJd/KNgjDuWQ2OTuSYCppLC3F4X4k92CmJkoYyIKPRPgrEAvlcE\n+N71\r\n=mkbG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBi25NA5qIhCE9/sytpOOOCcxRU9j7bzI7K3FfvZXywqAiEAvAPDndW1B7TfrMFlEF9fzNznHqNXpY2/Q8N8uZCo+eI="}]},"maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.a0793c96.0_1600794270569_0.9370023465709116"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.06998a3e.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.06998a3e.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.4e5c350c2.0","@material/line-ripple":"=8.0.0-canary.4e5c350c2.0","@material/mwc-base":"0.19.0-canary.06998a3e.0","@material/mwc-floating-label":"0.19.0-canary.06998a3e.0","@material/mwc-line-ripple":"0.19.0-canary.06998a3e.0","@material/mwc-notched-outline":"0.19.0-canary.06998a3e.0","@material/textfield":"=8.0.0-canary.4e5c350c2.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.06998a3e.0","@material/notched-outline":"=8.0.0-canary.4e5c350c2.0","@material/ripple":"=8.0.0-canary.4e5c350c2.0","@material/shape":"=8.0.0-canary.4e5c350c2.0","@material/theme":"=8.0.0-canary.4e5c350c2.0"},"publishConfig":{"access":"public"},"gitHead":"decf3423597b14fccc721d29e0ec911320eee3a2","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/decf3423597b14fccc721d29e0ec911320eee3a2/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/decf3423597b14fccc721d29e0ec911320eee3a2/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/decf3423597b14fccc721d29e0ec911320eee3a2/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/decf3423597b14fccc721d29e0ec911320eee3a2/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/decf3423597b14fccc721d29e0ec911320eee3a2/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/decf3423597b14fccc721d29e0ec911320eee3a2/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/decf3423597b14fccc721d29e0ec911320eee3a2/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/decf3423597b14fccc721d29e0ec911320eee3a2/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.06998a3e.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-5acB4ZUILFB5tUi2g4wnPW0i1hrzyBN7vPjiGEUhqEG2navIO6QdfblBdwPFhgVRlMWz+/SmRg+2BpZDdi/RLA==","shasum":"a4583d7c552ed1fb4a7b898decf4942646b0ba1c","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.06998a3e.0.tgz","fileCount":13,"unpackedSize":196495,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfakGmCRA9TVsSAnZWagAADnMQAJw7an6Um/T6bZkdgFEj\nPc6/2htaRi6SXlc+QwJB/CnXqHoDTIll6THvkZhs+RojbzoNRYs35M+O4K2S\nIooY9Z3TRSSNCZ/v5ppkmgTP/WsJz7st6slyZym/qnEEMGyvN8XqiIdVpK4h\n7057WO93DhVQvFw2mEjXfVw8Cx4vlaau9KnrPURyR9bYvaR2Il0g9Yv7gGlF\n5jmtW9D5pURYSB1Aqgx322EuwwgAsqTJ8IBt3ucVcLHLF5iauKlogNvpyehI\nJERwmPWh3qpilVc0xQAr+qBjQBLaW83sVWxNj+IjJR6WyEX86CSPp/bdrZHu\nOFhQ2TtThuAjImoe7bXbz34eGtRFdT3/uo+hYMNFFyAkcAElQeRqQwaRHstF\naKqrdXrZJkL/5VIeClF7IEOd8/MSwqH3Q69vAuXQKjjHtOUsPSCzLt+hODhW\n4ycEtqcw9nBrtiHM84cfN24KHugm39w3+YUIbe8UlGk6ZjIBiXyP8smgTCet\n79VK4wlG02YEKifKpIptw4QESy3wD8x1NnNCb5ZaC+wreq006sElRafCfgAK\ngzofGs1sn9cxsopl0+MxWGAUlJLc1FL/fdXuoBdAgU3WU1xUwLF2MSh8gmMQ\nH9QjkVcfsrx0NWLD4PpfJMY04g7oBE6cbuW5azy7y9n0xGR0sGFYmljeqkRY\nCgRr\r\n=EX/L\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDEspCbAS0x2FRtULnSamjkcUutNppnmhYGw1u3e0Z/xAiBlU5QUwCMzxvjYpX5JKkGnPi2ON1wwfAmHth9TsxEmTA=="}]},"maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.06998a3e.0_1600799142104_0.09977794262013306"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.3484a90d.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.3484a90d.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.16c563ef7.0","@material/line-ripple":"=8.0.0-canary.16c563ef7.0","@material/mwc-base":"0.19.0-canary.3484a90d.0","@material/mwc-floating-label":"0.19.0-canary.3484a90d.0","@material/mwc-line-ripple":"0.19.0-canary.3484a90d.0","@material/mwc-notched-outline":"0.19.0-canary.3484a90d.0","@material/textfield":"=8.0.0-canary.16c563ef7.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.3484a90d.0","@material/notched-outline":"=8.0.0-canary.16c563ef7.0","@material/ripple":"=8.0.0-canary.16c563ef7.0","@material/shape":"=8.0.0-canary.16c563ef7.0","@material/theme":"=8.0.0-canary.16c563ef7.0"},"publishConfig":{"access":"public"},"gitHead":"9a495a0451ae2f8e95b786a624153a7b57c4760e","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9a495a0451ae2f8e95b786a624153a7b57c4760e/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9a495a0451ae2f8e95b786a624153a7b57c4760e/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9a495a0451ae2f8e95b786a624153a7b57c4760e/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9a495a0451ae2f8e95b786a624153a7b57c4760e/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9a495a0451ae2f8e95b786a624153a7b57c4760e/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9a495a0451ae2f8e95b786a624153a7b57c4760e/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9a495a0451ae2f8e95b786a624153a7b57c4760e/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9a495a0451ae2f8e95b786a624153a7b57c4760e/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.3484a90d.0","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-GpQND9E7AqQHyrGfLKwH4nefJKF6l6mvy3hEVAZj8NZHRPvwTuEtrIec/aaH088O2QAXEMFVtPsYW3j0IEK1gg==","shasum":"e89aef2d9804cff46fe938d7224a88b2e77b64e0","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.3484a90d.0.tgz","fileCount":13,"unpackedSize":196495,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfanTXCRA9TVsSAnZWagAAtxkP/02RKFEVTmhDaZFGD4J7\nryNPhxxoNbhXhcN86KVzytatow9CJNHIygnkQ/E0D+lgBjOytD6KB9fIttoD\nPt0hVV50dkan2Ee5nJ5TaIMpySaEkAN2gSWUnpBMUiRXSaCMOPJ8LN6FUSZb\naAadHIEHH3NzAj7ZlYu2xV68HGF6g8Rpw/cz3grWxuqc/AsT3TNoQBNAcIEr\nt6IdYleQupqh81y9vNwNmegfR/jGbSVgLrsp8Nze2bvo+/OOjGh+QclFXrRc\nuGFx80h4qXtOAZlcwO86/ybv7BZAtH+NVm5oboxROxoQHcaUWu2fU5+rNNNN\nosxzsZpfQJBUmSUHou7Z6UP4c4dgKqJgTxx4frl6MeKDJdIiQ46ztHa4nqqN\nDOj8cTU49OA3Mh1ufa64CidAVrv3SheC0xDSbL0L8fKMnfCjzKTcGCNs9Qjo\nyZdxcgLV65Y/5x/oeIRUr7uGef7cPy1lZuW8qwcsN/J5oGH9TdZw9x23Sbt6\nfpYeVpoEePAlc37noju3jw8ajOrz1oziNKpsDoRTKOjPIfJxOoppHdcPyVxo\n6N9nWh032ykXhMNhwtUTSP94TVpUouotH7voSeXhgeY/H09zGAh9BRlmVc4G\nE5DMf/OrPaWX00y5N8ZhLMjON6/CLOpCYfRN1E+aPXEzIOIG93FwNPG7NAKx\nxtX/\r\n=0ZxD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGTkbQzv5lT7rJekSQ3VXHBL5DgzKSEq22BoG37n/ZEUAiEApdv3QCTnIFRBtzuUhlorvJdVGBfpRSU681/r/oAM5LI="}]},"maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.3484a90d.0_1600812247159_0.8766545728357591"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.3f99af40.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.3f99af40.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.16c563ef7.0","@material/line-ripple":"=8.0.0-canary.16c563ef7.0","@material/mwc-base":"0.19.0-canary.3f99af40.0","@material/mwc-floating-label":"0.19.0-canary.3f99af40.0","@material/mwc-line-ripple":"0.19.0-canary.3f99af40.0","@material/mwc-notched-outline":"0.19.0-canary.3f99af40.0","@material/textfield":"=8.0.0-canary.16c563ef7.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.3f99af40.0","@material/notched-outline":"=8.0.0-canary.16c563ef7.0","@material/ripple":"=8.0.0-canary.16c563ef7.0","@material/shape":"=8.0.0-canary.16c563ef7.0","@material/theme":"=8.0.0-canary.16c563ef7.0"},"publishConfig":{"access":"public"},"gitHead":"9c1a716646d54bc9aebac750a99d1fa752f60d9f","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9c1a716646d54bc9aebac750a99d1fa752f60d9f/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9c1a716646d54bc9aebac750a99d1fa752f60d9f/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9c1a716646d54bc9aebac750a99d1fa752f60d9f/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9c1a716646d54bc9aebac750a99d1fa752f60d9f/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9c1a716646d54bc9aebac750a99d1fa752f60d9f/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9c1a716646d54bc9aebac750a99d1fa752f60d9f/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9c1a716646d54bc9aebac750a99d1fa752f60d9f/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9c1a716646d54bc9aebac750a99d1fa752f60d9f/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.3f99af40.0","_nodeVersion":"10.22.1","_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","dist":{"integrity":"sha512-nfVq0Hw5EzvgA3u/GDouQR3VJC/OsYdQRWJRQQUyL6q/9tavJiIAiT4vUS42o+31py9Fi7mcXV9n/6Emk0UvgA==","shasum":"96e30756d0cb56f0897f8aa7b993d6387f1ba73c","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.3f99af40.0.tgz","fileCount":13,"unpackedSize":196495,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfbSnzCRA9TVsSAnZWagAA59oP/A0l8SnOH6F0kR2pKMlb\ntdJYdSA+0kUoRT9ZSVusoiJWO9sUrdIOZ8jA9Ybl4kYcY+/Iezaa6wOnZlD1\nQqy4bwW6ZHTqCv+zFcSglycju4FGloz0w2Qnu7tah042yYIQLvcDlGIdTKj+\naGwEvwkbL21C1F7sPdwOEglq3fBEpltctNsSEiw/v6kGXze779i1iTRFcgtl\nQSzvYtA0EkojNjOdQV0vwyyAHZ9cCBFnI/IaGpYb1o5Eias35/Q+7AS4Sh3W\n9AVWLicpm9LeAfGJUYXzUdpwLJ5RqfJ3WEMn2iw9bj3q4JewAmgUi0YeRQYO\n0hplKM1rTiKt+a/UaCMjz5rr/z9SzaokxrSkueys+2RPi+vzXGRKZnRru811\nDFJiTyuO4VGKQ6O3JhhzV9/0t8AF8cJMtCjfdvKKfEbXa6EuKyd1Zw3zY6Jl\neDcXM4il3CNoOeQrdH7QheLwaICbPSVyvdD3ixxAkcVVLsr8NjQ0jHdkBelg\nizYLasGEff+b6qEsA6D74tW1XogCfMYx7J+53lSXy62WPcozgVaAqVD8kMwb\n9P34yht/RMwCPnoGOP7+XMC8bubkqIbXtbQykZOOhBHaWP+J6vZ5ch7Tw6W4\nK7y22byLcd3Vjec/pUR30AsZKOw7JygVXSLQP5l466/48HB0U8l3f2WaCodl\n02Yw\r\n=GRy+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCpFT6ZHSAbE7GBZhNE+W406n2NGr66D43OS90jT9w9dQIhANWtow1OvfMVdcs+qlFUJCfyV0JSEBokKXZDo8iQsu2K"}]},"maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.3f99af40.0_1600989682878_0.06730404693249992"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.72aa1129.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.72aa1129.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.d4cd83a85.0","@material/line-ripple":"=8.0.0-canary.d4cd83a85.0","@material/mwc-base":"0.19.0-canary.72aa1129.0","@material/mwc-floating-label":"0.19.0-canary.72aa1129.0","@material/mwc-line-ripple":"0.19.0-canary.72aa1129.0","@material/mwc-notched-outline":"0.19.0-canary.72aa1129.0","@material/textfield":"=8.0.0-canary.d4cd83a85.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.72aa1129.0","@material/notched-outline":"=8.0.0-canary.d4cd83a85.0","@material/ripple":"=8.0.0-canary.d4cd83a85.0","@material/shape":"=8.0.0-canary.d4cd83a85.0","@material/theme":"=8.0.0-canary.d4cd83a85.0"},"publishConfig":{"access":"public"},"gitHead":"b0de5dacb779cde3abc9f66672e5a936030fe63f","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b0de5dacb779cde3abc9f66672e5a936030fe63f/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b0de5dacb779cde3abc9f66672e5a936030fe63f/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b0de5dacb779cde3abc9f66672e5a936030fe63f/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b0de5dacb779cde3abc9f66672e5a936030fe63f/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b0de5dacb779cde3abc9f66672e5a936030fe63f/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b0de5dacb779cde3abc9f66672e5a936030fe63f/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b0de5dacb779cde3abc9f66672e5a936030fe63f/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b0de5dacb779cde3abc9f66672e5a936030fe63f/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.72aa1129.0","_nodeVersion":"10.22.1","_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","dist":{"integrity":"sha512-ZPhFp0n9cDeNzOTxkDnhDRVoL3Frn4OdRZE2655sz6PmXxZz2JcVJJB8fBUlpjoCik81emPLhDuzWXvbO62a1A==","shasum":"35913536e80e020f6f4e455950623ec3222cdd57","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.72aa1129.0.tgz","fileCount":13,"unpackedSize":196495,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfblwFCRA9TVsSAnZWagAA/ckP/A/G/Vz03Bx5pqFoKjDv\nYX69AdD9kh/tha0KkyFhGXPbml9CmR7TRBykb6pmviPpORIC1FMDCMnNqDXB\nY9dQEdTVh4W2vylSTsFXJf1C5Rrc4L9VAKg4Wl6gFirtI5Hf4bstb9M+Vyo/\n8lmIi1RdT/YsN6PwWXuN5AJNayAdFzegksYb1qhcV3VXwJO3awyENU+i+FvY\nAnw34Cq8ig+lIAxgkfa5+3T70S23jE+Zz183Ko94OijFIxQFxXytEr8Uicc+\nlWmSsCuFYGPemvEc1G7bIFKFWLjbbFBNgL4PTW94uRR1A8ncXiDbzGx4RJLI\n+czXZYg6eoqcuzEvgAmGjS1ocGWkyPUnbIdFgyvY2UUrEXUhg+QaNf9disE8\n21+NAOfHTt8uNQnxDPeJwITCsbegQVxiAvhF5hCKsn1ueS0hawzyuDr/0lke\nFt0O4HEZtzSWcsRFtotTNlQKtRTTNuRi3O56DnZ+KKeQMxMK8jI110jNiw9W\nuhORqaQ9SqWbTysLIWjDVc8DZFXGxYwLH8qxF0gaV0K61AcdlauE7reYVwTa\nqNcZ6MYzGmKKhrBWoooWdJIweG9BTAuOj4CXaw3+7yHQ8AMy6/ulUI3gvimr\nI83FW3pkYJTNwFYE+6tSlKKNY+i/sgoSPPGBzuDzsqRDBLxOc2Z0/wjyJBvn\nJGVL\r\n=B2PL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB4uk7oooADn4zISqPL4FQrveKnCxzyyS5XoRtCiqpggAiEAysx9Rzg89/hcD8gofOc1ZR2satKkUuQxsMcCJXZn/Pw="}]},"maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.72aa1129.0_1601068036614_0.8521260428991622"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.394fd3f6.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.394fd3f6.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.d4cd83a85.0","@material/line-ripple":"=8.0.0-canary.d4cd83a85.0","@material/mwc-base":"0.19.0-canary.394fd3f6.0","@material/mwc-floating-label":"0.19.0-canary.394fd3f6.0","@material/mwc-line-ripple":"0.19.0-canary.394fd3f6.0","@material/mwc-notched-outline":"0.19.0-canary.394fd3f6.0","@material/textfield":"=8.0.0-canary.d4cd83a85.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.394fd3f6.0","@material/notched-outline":"=8.0.0-canary.d4cd83a85.0","@material/ripple":"=8.0.0-canary.d4cd83a85.0","@material/shape":"=8.0.0-canary.d4cd83a85.0","@material/theme":"=8.0.0-canary.d4cd83a85.0"},"publishConfig":{"access":"public"},"gitHead":"f7ed30422433da24768cee2e9ee84140331af4e4","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f7ed30422433da24768cee2e9ee84140331af4e4/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f7ed30422433da24768cee2e9ee84140331af4e4/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f7ed30422433da24768cee2e9ee84140331af4e4/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f7ed30422433da24768cee2e9ee84140331af4e4/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f7ed30422433da24768cee2e9ee84140331af4e4/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f7ed30422433da24768cee2e9ee84140331af4e4/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f7ed30422433da24768cee2e9ee84140331af4e4/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f7ed30422433da24768cee2e9ee84140331af4e4/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.394fd3f6.0","_nodeVersion":"10.22.1","_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","dist":{"integrity":"sha512-cDHPLSGqBRvXHGVFvDSEiSEuGeUF/tOS+83wZjyH3BgpV4JdM04tgqQvFecvnINgWpbNSsewcMu+crIhjHHpow==","shasum":"85236f80e66254fb6a6c000780b51fd75b26ebaa","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.394fd3f6.0.tgz","fileCount":13,"unpackedSize":196495,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfce9LCRA9TVsSAnZWagAAFe4QAJ37aSxLc9FO16Q8Ltms\nDukLFLSbD6czqqH9Hp6Ga6E0UbgaC+tgAWWtmx1jFCoFvKxCzlpt7whkLpHT\nkNkaAQOO1nOmMAzUi2C/VlSjQ95l6pTZs+mxd9Fxycr3E7Z5yLqBENdMvXrb\nB8/tjWMcLONt4UL0LlAWQtjWug2lQAeuJ2wsI7TL4ZlFq/UOqvW8cbnTCnjJ\nSBm5oH1MEm3dXt7+MYwbhmxJhXMmSvbGgPinnB3lFaGoLxr6qfCHkaT748M5\nR5P+vCEo4np8bN4aBNdQ+gg4621QhJDv3t0txH4cSeyr99zwbpZkgCUTI1u9\n20BmuAg5Sd36YKeD3nMhDuEC+YNI9+dEXumC9jSJNabG8a4glI+sH+SqiNJ5\noONUxGbzUI7hN12/r1Oxe5M9yVNjsB5PRmUvCcdUEMTJ32tb0xldJZlbcPlK\nsV7LWOe20Q9ST+38mekpdXyrekrL+vBCXJ5+xKXVZF2ydGK/xe6M+RWvcusY\ndD8L461f5sDeBQ67iOYjLLZHV3pbfCkkq8sBKvw4HthBptsTYbrKz2HGPkvU\nhTRgqwSACRpk6M6RsV+ycb6kZk3zCR4g7AtYaQlubbZZ9AaNFVabnAYMdy98\nnrUAc1vbl2Aa/T88cy8TLicCshaAogFgCv6k7m6tFNK+CQBMxA8j9oSehgny\nCgNu\r\n=adNZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBzLrz/MBMB3sJCS5VC2V1N4rqDw/C+IPfpnkh22uwhJAiAnh+BGPV52K/8epy4LAVkOjADF6fLVCSNgSmmt2DrhqQ=="}]},"maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.394fd3f6.0_1601302346318_0.8071819884187807"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.347110f1.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.347110f1.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.d4cd83a85.0","@material/line-ripple":"=8.0.0-canary.d4cd83a85.0","@material/mwc-base":"0.19.0-canary.347110f1.0","@material/mwc-floating-label":"0.19.0-canary.347110f1.0","@material/mwc-line-ripple":"0.19.0-canary.347110f1.0","@material/mwc-notched-outline":"0.19.0-canary.347110f1.0","@material/textfield":"=8.0.0-canary.d4cd83a85.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.347110f1.0","@material/notched-outline":"=8.0.0-canary.d4cd83a85.0","@material/ripple":"=8.0.0-canary.d4cd83a85.0","@material/shape":"=8.0.0-canary.d4cd83a85.0","@material/theme":"=8.0.0-canary.d4cd83a85.0"},"publishConfig":{"access":"public"},"gitHead":"b51682018a9a68b95f2c2cf2ebd16682dc3f2e22","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b51682018a9a68b95f2c2cf2ebd16682dc3f2e22/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b51682018a9a68b95f2c2cf2ebd16682dc3f2e22/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b51682018a9a68b95f2c2cf2ebd16682dc3f2e22/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b51682018a9a68b95f2c2cf2ebd16682dc3f2e22/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b51682018a9a68b95f2c2cf2ebd16682dc3f2e22/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b51682018a9a68b95f2c2cf2ebd16682dc3f2e22/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b51682018a9a68b95f2c2cf2ebd16682dc3f2e22/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b51682018a9a68b95f2c2cf2ebd16682dc3f2e22/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.347110f1.0","_nodeVersion":"10.22.1","_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","dist":{"integrity":"sha512-2VPdMcXvPJ8dxka46o4ASbvoZRyuGMrP5M/lvR+y53z67TA7QnftV9UIEecNCBuYDNXEg0X17XTvT7rp64+fMQ==","shasum":"0ab28c4f1faab69c1050127cbd0e73370e4faf94","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.347110f1.0.tgz","fileCount":13,"unpackedSize":196495,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfchROCRA9TVsSAnZWagAAPoEP+gIfnbbWMEtWORmBFp42\nnabx+hIVK4/qjNzR2ACNU97jKo9/1+ORK2teJ0yzvSvTJPEEE3kA32oXOsiA\nva2rBAqd8yU3pcZ529vh/Y/cu8taDLYJzwa/QP4J2vGZJ1tQKt9k8WHrycjh\nLiGiIrMfGVBaZfBNanB5XKGFsX4HWCdH5P2Nj5rbzouUne+akI5wUT3GuDYD\neZQ2lBhL044YB5iuAcEtBa3yzYARKqxI4tQL347KI8Vii0iZPjBQyOjF5xRW\nTX1iGfjpJqtc2qPgK+bTfmfEpjiG1hgIj8sfNu33d52Ax1AQGZX02wv1W3dc\nbspaNCcbOL4BrqsMn7QXvOiiSHk9moh2uK+ic6NPyrKQkIS3H1wvNSGJG5Xx\n8uNek9eHJjWAupAyv4fAC8AQZ50opcf9KZdlmb/7eBWZ5N3TsdcAPHjRKIyf\nH/4AlEbfIopz9PHNcmPZF8LzwVZb/j9/CGO1bp7+93kzc7lhz2Fl0Q+QYBYh\nVA+VsNbrlvCUk3shgcHdIIm2GNNUiMSuieviMaKA0ELxTP/ZhtC0QlCcHkyU\nzenUYTMJpsgBkrJE3vlU1uJ0GgwjqmKDBLhAaDPRX7IrK1WmmXSBdkfHrHMt\nJlBw7aN0ASj3hNL+fmmT1WsHeAd86Tt6Z6JnX5go1CA8khvlwIBv2VaBB0Gq\n2J6v\r\n=JNwJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEk4t/N/DvwtfBxuz+/eddjMhJG43z2p5BPkA7jEkDgxAiEA8cA2uo+N6kDzofwvhPeNnKq0zWoqZm9g1iWs9ggwwOQ="}]},"maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.347110f1.0_1601311821635_0.8929442427079737"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.5e330bb9.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.5e330bb9.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.d4cd83a85.0","@material/line-ripple":"=8.0.0-canary.d4cd83a85.0","@material/mwc-base":"0.19.0-canary.5e330bb9.0","@material/mwc-floating-label":"0.19.0-canary.5e330bb9.0","@material/mwc-line-ripple":"0.19.0-canary.5e330bb9.0","@material/mwc-notched-outline":"0.19.0-canary.5e330bb9.0","@material/textfield":"=8.0.0-canary.d4cd83a85.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.5e330bb9.0","@material/notched-outline":"=8.0.0-canary.d4cd83a85.0","@material/ripple":"=8.0.0-canary.d4cd83a85.0","@material/shape":"=8.0.0-canary.d4cd83a85.0","@material/theme":"=8.0.0-canary.d4cd83a85.0"},"publishConfig":{"access":"public"},"gitHead":"edd7d263d4d4dfba81c2b086b08b2be10b533b2b","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/edd7d263d4d4dfba81c2b086b08b2be10b533b2b/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/edd7d263d4d4dfba81c2b086b08b2be10b533b2b/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/edd7d263d4d4dfba81c2b086b08b2be10b533b2b/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/edd7d263d4d4dfba81c2b086b08b2be10b533b2b/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/edd7d263d4d4dfba81c2b086b08b2be10b533b2b/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/edd7d263d4d4dfba81c2b086b08b2be10b533b2b/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/edd7d263d4d4dfba81c2b086b08b2be10b533b2b/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/edd7d263d4d4dfba81c2b086b08b2be10b533b2b/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.5e330bb9.0","_nodeVersion":"10.22.1","_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","dist":{"integrity":"sha512-IwVXINmqm4mEIIlM8xz0PGOL1C6uR18G5p2lLOeHEDi0lIajmu5hiqjko4t7LtuFTOzES2sd3WH7NSendBVeaA==","shasum":"c49a5b682038440b4296c467cf0631ea59a40a6a","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.5e330bb9.0.tgz","fileCount":13,"unpackedSize":196495,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfdQAnCRA9TVsSAnZWagAAZeMP/RReji2avBgqBHaNc+7b\nfmPVFsr7Z0+F3s/UFUI2Ok8sccb0jrpbEZC7b9Glqd0n11zioTQF95Fx0TXU\n9EESpwze6j9aL8bD+tj1+QSaxjEY5aCozYit/tg2Vcij6bUdawqhXjJRxovW\nsBe91pm9tPRfwJsaT418asjOlQ8WpywJ/51BJPm9bz/U2s+0dNBfr9u4rImv\nS5auNRn8mkXdQspVvY0rSn5vbhCW107Ahk4M2JQ8wOCwlwuJewql7i3zIwK6\nW5egl7DKe0RbHuTFRKhpVavSH2xtw2b2YbEH3GFkrdDRpuJL7bmgE6dh9tYg\no7MInaAZBH6L4zA8/YeE/WupLdBig+6t8y3Uy1xmjylA2XwY6T5mrHFfhvRb\nKt7g++5rTQqywql5XYSuocRrpFi+piuZJSUoguDd/OjGWt1juXgFKy/RiOyv\ngT7qVfb1WIoMVNgHhi7+rSdDs8RtDIWCEF7d2DeiwXvj3cJMwsQy8nX3EEAj\nYuLmLSlBrsiI5LnA6+cwCp1hAfUXy3maqceGtlwNFJiF2gE8ncwM+KTga/3o\n71pxvHu8ZU8HSQenApxLyRr4prA0AMA6+GrUHajxBbFGZ88q+1Bn3EfIXTcF\ni5JjkLk7tQ6Ht3EeEsp4J/X2obaISEVJPavNHkNgI5A1XXGidUgz0BCa6cpv\nAJWs\r\n=ES+8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBTN8XmYEjfYDXjfC4D4FnvTMIpsoWrhf8yGfbs5+16DAiAmFZsiUmDDgkSIqf2w6kAaxgpCRtIkE3BWSD/mfDPXsw=="}]},"maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.5e330bb9.0_1601503271371_0.6616317462947112"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.30b9e3a9.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.30b9e3a9.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.38ef4501f.0","@material/line-ripple":"=8.0.0-canary.38ef4501f.0","@material/mwc-base":"0.19.0-canary.30b9e3a9.0","@material/mwc-floating-label":"0.19.0-canary.30b9e3a9.0","@material/mwc-line-ripple":"0.19.0-canary.30b9e3a9.0","@material/mwc-notched-outline":"0.19.0-canary.30b9e3a9.0","@material/textfield":"=8.0.0-canary.38ef4501f.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.30b9e3a9.0","@material/notched-outline":"=8.0.0-canary.38ef4501f.0","@material/ripple":"=8.0.0-canary.38ef4501f.0","@material/shape":"=8.0.0-canary.38ef4501f.0","@material/theme":"=8.0.0-canary.38ef4501f.0"},"publishConfig":{"access":"public"},"gitHead":"1dbc47f1a0c4601e30ed5a9eb0fc9f9b56564e1c","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1dbc47f1a0c4601e30ed5a9eb0fc9f9b56564e1c/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1dbc47f1a0c4601e30ed5a9eb0fc9f9b56564e1c/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1dbc47f1a0c4601e30ed5a9eb0fc9f9b56564e1c/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1dbc47f1a0c4601e30ed5a9eb0fc9f9b56564e1c/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1dbc47f1a0c4601e30ed5a9eb0fc9f9b56564e1c/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1dbc47f1a0c4601e30ed5a9eb0fc9f9b56564e1c/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1dbc47f1a0c4601e30ed5a9eb0fc9f9b56564e1c/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1dbc47f1a0c4601e30ed5a9eb0fc9f9b56564e1c/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.30b9e3a9.0","_nodeVersion":"10.22.1","_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","dist":{"integrity":"sha512-HoEjoeqHigbOKPXv21qBZ1eOJxUhve1IIcquoWTVrQRV54xDYnlBFGYKi1JlRiQMAeRkU1nyDgCCW3nqm0PUXQ==","shasum":"f3b994ad48deaa693bc1fa12f073a5a4bfd6a012","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.30b9e3a9.0.tgz","fileCount":13,"unpackedSize":196495,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfdQjRCRA9TVsSAnZWagAA7LoP/RZpTfake3s4VOOYamrg\nTW390YUR/kl76zN6PTywi0RkfXPCq+0/bu3ennYsyuLfYNXeQphtBtm/1VTT\nTcpMvpmTqGeephLOn5QscNmLoIA9p2Cxt9vxEMaesBmNB7+jgH8KOGLGNHE1\nE8B49BcQHvDALdvxsXabOJ9wpoFZlNtFShoGuARvuqf2a/c9ubGQ53y4g1yi\noqGN9STGC5Cv6C6V3rvMwrgZrST4cNUF5TcQ5Y9MvyMsaPdbjYMMs05ziU2V\n3wjKGpz8k24mKklORxqgFJ1oz6M/V2KFd4PChqXBScNqYw+UnmjSnY4XHBov\nqZAUV3je9/tW6PpoT44uy3Xskj6T6BsAguh+8oSNRV0wfhWeZfJDkng3CPzv\nOQ3nQ5kRpSK5vAp2sqd1jA1tS12002XQRLEFpOCld4x5m+velZDxbmJ7ErEQ\n0mmhnePBI6VF0CLC2g4tDrVpIYzYl+CmFQ/lZG47w75GAlRzX8Jvg1Z11Aak\nXFuPjpyAekizmA6JofwBx2xgOeyd1JAH0F+uprAsUQXMHnSj9FbLV7FDbAch\njRX/Gk8lSkZRlvMK0tK95148SKt8MfmpxUXfH4mOoRXxsENoGe55MxsX8Gs/\nTt8mWWYKAScx46Ib4frMxCUAF4lQ+9l3zF1FzT3FqRG8YqyirONBC6Fm+PEx\nFBSR\r\n=k9pn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDK85MYamDvjQRJHEkqUD9kgGw18HngQpDXywydvQCmewIgLSW3H0RNuY5Q06HpvkGX8V8o2h4X1kbE9Jl3lEuEMaA="}]},"maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.30b9e3a9.0_1601505489178_0.9589251482555912"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.7bb04b9a.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.7bb04b9a.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.38ef4501f.0","@material/line-ripple":"=8.0.0-canary.38ef4501f.0","@material/mwc-base":"0.19.0-canary.7bb04b9a.0","@material/mwc-floating-label":"0.19.0-canary.7bb04b9a.0","@material/mwc-line-ripple":"0.19.0-canary.7bb04b9a.0","@material/mwc-notched-outline":"0.19.0-canary.7bb04b9a.0","@material/textfield":"=8.0.0-canary.38ef4501f.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.7bb04b9a.0","@material/notched-outline":"=8.0.0-canary.38ef4501f.0","@material/ripple":"=8.0.0-canary.38ef4501f.0","@material/shape":"=8.0.0-canary.38ef4501f.0","@material/theme":"=8.0.0-canary.38ef4501f.0"},"publishConfig":{"access":"public"},"gitHead":"f4137a832374dd43b862ca8a4db665a59c1a70f7","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f4137a832374dd43b862ca8a4db665a59c1a70f7/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f4137a832374dd43b862ca8a4db665a59c1a70f7/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f4137a832374dd43b862ca8a4db665a59c1a70f7/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f4137a832374dd43b862ca8a4db665a59c1a70f7/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f4137a832374dd43b862ca8a4db665a59c1a70f7/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f4137a832374dd43b862ca8a4db665a59c1a70f7/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f4137a832374dd43b862ca8a4db665a59c1a70f7/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f4137a832374dd43b862ca8a4db665a59c1a70f7/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.7bb04b9a.0","_nodeVersion":"10.22.1","_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","dist":{"integrity":"sha512-/iX4uLTPCUhsKaeGJW2qndXRK2D+vO+B1FlsanttLBmAtfYI/CMM/JjyCU3daKjZXRPLyPAU1vwb51+ZS/CN0A==","shasum":"1b9ea436f01ffdedeb23fd74ad82dbb7b0c88580","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.7bb04b9a.0.tgz","fileCount":13,"unpackedSize":196495,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfdmTICRA9TVsSAnZWagAA5ycP/jwkHIhcZzACDpXJ7V0j\n0b0eQYIo2MzNevM66RA1HjmEpvw032Srg6ifHx+Te7BGzaOiDb9ioZI/YZkE\nQJeqHl4uY5X+S+rnJH2TpgY7hnWDkitQuw8eLztmqMcNyZSucpqo8cUwswJg\nfmFq+RNQEdXrOVIzRwmaViAAe6DejVtBtPAZMb/lvw4xN5rmltlXMfLoNynQ\nTUFgW80Qq2puEpFdNICxi2/bB5AVU5IHlX4XBUdTTKWcMarw+vwmIobwUhzo\n4AQpzB4GRaCp0R70X8028f1plJ+E+FJ8Nwec9aPmSVlrQgx9NQCICJFh32T1\nXMhWUT4FnJFpg8MIHR1Mo0t+hSDb52xObcuxbg4Bxph5I50sM7zB5FzMkAzH\nH4ZE5bv8FnLyPyUKrA434YKi1ZQSiRg3+aK76xswcKFjSx0mD9D9+t16EEeS\nGL3AGbQqGryrxCvJb9RTLngIgCAv42DE8RUtzUpa1OQYYKkeJ83T1+X7+E0C\nedLGOoZaEF31QKxp4McUlzio+S49yzVtypm/ew2VD2IFWVcCgaq7nr8HHIlJ\nrghx5jU0DDCA096Dx+mPaVCAFUj7+KuHfIlEc57MAgEeQmuBQ5EpfS/G7Oqe\nO94C5+U2BeLHPVbHNH6ooXyXsCaver5Lr4mJ+IiFhqr5i1ZtjRsf5yDUtZEC\nGDZq\r\n=U4Ez\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICcAQOkKKeGPf2lRWQf1R7GK9BhURwR0hOpWj70teNqEAiEA8bMkgKhWsQovBgfSlwqbfm8JjyDCxOpy8SrbbUCH3Ec="}]},"maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.7bb04b9a.0_1601594568160_0.8604957805788458"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.615d861d.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.615d861d.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.38ef4501f.0","@material/line-ripple":"=8.0.0-canary.38ef4501f.0","@material/mwc-base":"0.19.0-canary.615d861d.0","@material/mwc-floating-label":"0.19.0-canary.615d861d.0","@material/mwc-line-ripple":"0.19.0-canary.615d861d.0","@material/mwc-notched-outline":"0.19.0-canary.615d861d.0","@material/textfield":"=8.0.0-canary.38ef4501f.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.615d861d.0","@material/notched-outline":"=8.0.0-canary.38ef4501f.0","@material/ripple":"=8.0.0-canary.38ef4501f.0","@material/shape":"=8.0.0-canary.38ef4501f.0","@material/theme":"=8.0.0-canary.38ef4501f.0"},"publishConfig":{"access":"public"},"gitHead":"31f7a82757513b3944c605422e6c70eef13bbd54","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/31f7a82757513b3944c605422e6c70eef13bbd54/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/31f7a82757513b3944c605422e6c70eef13bbd54/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/31f7a82757513b3944c605422e6c70eef13bbd54/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/31f7a82757513b3944c605422e6c70eef13bbd54/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/31f7a82757513b3944c605422e6c70eef13bbd54/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/31f7a82757513b3944c605422e6c70eef13bbd54/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/31f7a82757513b3944c605422e6c70eef13bbd54/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/31f7a82757513b3944c605422e6c70eef13bbd54/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.615d861d.0","_nodeVersion":"10.22.1","_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","dist":{"integrity":"sha512-U09PkkE+Z+sdexD9PK+Yim5jAAPK8Rzslr72bH/T0c0DiwxZK01faKLx/zfRyMbODUYVTv2k8h3IJP4Uq2EWbA==","shasum":"1916fee4a242eecc47822c41dfd0dbafacb482b3","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.615d861d.0.tgz","fileCount":13,"unpackedSize":196495,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfdoNkCRA9TVsSAnZWagAAENAP/jUec3ajmFYTY4ypZ3Tp\nJdgTExLWLIWTfpujV9J4qq7fB+VISrU1apKL4akPp+Fx3786MKANn4FVvKNw\nkPMJLl2pw4kUecA4s8rklKrvjVs78lRMRo8DgyYqpYEW2cw+ncmQBFUHA1Ce\nvFqPnn1fI1bJ3sJH5kv0eJdlb2ZxQUUxPmLhLUzeu+3oVM+OqMDQ4tuTe5Qf\n5hk00FtEu2UcvSZSkEh+nilZCeySoetF9ERNeeSs9yLcOnKulBgeC0C658LK\na5Gwm6bupr7M5bKzbCKvK3W2spg0Se3aay+PbkLHMVSRmm09LkYRhBXhh/9X\nJVVRnGX3xr1ZBx8mg/7Y2ikyjG0G19qarHCWen3O6a0HC4tVH3VtXQkJdRdM\nA9/QyYwek+ZPY3ESn9e/7FpyZ4KujxSUiMlwGNZkPsrQjvSojHhKBTb4NnfA\nj4sgrBqaJ+QJ+a07Sh5wyopwlSnz/gFs882H00UQnbUF1WnE6O66CIAHpRrE\n2E2UpOFlGWYq3Mx8njQ8fWlc7nGNsYIT8LlPvlyX1ZoW3msijMsCHilHTfpB\n/h//ZYQOc91/q99CMmncFXrmWQ8vh6MeMP55qgOcdt6VDPLaswoMHXGU+gzN\nEM8zOwDf7DaANiOpB6J/Q1sdrKeZOqIhxDJzh1oMyN4PUN6Z5ediqRMXr+4j\n6nnB\r\n=6UKM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCzQk7LrxEZelJp1yOo4BeHT0m4cwLPsym3K+yd3u8PHAIgIpNhBC5IbTrgbKcxM5Rq/rlmKCcH7CUu3rJaqq8rH+Y="}]},"maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.615d861d.0_1601602403690_0.2705020733478478"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.af110e86.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.af110e86.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.38ef4501f.0","@material/line-ripple":"=8.0.0-canary.38ef4501f.0","@material/mwc-base":"0.19.0-canary.af110e86.0","@material/mwc-floating-label":"0.19.0-canary.af110e86.0","@material/mwc-line-ripple":"0.19.0-canary.af110e86.0","@material/mwc-notched-outline":"0.19.0-canary.af110e86.0","@material/textfield":"=8.0.0-canary.38ef4501f.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.af110e86.0","@material/notched-outline":"=8.0.0-canary.38ef4501f.0","@material/ripple":"=8.0.0-canary.38ef4501f.0","@material/shape":"=8.0.0-canary.38ef4501f.0","@material/theme":"=8.0.0-canary.38ef4501f.0"},"publishConfig":{"access":"public"},"gitHead":"ec4508e75df333e18bfc60188de82eb9e90a6d01","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ec4508e75df333e18bfc60188de82eb9e90a6d01/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ec4508e75df333e18bfc60188de82eb9e90a6d01/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ec4508e75df333e18bfc60188de82eb9e90a6d01/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ec4508e75df333e18bfc60188de82eb9e90a6d01/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ec4508e75df333e18bfc60188de82eb9e90a6d01/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ec4508e75df333e18bfc60188de82eb9e90a6d01/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ec4508e75df333e18bfc60188de82eb9e90a6d01/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ec4508e75df333e18bfc60188de82eb9e90a6d01/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.af110e86.0","_nodeVersion":"10.22.1","_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","dist":{"integrity":"sha512-KJ42Z0oTm7pDPQGLSRVHfEGwnCCvdwj+P4/uvtK8j5h4ieyUaXi94yZBWrfuujj2rARoR7qNzHrgv4GmqKYATw==","shasum":"5172a3baedd4af4afd5627966f3cdcc8058cc25f","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.af110e86.0.tgz","fileCount":13,"unpackedSize":196495,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfd7yhCRA9TVsSAnZWagAAWG4QAKCHmLo9zM27jBB166Wx\n5CoK9IihAbo42ld//gnoRbsQd5ezGVDu1/irtVu4QS+6+zc6LlsHoR+rmnhb\nZReb4E2ooz2LDVhgEtpEqAK4nmxMX8+GYtQMILLf1s7a1b6LqungSc6cRy4p\nK+NP4Tf8YMWwe68fffkLBzOKBb6HGjz7EiOmoj1pZS/8V3SwIi+BDuxntWTC\n5NK6nrk8j7AnHVLLOuVMgl6YhQLGDA83PfPr11FYGNpBuzYu85Km3pj84U9D\nKvtzbAyDJoIldDngtNAT4CC77PsbEGNTZjotFzqLMPGyzsHjHfqHvY3wQfc5\nTwFVUh8mFfCkBuhxLitSKgbGpNAQK8iP/VXM10YYOW57UVb5ygAjnXtqg4j8\naR0cYdd1QggDRGAUvcY6e3bGkMy/m7KC2IsKcmr5fio/TJMddPV2LK3o2MnB\n0RkZLlDLrGtNmyP1kKmQNlKAv3w4J/UIEvRus0x2Y+a8IKc58Rfqhn8UCL4y\n1mWyumvEftJFJ6twAUxd2DUReddKfrscmCIvsOZyTRleAuMyd9A8OCeKZRlZ\nuWXHcQLlBHCVTqg5+qayXDVXQu/AXL/sk+Vxtv28R1NrGcIvYTei5cKnKXVA\nTfdgIjLmBjenCpwDQP36cSWXfVzmNcIk+3XjTz+ddd1PraZioasmMLcmvW6M\nVpM4\r\n=pGKq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAVvF2lQOBmlsd60cvhy7GIzPzrNsjkPnPR072Z+UnhtAiEA09Mj2xCQBZU8mKXCXYyrpPzNiH9tAVtFG4Oz+a0lnXY="}]},"maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.af110e86.0_1601682593229_0.8058475671995844"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.89d27ca5.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.89d27ca5.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.774dcfc8e.0","@material/line-ripple":"=8.0.0-canary.774dcfc8e.0","@material/mwc-base":"0.19.0-canary.89d27ca5.0","@material/mwc-floating-label":"0.19.0-canary.89d27ca5.0","@material/mwc-line-ripple":"0.19.0-canary.89d27ca5.0","@material/mwc-notched-outline":"0.19.0-canary.89d27ca5.0","@material/textfield":"=8.0.0-canary.774dcfc8e.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.89d27ca5.0","@material/notched-outline":"=8.0.0-canary.774dcfc8e.0","@material/ripple":"=8.0.0-canary.774dcfc8e.0","@material/shape":"=8.0.0-canary.774dcfc8e.0","@material/theme":"=8.0.0-canary.774dcfc8e.0"},"publishConfig":{"access":"public"},"gitHead":"fbe5db689dbf4abb9f299c85581f7fb95f80ceae","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/fbe5db689dbf4abb9f299c85581f7fb95f80ceae/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/fbe5db689dbf4abb9f299c85581f7fb95f80ceae/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/fbe5db689dbf4abb9f299c85581f7fb95f80ceae/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/fbe5db689dbf4abb9f299c85581f7fb95f80ceae/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/fbe5db689dbf4abb9f299c85581f7fb95f80ceae/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/fbe5db689dbf4abb9f299c85581f7fb95f80ceae/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/fbe5db689dbf4abb9f299c85581f7fb95f80ceae/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/fbe5db689dbf4abb9f299c85581f7fb95f80ceae/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.89d27ca5.0","_nodeVersion":"10.22.1","_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","dist":{"integrity":"sha512-vWb7t3gss961xY3fBB3UUZDeUSShAlLnOlMA6jzgC9f6Qxi/npdnvlI/Pv7gHTx/VrYZ3QTxbFJ+Fva9Uhji7A==","shasum":"fbaff7cf0d5ff6606f859abf6a863c50687e130a","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.89d27ca5.0.tgz","fileCount":13,"unpackedSize":196495,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfe8fpCRA9TVsSAnZWagAAZbUP/3Dg6cklzCcbdgdLomuB\n2SRte5OoyvLN8IXux2QGyy984jumlTVY0rwEnQeGkLfJYHKFCDMiAvdO+pJb\nsBQcI4uOb2VCCLm/owD3Aa451pj4NUtN0TVidJEt5q9daNvZH5P7koMSysiA\nzAz30EJ1RS49Q25P6TJeZZ17RXjH91U2lHADTZT7mdG2VzrB6JglGfZga6T6\nWYEdMzn749/K1tIg+jpFiUCkLyOkhPIBbufVyXkORHeRIqGJMO/i9wJtCSSt\n9XDXOlwyPYSn+1T3KA4IR937FhPaDWTZUjm0b7LpvnWzs4jaSYwmn2MZaM33\nFoxhj5RaV6+u5NHUbGQd0PaIy1F40xGssqR44NWurrsqZmKNSF501Jhu4388\n/d8HEUoiz3C6vEeTuBE996Y7GghFWGhG134XSteWOtuhGB97eDDpzCl7uR3f\ngWJwcUJvqjWy8gH2//QoGYvIoFcnZmFeQbZ/rOzk2eNM6uy9FFbaZ8H0aPGN\naWNTxiODOuueu/KtQfttg/GMa4gppBurr2YFkKIYcce/VAocrwPiZuOgm5+1\nCULiccn9JBEIc/5f3ypvGGiXoLYQ0ziK1znqijlkIylFKDdYrjAPJxe9Q3DU\nDDTLmapdHH5/Ep6mMyV7l5n7k4XREHCHJncL6SWRGbBe4YP+/zcowcB6FdIZ\naLnY\r\n=3JAy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEtnvELKu+jMeMse0UxtVI6xCW5yRhBs9scpzHkONuP5AiEA+NVJ3L/p8iYHDWgyenJDzx81dJ/uQbQANQSDaB/9ThE="}]},"maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.89d27ca5.0_1601947625026_0.36790214067993876"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.9ef2e7c2.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.9ef2e7c2.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.774dcfc8e.0","@material/line-ripple":"=8.0.0-canary.774dcfc8e.0","@material/mwc-base":"0.19.0-canary.9ef2e7c2.0","@material/mwc-floating-label":"0.19.0-canary.9ef2e7c2.0","@material/mwc-line-ripple":"0.19.0-canary.9ef2e7c2.0","@material/mwc-notched-outline":"0.19.0-canary.9ef2e7c2.0","@material/textfield":"=8.0.0-canary.774dcfc8e.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.9ef2e7c2.0","@material/notched-outline":"=8.0.0-canary.774dcfc8e.0","@material/ripple":"=8.0.0-canary.774dcfc8e.0","@material/shape":"=8.0.0-canary.774dcfc8e.0","@material/theme":"=8.0.0-canary.774dcfc8e.0"},"publishConfig":{"access":"public"},"gitHead":"05ef0de8978ff84725428953056488d768d115b6","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/05ef0de8978ff84725428953056488d768d115b6/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/05ef0de8978ff84725428953056488d768d115b6/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/05ef0de8978ff84725428953056488d768d115b6/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/05ef0de8978ff84725428953056488d768d115b6/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/05ef0de8978ff84725428953056488d768d115b6/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/05ef0de8978ff84725428953056488d768d115b6/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/05ef0de8978ff84725428953056488d768d115b6/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/05ef0de8978ff84725428953056488d768d115b6/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.9ef2e7c2.0","_nodeVersion":"10.22.1","_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","dist":{"integrity":"sha512-1WOjowi2g71leINF76iBXi2TJzqxusv4cp4DHBVrXSawyZIRexyw7Eb1A9eEXAeJSWXr3PebU+Z0S4004bGv2A==","shasum":"c9da52dfd6e98fdbb053fb1637d7ec6018421c74","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.9ef2e7c2.0.tgz","fileCount":13,"unpackedSize":196495,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJffQhdCRA9TVsSAnZWagAAWx8P/RCvZ1bFBOoGCxNyku5n\n9tY0kwCT8OdTqQ4rNdLOowDXh0xhBhADvg30COtsIVoRI4HBZIuHGgqQyHMX\nPFbUEU5zY2cMdhMm4mn/24zzQ6W/+qL3bvF0IHUz9b04QC/MIopbbFOW0Y3m\nDL0pWQqMKehb4F4d3aLLiz3WVT/fQXP+l7+2SqoM+q92THKayMJJjqPBl8Qh\n/doO4Iop+mIexuWkIvvB8ddW9ZeGMOzk3VTPP2QWyjHgoe/vzFdmRXgcYh0V\n4qlukb1Np91AmpI9sqJshow/Kq3Nqju/mnoez3LbDwol/2Pc8cETy/JTKmbV\nkPQJwefUbpn17gmcQzFJdWPZ63E4BH+Wz2lDy7lPQc+0d4hebUCTjFW10JwA\njfvcKqZEOTw8vgu6bzJGwhAGsnPZtbAYgj3W8Dza3ST9T9bhKc+Nrm+0NiGz\n8FisjNx6pLiDw5CTkG8f+MjCedgMPIbbPuxejQcIPPT2PCyvYYOkOBj+kIIQ\nCP/pUqGRlTUyLLR8TkWLFBtGZ3oHzwaZRXvJDmN9RBvK/5fZhTOvlOWeo3zq\ndy+7BI5uk6PJpmXTAkb9m9AEaWgBR2GYdovxoJFdoQxx//yueqJgj3ULoU/t\ngELwM6vfLqWNOUL4gBmGMAUKhl/SAt4tIErPHIgCcYW+bZnSzAFTHat+b4lW\ne0Ru\r\n=kOA4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGqD1hvIRwMLubKoi561HDpuTBS5uZsilbr8/nmyZGVkAiEA/Yha1qJva344SxLhxpGHU+6Cf+ypsxhCa96VG53Tcxk="}]},"maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.9ef2e7c2.0_1602029661007_0.520328224566466"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0-canary.96c8bdc1.0":{"name":"@material/mwc-textfield","version":"0.19.0-canary.96c8bdc1.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.774dcfc8e.0","@material/line-ripple":"=8.0.0-canary.774dcfc8e.0","@material/mwc-base":"0.19.0-canary.96c8bdc1.0","@material/mwc-floating-label":"0.19.0-canary.96c8bdc1.0","@material/mwc-line-ripple":"0.19.0-canary.96c8bdc1.0","@material/mwc-notched-outline":"0.19.0-canary.96c8bdc1.0","@material/textfield":"=8.0.0-canary.774dcfc8e.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.19.0-canary.96c8bdc1.0","@material/notched-outline":"=8.0.0-canary.774dcfc8e.0","@material/ripple":"=8.0.0-canary.774dcfc8e.0","@material/shape":"=8.0.0-canary.774dcfc8e.0","@material/theme":"=8.0.0-canary.774dcfc8e.0"},"publishConfig":{"access":"public"},"gitHead":"1107015eb30f3673820101dee6e42cd62841721c","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1107015eb30f3673820101dee6e42cd62841721c/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1107015eb30f3673820101dee6e42cd62841721c/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1107015eb30f3673820101dee6e42cd62841721c/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1107015eb30f3673820101dee6e42cd62841721c/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1107015eb30f3673820101dee6e42cd62841721c/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1107015eb30f3673820101dee6e42cd62841721c/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1107015eb30f3673820101dee6e42cd62841721c/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1107015eb30f3673820101dee6e42cd62841721c/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0-canary.96c8bdc1.0","_nodeVersion":"10.22.1","_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","dist":{"integrity":"sha512-l0LXUN6ytCijB70KSAg9jHZGpD91sGV+FTpLtimk85Ajw7BoViaE2itQwaYQ0VBr2RH1nykla7KUVO+wxtQhOg==","shasum":"7b5f58957845665d57a46b93332d5c68d09c3ef0","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0-canary.96c8bdc1.0.tgz","fileCount":13,"unpackedSize":196495,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJffiAPCRA9TVsSAnZWagAATRYP/0LXfaSYNAlsLfm+oey8\nFSr4DRpmOfZpIH69m1t01HYdvVnmeSPH4FKhPu6rA4RsDl21Work/2kbBpWL\nJYl4gqt+PvHxQONx+ErYMDzGjD08YAqjDxrfk2uoKXCF3ecdb4bAFkNipmop\ny2NpsjcMHUvHssQGrBLu6n9IhOtUnTsJv706CzIQyNPksbBpUDxpOoXcPNxJ\nhi2FkJ0Ri/oPpeg3a0rHIDPb+lM7inM+lQjixsgiAzD4k51uxYR9eECT09du\nX2UPWG+5ob/v06OnPDE8I4sn4vn18yfKcD8Nuznfw1l2oGMqm67dEVRIE/W0\nMQTipS6eVF9iXn6T0n4aHuJ6cK9YrXKrGemvflQLc2E/qz0oHY7KTbnqNzLD\nLdfUZO/Pgf+0A7n/+3LhMVlpBylbBlU1Igi6Z9/0h24HFi71tiBxN97tzzeT\ndbxo9jmBorGiKcZGhA/WyEtsNp3cs0OYAOJdyFgPEX58Rtg3Gfh+UFHmmvnW\nuJ0iyzeZq9fEv0+XxccbC+drxHT8YjUvWgFQmDWmDbQ3usxcrhbEp+MadNHH\n7ud9dgd/aBgs87XaEG+wDMky8cE2yJSi1p2V84zLWwPvNSaVSJZ+fY9k5R9F\nygKZubsFraQgVzzLj8ywnmVbzvgeRrY/PWAnmKU3udxrQgS+hz0o8YJmmxf9\nkN5O\r\n=l/Qg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICHcOLDwfwS6Oto93y6x5QIb5uEJZYBDNOG0s54pBKSVAiBDTGEHlxO3qV1XTkli+nuYLF/ponUa+Pjp36+0HTOGFg=="}]},"maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0-canary.96c8bdc1.0_1602101262829_0.6916154255090936"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.20.0-canary.6c21f034.0":{"name":"@material/mwc-textfield","version":"0.20.0-canary.6c21f034.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.774dcfc8e.0","@material/line-ripple":"=8.0.0-canary.774dcfc8e.0","@material/mwc-base":"0.20.0-canary.6c21f034.0","@material/mwc-floating-label":"0.20.0-canary.6c21f034.0","@material/mwc-line-ripple":"0.20.0-canary.6c21f034.0","@material/mwc-notched-outline":"0.20.0-canary.6c21f034.0","@material/textfield":"=8.0.0-canary.774dcfc8e.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.20.0-canary.6c21f034.0","@material/notched-outline":"=8.0.0-canary.774dcfc8e.0","@material/ripple":"=8.0.0-canary.774dcfc8e.0","@material/shape":"=8.0.0-canary.774dcfc8e.0","@material/theme":"=8.0.0-canary.774dcfc8e.0"},"publishConfig":{"access":"public"},"gitHead":"367e1d2c78522b5c85dbc2693548d691c8b84d59","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/367e1d2c78522b5c85dbc2693548d691c8b84d59/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/367e1d2c78522b5c85dbc2693548d691c8b84d59/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/367e1d2c78522b5c85dbc2693548d691c8b84d59/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/367e1d2c78522b5c85dbc2693548d691c8b84d59/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/367e1d2c78522b5c85dbc2693548d691c8b84d59/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/367e1d2c78522b5c85dbc2693548d691c8b84d59/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/367e1d2c78522b5c85dbc2693548d691c8b84d59/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/367e1d2c78522b5c85dbc2693548d691c8b84d59/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.20.0-canary.6c21f034.0","_nodeVersion":"10.22.1","_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","dist":{"integrity":"sha512-xSbpKavnpNrD5tNjvfMUEDj2CAZ7J1SsHNaxNnE/kB6OOtLXHeTZJG/2YFLiM2VX7KJzmk58x89UAm4w5FsbHg==","shasum":"58017af2f4c27dbdc1f08d2d9dc5d31328d1153d","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.20.0-canary.6c21f034.0.tgz","fileCount":13,"unpackedSize":196495,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJffkGHCRA9TVsSAnZWagAACA8P/3VtKrNnZ6XePu3h3zL1\ny7rJe0+TS1nra4hw6blL8Ksf4W9A5ICzfOLRdmGzQpUfW7KIZqANsMsog64+\neg0EI7OLWjS7KVfq5u7zAC0FzIkkcVE8uPc/4Pqn87sD7OExiplxegZVwnP8\nuKdYWSGOLK1S2uYWXyXu/t6cDiGSP3/C3j8c1Yk9wNMWolcsWF3i8iCqNGvP\nDALE5K6Lr9qk7A2KrmJ1jBdcPJKXsG5Zk+MQXN4JBROSQsStC/NLMfES4RZg\nXOhf8EG1Z+JCBJ5dLIrdvyYHufozsHHXsihB3+ufOszishe2kzAFV0Exmupv\nZidGNoVxXHEWAof1XEg5mvUmhYo1LuaPzE8cRubXfvyIP6AtZ4rsLjFnEZ2H\nCbwEaHg43IZTudrV2nvONKj8iCwy/gUNB9y9IJUNXQIwstwRxdPUgtQyYrxp\nEOWMKOpYxbTe7WnFj+8IELNmadQDocqsQnnoA+NoF9mSAYWqXHqKDxRjSoYU\nyVOrcmx9MgTU6rqqmcGmeCRKgvIx9rRPqN7+BMH1ply5wMBFNeyecJDsw3po\ngtzjsyOcNwdpqZReJfjdXhj1SUdS+6Llt900C1F9uBBowkuD4vlkk2Hi6Y7w\njwohT/t0Haau/9Hy/vN4Esl1ACzUdFU0p0AXHx/D/1nta5Peq841PmVBxlxN\n4QFe\r\n=tI3/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCJtZR96n47ymeRGtRDL6XrP8Zz33Qm5X2cFo80ZQN7bAIgGLA2eu4V/+GiS7jBQOSnmw6Yx1tTXkyzPV76Wm9iTv4="}]},"maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.20.0-canary.6c21f034.0_1602109831216_0.6770145875922211"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.0":{"name":"@material/mwc-textfield","version":"0.19.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.774dcfc8e.0","@material/line-ripple":"=8.0.0-canary.774dcfc8e.0","@material/mwc-base":"^0.19.0","@material/mwc-floating-label":"^0.19.0","@material/mwc-line-ripple":"^0.19.0","@material/mwc-notched-outline":"^0.19.0","@material/textfield":"=8.0.0-canary.774dcfc8e.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"^0.19.0","@material/notched-outline":"=8.0.0-canary.774dcfc8e.0","@material/ripple":"=8.0.0-canary.774dcfc8e.0","@material/shape":"=8.0.0-canary.774dcfc8e.0","@material/theme":"=8.0.0-canary.774dcfc8e.0"},"publishConfig":{"access":"public"},"gitHead":"6c21f03466ddd0381aa030eeb2fd8f9615a3ed73","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.0","_nodeVersion":"13.8.0","_npmVersion":"lerna/3.20.2/node@v13.8.0+x64 (darwin)","dist":{"integrity":"sha512-DYXlbeWhXopVY4k8zYwpO8DpPL/UpNkYsoSxY6aYckcqFTW7jNuT78qyktiFRo91y37it3DNtAC/oItDBRde1g==","shasum":"5c8ea87f95885754291eccb5c3c11fa36dc8fbc5","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.0.tgz","fileCount":13,"unpackedSize":196392,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJffkI3CRA9TVsSAnZWagAA69oP/1gIZM9JDWQrn+P4yyvS\nZdqnh8h8lI6kM8OrNH551f98vRGww6y8SYCuwr8LHFynwACwNKcTJhmtwcwE\nhvfk+uqSyiLCH4lsaFufBvrcKYYABXly6Gll3WUmUje0RGZwtObSVNCmbjk1\nl6OnCEEuXrhnJoqUmC1wLW87tm+Wc8QWjRP5rlOXPZcCk2WP6pDtBNZqGleP\nNxkCJbqgiq3mWts7MHOMFFC8XSqAyTV4UwycUbsCG3vMXGkCXNVpuD99ndjH\neDrszsQYq+Rj2yr6SJnuL9CApDC9qOZQooS7p4A2lMeputlqqy4JbmgpG3bh\n0S5/dGzsRXwntnxjar6bUXSjc1n/3RoSpYbVCw2MitVzkROjZykG5I3r2lP1\nRz1dI0HTXNTKkeABVMWns+fSPWH1W/XKgDgJaUtYst9YuHYkFPu01LSITLxz\n6iux3yndiwrHcQAERgiYpVzqEuKHH0GY3p2j46M8f/RdSeYWjbCuTmHLJOil\nX1ZkthrhXLvHdwBlO8hyNWLm+m4/OzmBqnitWrrpUL3zUHTpJQaW4rRZWhlg\nEC3X4mXj6pmdbHdrquh/8RxhpgjiIcPUhYof/knXR+MM1IdgEedCafmOxdgA\n+bj08l6REl05HP+ok3nT/ca+cakkjTsriMh9jt3YaxGFDrsqPrn4pUIH9f4G\nER9I\r\n=JEEw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDx/QjNEqDiTT2zGb8GEupJigxuLqXIy4DQzzTyaXvTZQIhAM76bBcl13fN4f5zjkUOgrcGl87w3M2dy6EQBvCfAd84"}]},"maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmUser":{"name":"emarquez","email":"emarquez@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.0_1602110006630_0.3128683918330011"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.20.0-canary.1f026aaa.0":{"name":"@material/mwc-textfield","version":"0.20.0-canary.1f026aaa.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.774dcfc8e.0","@material/line-ripple":"=8.0.0-canary.774dcfc8e.0","@material/mwc-base":"0.20.0-canary.1f026aaa.0","@material/mwc-floating-label":"0.20.0-canary.1f026aaa.0","@material/mwc-line-ripple":"0.20.0-canary.1f026aaa.0","@material/mwc-notched-outline":"0.20.0-canary.1f026aaa.0","@material/textfield":"=8.0.0-canary.774dcfc8e.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.20.0-canary.1f026aaa.0","@material/notched-outline":"=8.0.0-canary.774dcfc8e.0","@material/ripple":"=8.0.0-canary.774dcfc8e.0","@material/shape":"=8.0.0-canary.774dcfc8e.0","@material/theme":"=8.0.0-canary.774dcfc8e.0"},"publishConfig":{"access":"public"},"gitHead":"3082455321637675854584edbbfeafa95d95dd1c","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3082455321637675854584edbbfeafa95d95dd1c/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3082455321637675854584edbbfeafa95d95dd1c/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3082455321637675854584edbbfeafa95d95dd1c/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3082455321637675854584edbbfeafa95d95dd1c/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3082455321637675854584edbbfeafa95d95dd1c/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3082455321637675854584edbbfeafa95d95dd1c/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3082455321637675854584edbbfeafa95d95dd1c/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3082455321637675854584edbbfeafa95d95dd1c/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.20.0-canary.1f026aaa.0","_nodeVersion":"10.22.1","_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","dist":{"integrity":"sha512-0jzYmOqiEVt4wsGkYgFJAfAdUglKfaKY4ucbCS1hC4i2gJqM80H+QoUuPtKar29WlyBw6wI7o/v1xzKku6pccA==","shasum":"680e708617f4ce85dc846a620bd985db99755116","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.20.0-canary.1f026aaa.0.tgz","fileCount":13,"unpackedSize":196495,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJff5h2CRA9TVsSAnZWagAAKEwP/AmH2NZQ0hHDqbr8jjKR\nhQM4l2YwHcR7INSIQ3oy/Z4+LWbdEu4i228hES7j4dvouhrgNF/ZXknPdyUT\ntAgsARr/p1cuqCdw/n4WCNOqj1LHNuHYzxse9lkGo4aHhIE30Pov8SSLQJ0d\nxHZtvdLLISlJwjX1sTUzW2yV+YWZJLQh06iGYTyqdUZX+tTqoEAZUmcdyftQ\ngqrnYZfzfPg90GrBhOm7llEo0zmB5etGYLoSFAOCi+tg6fTZRY6EhV+Ub9r2\ni+LxnaGG1qAvQ4c5dyhwPoh1YlE8zKHRqp84Vu5juJqzGPw/6Pv9Z2RFHkn1\nwcupoFo2ZDED2NlTIpGJA4foXpNFeryN1S/mqXTyuchGxV8hiWW8jKVyqa9+\n2r0+s+Wi+rzyL4goUg5bT58AEIpAFkToyhINftYVx6EFDziCQCd+JpkiUGeU\nAB64y/hNwmTQ2Vdpptnpt+u3dyCpI6HUBXJ316UVDvNk9abRnKHg9Rq7KSti\n4A6JeVnk4yM34GMPH81/p27pPhu3QA4a669gBnirjjFBJQ/eLEB+NEF5jg3Z\nhhIsyd2eoZssFAcFEqQZ10omqNYl5IUsl3LhOwFC4OEpw4Zp3QPhvXNWH5DA\n0miaP0X5roMAd6UerRPNGCNcioftmvgqMdNs8iXnqegK0x1q3Ga6Qtah1EfR\nJ8l6\r\n=xTI3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH2n8h+G1j803WbJ0nbzP7N4+uEgxL5I5RFSYqVHltcxAiB79/Svtg4rA/DAhCAdpB6v9L8OrwQXcVBK+/7nBC3zig=="}]},"maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.20.0-canary.1f026aaa.0_1602197622107_0.8233010314764568"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.19.1":{"name":"@material/mwc-textfield","version":"0.19.1","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.774dcfc8e.0","@material/line-ripple":"=8.0.0-canary.774dcfc8e.0","@material/mwc-base":"^0.19.1","@material/mwc-floating-label":"^0.19.1","@material/mwc-line-ripple":"^0.19.1","@material/mwc-notched-outline":"^0.19.1","@material/textfield":"=8.0.0-canary.774dcfc8e.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"^0.19.1","@material/notched-outline":"=8.0.0-canary.774dcfc8e.0","@material/ripple":"=8.0.0-canary.774dcfc8e.0","@material/shape":"=8.0.0-canary.774dcfc8e.0","@material/theme":"=8.0.0-canary.774dcfc8e.0"},"publishConfig":{"access":"public"},"gitHead":"5f6894b191aacdb7da61e0e9f91bae96169fb190","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.19.1","_nodeVersion":"13.8.0","_npmVersion":"lerna/3.20.2/node@v13.8.0+x64 (darwin)","dist":{"integrity":"sha512-GDwbOVYK7j1T8lqlcpfBciEbw/UnuppH/li8Z7hWd0z2NypiHjcQxIlJyw8wb0xQotIkOMIUpl0zFJTugmRYDg==","shasum":"161477ad1a8edb78da97af5f316efb5db3403e19","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.19.1.tgz","fileCount":13,"unpackedSize":196392,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJff5tWCRA9TVsSAnZWagAAEREP/iKnCLo4MAsbcTZCAoSt\nIHlS+tnOWOn7d2qbeiS7jyaO4NbUMqVK2/Cl2jCLxrTfKFaM16A9rleYfbpW\n75iZhUN0J8wwgx89lbIK1QVkFxPLlYlpa8yUGLqNIsP6QbJkXOM5MIQbZbkz\n435UeMp7CKmXCjxckwEiGFPhqRPv0vB8ofVLxt/E/NFUU0JXeMLxk6EJZr4v\nK4cPuSraJ760tOLL1ZQVMh4NWSpWMFQlU66EgZUZxnzgQ8kRq3JKZFQqrpRP\n85JC//0K/gQRrH0JxUr0ZWt6U5oePxXKy37mMGSK7VEFnJbA0II4d2x0HVUV\nSurbTOFcv63YDYSYl3eg2gVbNFFuXelSM2x8k2XTqgX8Pves/mXS4Q0TwHIN\nmUnrpsk45gghQ1kcjFVDvqAR0oY9B2fAo+Nsxjzc7f1ZTu6ktsH01GfRhVZr\nzYlppag3mCFqYQTlZURSk2RCWpn7GfY9K+0ZtfALolKiPRP2oB7h+uPhc3J6\nbhW37UZX+yDCtrIG7XRMpYzyvk8QLDYHO7Cvq61zTNX9fQ1wrQ/XR/XCfxOT\nVN2lJRz1R2Aurd3oj2xxbdP3Hdu7EzI+A3P2fbbnb5H1twpMDNKcfKCRuv+e\nYvdjU6AOhluxDiKn1jm2IvEF5Snu1Rj7r0g5S4suz1oU0o8Dc9vkzrhVMzaw\nY6Jd\r\n=RzLa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFDQu4AjebJK07f4khIiFPp+HZLqqIZWDJW7cg2Yohm+AiATwLk/AtlRH/B/zHoozAOrSJdFyerdUsikG76iwQnMQA=="}]},"maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmUser":{"name":"emarquez","email":"emarquez@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.19.1_1602198357933_0.26655323958774435"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.20.0-canary.5f6894b1.0":{"name":"@material/mwc-textfield","version":"0.20.0-canary.5f6894b1.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.774dcfc8e.0","@material/line-ripple":"=8.0.0-canary.774dcfc8e.0","@material/mwc-base":"0.20.0-canary.5f6894b1.0","@material/mwc-floating-label":"0.20.0-canary.5f6894b1.0","@material/mwc-line-ripple":"0.20.0-canary.5f6894b1.0","@material/mwc-notched-outline":"0.20.0-canary.5f6894b1.0","@material/textfield":"=8.0.0-canary.774dcfc8e.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.20.0-canary.5f6894b1.0","@material/notched-outline":"=8.0.0-canary.774dcfc8e.0","@material/ripple":"=8.0.0-canary.774dcfc8e.0","@material/shape":"=8.0.0-canary.774dcfc8e.0","@material/theme":"=8.0.0-canary.774dcfc8e.0"},"publishConfig":{"access":"public"},"gitHead":"63718fb08d28bef1d0a9044bb2ae8026b49541a6","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/63718fb08d28bef1d0a9044bb2ae8026b49541a6/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/63718fb08d28bef1d0a9044bb2ae8026b49541a6/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/63718fb08d28bef1d0a9044bb2ae8026b49541a6/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/63718fb08d28bef1d0a9044bb2ae8026b49541a6/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/63718fb08d28bef1d0a9044bb2ae8026b49541a6/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/63718fb08d28bef1d0a9044bb2ae8026b49541a6/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/63718fb08d28bef1d0a9044bb2ae8026b49541a6/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/63718fb08d28bef1d0a9044bb2ae8026b49541a6/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.20.0-canary.5f6894b1.0","_nodeVersion":"10.22.1","_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","dist":{"integrity":"sha512-yFDIHhMsHnbcyEkcY3z9NT09tQ4UPsUU9w4zCfU3JvfH2kEbb46hZCwUqf8Y2mbuOs6+CCYlC6PRcxM77kz1Qg==","shasum":"d2243d6bc10e2af53283aa59ee4a42ac6f18cd91","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.20.0-canary.5f6894b1.0.tgz","fileCount":13,"unpackedSize":196495,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJff5uaCRA9TVsSAnZWagAADFYP/j3vSBmDmIKIVZmXAbeg\nqV/yvMlUOsjgTCf0xxZYqvmzSFlmF/lD0KhCArUZtorxNOpJa+g9sPRvtJul\nlJHBy4DKwdGyfr2OQ0MkEEDqXl6Dsphgn5doKx8Y0SplfQDnYwFYSJX2O31o\njVPc89arKNmi9e3kKABx6z0aeppq9WNNJJ0UJdl3KmgUWO69/yp3CMtKkh/P\n1qFLwOCYN3U9a6ZRYB+ptb8zvyoa75lOXzMDu89N1X204g3UEtjbKl3QOyTC\nWDqLK9n+R6fYiHUJq6FOLT7FOzy76QkdVC8am0kViaTEqrGv7SUgWM55noLw\nZgkEmKHW2wCgJ5bbdw0Gbd+H9GU45CtPEueHPWqpRciLl0A0pyn6FJP6bpxh\nHFUQZYurRULBldSifV+at10LkexfidQ5DCnEfXfMZsXmIqzJWXZtYnzMlubw\nKz35Ghj51S2g5ETOjVUvS/2sHq983hWE7J/diD6wutsTwIbnWiZo9+142ZbB\ntj7ILpTHpjHoidUrL3IXnRvz0jW/Qibs3oiKX+Fzt2AL3Hz1O1fmQG5bnWIt\nF6fRGnS6FA9cD1hV96BN4Uciy4uNf5IOp7m+N8Ck3ldvCFuWHlcGoJXuxvUS\nVrDyMZnun5bpqLP0sFRV6sfhqfoXkU8/uUBsX1X05HkDs6LywusONkZ9ZSfK\nor3o\r\n=dfwP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAaJeBYf8qIjj53IlkcB47C3KPdSL7k1+JliaJVb9JY6AiEAr/aid5DN1COI7e1ImXmiH8ePpy1SrGKBNBS09UL92Tw="}]},"maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.20.0-canary.5f6894b1.0_1602198425633_0.25127029754114116"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.20.0-canary.f6260d06.0":{"name":"@material/mwc-textfield","version":"0.20.0-canary.f6260d06.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.8a39352c8.0","@material/line-ripple":"=8.0.0-canary.8a39352c8.0","@material/mwc-base":"0.20.0-canary.f6260d06.0","@material/mwc-floating-label":"0.20.0-canary.f6260d06.0","@material/mwc-line-ripple":"0.20.0-canary.f6260d06.0","@material/mwc-notched-outline":"0.20.0-canary.f6260d06.0","@material/textfield":"=8.0.0-canary.8a39352c8.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.20.0-canary.f6260d06.0","@material/notched-outline":"=8.0.0-canary.8a39352c8.0","@material/ripple":"=8.0.0-canary.8a39352c8.0","@material/shape":"=8.0.0-canary.8a39352c8.0","@material/theme":"=8.0.0-canary.8a39352c8.0"},"publishConfig":{"access":"public"},"gitHead":"d0f921476509811c1109c8805b0eaf1e5cbb3218","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d0f921476509811c1109c8805b0eaf1e5cbb3218/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d0f921476509811c1109c8805b0eaf1e5cbb3218/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d0f921476509811c1109c8805b0eaf1e5cbb3218/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d0f921476509811c1109c8805b0eaf1e5cbb3218/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d0f921476509811c1109c8805b0eaf1e5cbb3218/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d0f921476509811c1109c8805b0eaf1e5cbb3218/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d0f921476509811c1109c8805b0eaf1e5cbb3218/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d0f921476509811c1109c8805b0eaf1e5cbb3218/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.20.0-canary.f6260d06.0","_nodeVersion":"10.22.1","_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","dist":{"integrity":"sha512-YWkbtNNyShhIQhRdi/EQW4Pwp1XUmkFmLejEbs1fHr+XwYiQeLrUqL0dS6yVeX1hz6P/pumVjkVKlIuVubkbUg==","shasum":"0b682b2a06cbe78aeeacc4c2f560fefd51f8cada","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.20.0-canary.f6260d06.0.tgz","fileCount":13,"unpackedSize":199538,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfhNnpCRA9TVsSAnZWagAA9ugP/iJ0CdMRSYUbmk94Bnnm\n7QQSrmDdKZ9/ziYjOa6rN09tLzKthf6WJjveGtsdYMBm4FZdF8hclLcMl7pL\nffBWZW+OjoLuGEqqrqd1ceMYa6LQVZ2d6RhzrDeUKA1yAoZh9Zj0NJHJnjaN\nrOUv0p0g0fE+5MZ+yP+ql9liiR7jBO52Aa+nHqNgd7Y816bD9CQc1ky6VU2W\nNlggTBPD2rVhSk2CdaV15Z7n8TR4PP8yE+IImjcJTkq6+Dee7IoIJBQakvtY\nB9lfdd1M0IvsYb4UOvIKBGUqDVg4t/6xFETSyK7SyWP8yMmM89hOZb+knC5Q\n5d7BMVm5Ix6pJKPMCpumRqfsfWwS/vzWKtCfZ9PEyTyLd+V8rkdog/7aY3Os\n3asxbr79eHaz4MwcU27+Zwue4ZnlOwNL4z/w8Cu2tSF7tjGqkpTm+NhdxTww\nQQH16nrOOl4XEvr6utMEkWbqRSsU0BsnpAsDMIctryMNlCQBfx7hURfuhrYe\nkMyKq1Vi6UkRg2af/aorfE0pFMLYVGLKjAc0jJu2Jka0Q9Z0tlsdVU5zflBI\nKEe4aSiwZVIXNTb3h81Fk/ql335dDU+CS7v8XtcGemTxATuR2AjVmjV0mhuY\nES9CcrgARg6QUR4qT5wdXFUaMrFSc8KlHdIhDenKwV4a+MdK96Ry9UOSMSWR\nFNaL\r\n=w/Lt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCnjlRieYHLCUj9prHUQQ70FWZH8rKjN8RUqO+0UGXcMwIhAK0T9SRnmoJcR6gcydr5bQON52KUy4Q0I7ekOSJvvhBD"}]},"maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.20.0-canary.f6260d06.0_1602542057380_0.34228284707295"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.20.0-canary.2d1b08aa.0":{"name":"@material/mwc-textfield","version":"0.20.0-canary.2d1b08aa.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.8a39352c8.0","@material/line-ripple":"=8.0.0-canary.8a39352c8.0","@material/mwc-base":"0.20.0-canary.2d1b08aa.0","@material/mwc-floating-label":"0.20.0-canary.2d1b08aa.0","@material/mwc-line-ripple":"0.20.0-canary.2d1b08aa.0","@material/mwc-notched-outline":"0.20.0-canary.2d1b08aa.0","@material/textfield":"=8.0.0-canary.8a39352c8.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.20.0-canary.2d1b08aa.0","@material/notched-outline":"=8.0.0-canary.8a39352c8.0","@material/ripple":"=8.0.0-canary.8a39352c8.0","@material/shape":"=8.0.0-canary.8a39352c8.0","@material/theme":"=8.0.0-canary.8a39352c8.0"},"publishConfig":{"access":"public"},"gitHead":"ecded3a50181254f2caf9e2d7049466e24129104","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ecded3a50181254f2caf9e2d7049466e24129104/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ecded3a50181254f2caf9e2d7049466e24129104/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ecded3a50181254f2caf9e2d7049466e24129104/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ecded3a50181254f2caf9e2d7049466e24129104/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ecded3a50181254f2caf9e2d7049466e24129104/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ecded3a50181254f2caf9e2d7049466e24129104/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ecded3a50181254f2caf9e2d7049466e24129104/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ecded3a50181254f2caf9e2d7049466e24129104/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.20.0-canary.2d1b08aa.0","_nodeVersion":"10.22.1","_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","dist":{"integrity":"sha512-gz10qTfoKG79MQai7uzM6ub98yyRhSlGWCAE5qFOolorueiAl5VbyPD9kq84N3+BJkguahcdGaSA4EnXeEFTUA==","shasum":"01b1a8d4f108c0de239da7cf92021bef99bf333b","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.20.0-canary.2d1b08aa.0.tgz","fileCount":13,"unpackedSize":199538,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfhf5jCRA9TVsSAnZWagAAAssP/01rv4RRESyTc8weKxFa\n4D3YAoWQ8V21gp0HZQEyorU4uDVHTlgWSkUrUdd3rkYEScEZE1mQ9VAziAHV\njf7GRma3PKNcMttpwFr6QaRkjbvcsEjuvXAGAZ8aSsmE+uhwC7SsUezvq6J3\nMLuaQe+hmyRNWB7fpzPE/3pMms0aGKYitAW6UKWiPA4e1DKwc606TxrH52/D\nf9j1mgsGvFlRflij3r9ejnGchbJAdwPp0ONCHx2n1Z51l69y6jfHfwUgAHCF\njbF2Z15PvWL2PEAlK7fkX3tTp56LFMUtvavSSX5mXwntA1A1mhSwPyZo6BCu\nv/B+6fon1SmIo/KNK0t4t1keE08SQqVl+WNHu9NmvdaZRH9Dgk4w4Pvcjimh\nh+SDTP/tNfVSpeK5zy6BmR/yC8wWfpa2cEWjcDt0dTmdgULg0+CLkUxO2DUb\npLkPgfiVe6G0yNPJIOLTpxzmvvaGJULel5Sw4U2SXYe/mDy+OKxKXr4lgNdt\n90mxwGengQhrOpiYzfntjUu9a/TsyMtH3g6yHtjWShdGbIP35Ywp1ZXd0E3d\nNEiqwpSerS6w/ajXEx4iDoCN04+b7XSsxQn/suqnthEQn9hc+KBipp5nDzje\n/MiuUv1WXx5PKmt/hSRgO7Z7U0Ey1i7lXX93Sqcy30zXEPazCiyxasNonRy3\npHIK\r\n=sntf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCgjrpUUfqZLZK4E+O4XGnHE6Al7XtTEagn2UKAb9SUogIhAKW1Rz9TfM9AkP6auZ7IYxw06UKaF7f1zrUpsKyD96rV"}]},"maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.20.0-canary.2d1b08aa.0_1602616930676_0.9009748098839381"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.20.0-canary.5bd58844.0":{"name":"@material/mwc-textfield","version":"0.20.0-canary.5bd58844.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.790ca85fd.0","@material/line-ripple":"=8.0.0-canary.790ca85fd.0","@material/mwc-base":"0.20.0-canary.5bd58844.0","@material/mwc-floating-label":"0.20.0-canary.5bd58844.0","@material/mwc-line-ripple":"0.20.0-canary.5bd58844.0","@material/mwc-notched-outline":"0.20.0-canary.5bd58844.0","@material/textfield":"=8.0.0-canary.790ca85fd.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.20.0-canary.5bd58844.0","@material/notched-outline":"=8.0.0-canary.790ca85fd.0","@material/ripple":"=8.0.0-canary.790ca85fd.0","@material/shape":"=8.0.0-canary.790ca85fd.0","@material/theme":"=8.0.0-canary.790ca85fd.0"},"publishConfig":{"access":"public"},"gitHead":"f577a3de2e8463259c7e4a5834fb1873a4bced9c","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f577a3de2e8463259c7e4a5834fb1873a4bced9c/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f577a3de2e8463259c7e4a5834fb1873a4bced9c/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f577a3de2e8463259c7e4a5834fb1873a4bced9c/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f577a3de2e8463259c7e4a5834fb1873a4bced9c/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f577a3de2e8463259c7e4a5834fb1873a4bced9c/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f577a3de2e8463259c7e4a5834fb1873a4bced9c/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f577a3de2e8463259c7e4a5834fb1873a4bced9c/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f577a3de2e8463259c7e4a5834fb1873a4bced9c/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.20.0-canary.5bd58844.0","_nodeVersion":"10.22.1","_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","dist":{"integrity":"sha512-o+NVzoN1BfRIqQh2/V9xMXvGAohaDw7e0MzldU+e2ut9ABjgCIX7+jiefQPNVoNWfVJ+1OjdLQHo6rscowTwrw==","shasum":"916b0145b5d7f51d8b38efcd29bb7f85a1fec0dc","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.20.0-canary.5bd58844.0.tgz","fileCount":13,"unpackedSize":199538,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfhjxLCRA9TVsSAnZWagAAw7kP/1xKmRWklI8rKIXQXjQ1\ncq3lnb/DRUIKavaLC3Wt08G3DDVFjuoPIwH/10c3vZNUgxdQ+1DUe/t5vZhu\nL2CbI/8GgQBe4WKwQMpGggqdL3N5O0Ydiz1GJat46JcM7O7aF92i8cMyZrRY\niI/Nv0wO8IyinNjrooi2JdqOAUbcIaTFEDX7CiOc0Cfwz+c8cIm5Ki8tMR0N\nTkQnOHi15bW2DoSWdKrJG8ZcgFSruKO02ZV0tAiMBuGglx4k9n4zVm0fP0RQ\nqG2J2NqSUKYTVxNf3A5IyVqi3HwAjYb4qEJzRTSG0IN4IhTSdYYao9TQgFYL\n63sALpZgBr9C2d4mJV0DOl2n8nbb44whNYuws9iFJAf23e8PwCFguaQDQ1xE\nG8bcYBGjTmKXKTmo2iVwj9b2Kp9CEJzigVSmWcPX+aB8mohBvWgwLBBlx6jx\nPLUHOjugqtXEW9SyZumZ7oAAIn83sfP6L488p4kVURfUj8oOvQDsfhTIYIHF\nHsSYcQwJfSClvzhpWZBHvkgoDhbYtyJrhkT8D5wpnRziA/biCQDr8ktcpTbd\nSA+Q8xLT4pl/jz2pggGngeBvZlLUVjeTkoq66FO/CCQuN5+HIHfH4cU/v6mx\n3xXK40nl1c+v7nHf1nrRvLFTbpS9dOBOS/koDy4CTQuyyv+mpXJUNwTGsK+l\nyjj1\r\n=i3W1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBH/va4MAggNijUB2/diPnEtz5rShPg/K1HWPiOM81JaAiEA5fLNKnMbwLVz4FHDhQJEYFtVMvodopiqxtimElgJO2s="}]},"maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.20.0-canary.5bd58844.0_1602632778822_0.8225667337921474"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.20.0-canary.bc846b29.0":{"name":"@material/mwc-textfield","version":"0.20.0-canary.bc846b29.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.c71ebfa02.0","@material/line-ripple":"=8.0.0-canary.c71ebfa02.0","@material/mwc-base":"0.20.0-canary.bc846b29.0","@material/mwc-floating-label":"0.20.0-canary.bc846b29.0","@material/mwc-line-ripple":"0.20.0-canary.bc846b29.0","@material/mwc-notched-outline":"0.20.0-canary.bc846b29.0","@material/textfield":"=8.0.0-canary.c71ebfa02.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.20.0-canary.bc846b29.0","@material/notched-outline":"=8.0.0-canary.c71ebfa02.0","@material/ripple":"=8.0.0-canary.c71ebfa02.0","@material/shape":"=8.0.0-canary.c71ebfa02.0","@material/theme":"=8.0.0-canary.c71ebfa02.0"},"publishConfig":{"access":"public"},"gitHead":"08ef67ebd3aef2e1a1cfc139021dd528a4275f6c","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/08ef67ebd3aef2e1a1cfc139021dd528a4275f6c/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/08ef67ebd3aef2e1a1cfc139021dd528a4275f6c/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/08ef67ebd3aef2e1a1cfc139021dd528a4275f6c/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/08ef67ebd3aef2e1a1cfc139021dd528a4275f6c/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/08ef67ebd3aef2e1a1cfc139021dd528a4275f6c/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/08ef67ebd3aef2e1a1cfc139021dd528a4275f6c/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/08ef67ebd3aef2e1a1cfc139021dd528a4275f6c/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/08ef67ebd3aef2e1a1cfc139021dd528a4275f6c/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.20.0-canary.bc846b29.0","_nodeVersion":"10.22.1","_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","dist":{"integrity":"sha512-3w7ROMOLjKx1pexrWr5GrVtO7tLbecnsznneblFPKHWObiPequvQAmOzoUP9dQw00nefSHqrS4SS+SM9g+VV5A==","shasum":"f7082e9a7200e4191f010effc795a405a60c18cd","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.20.0-canary.bc846b29.0.tgz","fileCount":13,"unpackedSize":199556,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfh0BVCRA9TVsSAnZWagAAfWkP+wTUq+rv74yKPEoJQnEO\nKfQREMRab8O8sjcF65eybH+rvC1nxi8twZWMO4lZIw7OC+USsvTRIAsVPNlY\nxCKTHHtS9nkJdm60BJHke7fKZiYSGxy1RrySvco97qplgop77yFDqYLyL0HF\nGhKraFEqkTJbJFSB2D8hl253/TJkxhYUUEncFLtb4yAWpw0meQcWgDBq+7Db\nfb49t67zu+g9jQClIpZ8nLaoZ0X55l0vgADk1X0LvlJwjz0hXiY4a7/ZKri4\nvjzF/4HXlvU0VxCDg3IFu8kDSL87gSYb2j1jGP+y5SZwPf1aeXmHrjpTWMaw\nYL9iTn44/qNGixMezpg9GVrF5CnVdNFTUD8Ow7CHpKOXK8fGA6Q28fmPj2RK\nhZM6obAolMyHHwGzCLDcuJU9c4BXDYoALiAbVooAMCYqzwTyF+yzlzgB6OKt\noj9zHHWFE9hVQR9MHwdY8z4wU1/a9tNkC0nGCfohImMZ6drAKixKI0Z/Y83s\nAJZfXUg7SQczvO0ZLRHg2rnTHKoJPZDpmSD1h7JoO2d5P9KScFkI90KAmnuj\n9xCf5e1yDvmMF+vzt5pKI/ru7fyYNLGRgerAN4ldNcnqxl3n3CtS6J6zrLZe\necF0JU3Gb+Lu0xmdGgsAH56xKQkeolZEljI2LbrzmDlKjEdumGVa+JzAp+31\nEWOA\r\n=3yh1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDiIj/fF5b7brAQMsHcVk6lXTMovvZSZLCR/0YIbRqVEwIgeFejAoMi+VIoNyHGgRCiqDNJgl+EdOM6oUrT7XXnDBc="}]},"maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.20.0-canary.bc846b29.0_1602699349004_0.7928937419881361"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.20.0-canary.3280b686.0":{"name":"@material/mwc-textfield","version":"0.20.0-canary.3280b686.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.c71ebfa02.0","@material/line-ripple":"=8.0.0-canary.c71ebfa02.0","@material/mwc-base":"0.20.0-canary.3280b686.0","@material/mwc-floating-label":"0.20.0-canary.3280b686.0","@material/mwc-line-ripple":"0.20.0-canary.3280b686.0","@material/mwc-notched-outline":"0.20.0-canary.3280b686.0","@material/textfield":"=8.0.0-canary.c71ebfa02.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.20.0-canary.3280b686.0","@material/notched-outline":"=8.0.0-canary.c71ebfa02.0","@material/ripple":"=8.0.0-canary.c71ebfa02.0","@material/shape":"=8.0.0-canary.c71ebfa02.0","@material/theme":"=8.0.0-canary.c71ebfa02.0"},"publishConfig":{"access":"public"},"gitHead":"b97a59c2fac8d04478f24f297f15106622007735","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b97a59c2fac8d04478f24f297f15106622007735/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b97a59c2fac8d04478f24f297f15106622007735/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b97a59c2fac8d04478f24f297f15106622007735/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b97a59c2fac8d04478f24f297f15106622007735/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b97a59c2fac8d04478f24f297f15106622007735/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b97a59c2fac8d04478f24f297f15106622007735/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b97a59c2fac8d04478f24f297f15106622007735/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b97a59c2fac8d04478f24f297f15106622007735/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.20.0-canary.3280b686.0","_nodeVersion":"10.22.1","_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","dist":{"integrity":"sha512-L1XEQlyoLQ1JuAiRSHPQpvbgSNcItoqwSTvgZI0NC+Jx8P6v0p8i89WNbcLGHKf2RdHJnxuBJO1QkJQq8c7wTQ==","shasum":"bfae5767ece91fe621134c327892292c69129d64","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.20.0-canary.3280b686.0.tgz","fileCount":13,"unpackedSize":199556,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfiOOdCRA9TVsSAnZWagAApOwP/3+UpJlQjlBL/M9tbwAj\nrjZjGjMMB547x6s/Hfmif2+kZHmJmG4qvRedGvVIlGXtMG2+s8fA5MUVyQzX\nQ0c+jgREOUSCXvIedAPwUCKiyqPow3a5Yw642Upk6YjExoShbbuXSqCTn8YE\nH0qOQNhiCtV/n1ruNSFdpmMkZGYiZsyAnOce61INr0kGME1wUwJXDuyklems\nxUqk0/Mz/Lt+VNCr4Hj6rZsN7uEG0oFiFXpr+ewfDF6twxWGSVgcUwZShlD0\nBsvL72DmpUSv1BWJlKhAdnO3TzMzq9gTChrYBkhOIQknlcMAqsJqUhiDk1aa\np5cAt3j/oms49sjbLGue0oF7twmAaPv5F9QsPX+8FFIEAcaorrKh9NI1jiwS\nhbomLWzS6PrjvTrqWflRjphn5rHxqFzkrCKrv8IPXCtzJS4hcopf+RmxMPrq\nzG80o8c5cpagyNIGM2Cwbn40zh2ynjniAx2sEltFGYX8xM7+I4y3qmalQ5Pd\nSF4WRAaUGhrfJCrc1GPpw20e8qboZ8baptFy+LG0p/M7R+8dF9BFWnMKhxp6\nGgNqn8hSm28jzgXQTtiowweCCjrIjBg6Sr5d/h3tzrQCVCXymobtLwdGzxhA\n7LuYjY2VNtt2NO9UNieoary1NRh0MRQah+1H4pu+LJwn3lrAXelZpXBVByLz\nhoRV\r\n=a6s8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHwAtntZ/EhyN9OSfqoFfR+Xh6PIgwUtggbykcPN8SjZAiAEI/+pwUh65oEjvlKgEDIrX136N7iWAXfIAxCCtzhdDw=="}]},"maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.20.0-canary.3280b686.0_1602806685252_0.01583719544759843"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.20.0-canary.9e94cd38.0":{"name":"@material/mwc-textfield","version":"0.20.0-canary.9e94cd38.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.c71ebfa02.0","@material/line-ripple":"=8.0.0-canary.c71ebfa02.0","@material/mwc-base":"0.20.0-canary.9e94cd38.0","@material/mwc-floating-label":"0.20.0-canary.9e94cd38.0","@material/mwc-line-ripple":"0.20.0-canary.9e94cd38.0","@material/mwc-notched-outline":"0.20.0-canary.9e94cd38.0","@material/textfield":"=8.0.0-canary.c71ebfa02.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.20.0-canary.9e94cd38.0","@material/notched-outline":"=8.0.0-canary.c71ebfa02.0","@material/ripple":"=8.0.0-canary.c71ebfa02.0","@material/shape":"=8.0.0-canary.c71ebfa02.0","@material/theme":"=8.0.0-canary.c71ebfa02.0"},"publishConfig":{"access":"public"},"gitHead":"805fad1d9b182d084e682ab7e59a4e45d40872a2","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/805fad1d9b182d084e682ab7e59a4e45d40872a2/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/805fad1d9b182d084e682ab7e59a4e45d40872a2/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/805fad1d9b182d084e682ab7e59a4e45d40872a2/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/805fad1d9b182d084e682ab7e59a4e45d40872a2/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/805fad1d9b182d084e682ab7e59a4e45d40872a2/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/805fad1d9b182d084e682ab7e59a4e45d40872a2/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/805fad1d9b182d084e682ab7e59a4e45d40872a2/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/805fad1d9b182d084e682ab7e59a4e45d40872a2/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.20.0-canary.9e94cd38.0","_nodeVersion":"10.22.1","_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","dist":{"integrity":"sha512-MnnA740nmxHFhncalq644P+eQpczKgKnhXD0OzBlQ6eNZrLxVrUPdTzpzekKV648ontfWEq8JqHrKhoJrJcKlA==","shasum":"26595ecfca1614dde8065b00410635a4a18ee6bf","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.20.0-canary.9e94cd38.0.tgz","fileCount":13,"unpackedSize":199556,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfig0wCRA9TVsSAnZWagAAYbUQAIl11kcsuA1HNd3oH9ti\nS8rNkbLtpjwTMiGkMK7PXS5XkHBHIHBnFymPON0jGP1JJyBaTz4g0blrUWqo\ntRcVpVTbTStU9neC26d/9nsGb2q2khAvMrzTUyIu4vCAMDWQeiGDIhT3tuJW\nyo3HlwTLXS1TZ5kRD14PXhGc31EUmk5Ye7uvBhEff0yKJ8gGKZMxxqgGQbv/\neP0mrgOEel3Cz2h3ub7VHFJDHHbh6aVXbrrvNS9GcDhkYBkbaMTWDFLZYyLq\n572a9PBcn5zzs0ZHoMAfzcZixxaso+DUweWX1NdaVJJNkHF4S0qgn2dm1grL\nfO1F5uPvmNsu2DP+bE7Vn+wQv7ieuNib4qZN/FCojkjWYPhg5OwWqL/41nlE\njxf/HH6V9AGslyKpua5PXdRlkPIGH9HcrR+Mqq+sCq2a4Uq0W+JJLXXt70ht\nTcJrjOw0z85ceOvWBHg6Pa1qhHXJYnW4YWy4xUrttzNoMOWXTkStnlnNEnHk\n2R+zXEWPWQGPaQPyDeDRnNnRS2hdcJnjPT3+6vv/CTbv0T4XQ7YTLnEFHj74\n/fG3EAu7Ld0kjE35V+vEy8lYvGTJlKIWq2cbQvx4naUfglfHI3hCT2E7nCDU\nJnvz9Ai2RHGZW/7jEynW5Nwz+oHSQqnzVU6LxNjNeNEzvMIGp8lr5Iz4+u8h\nyUsx\r\n=xoSm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDvmIIUeQTLKiA6plCD8COL4x8UZUXHRMbQzYfWUJlKqAIgV+s7E4q1KINivqA+f3OVsG3+Gu+yItj+hcq2YvwJrTg="}]},"maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.20.0-canary.9e94cd38.0_1602882864096_0.675255390498074"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.20.0-canary.4773c773.0":{"name":"@material/mwc-textfield","version":"0.20.0-canary.4773c773.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.2ab716cbd.0","@material/line-ripple":"=8.0.0-canary.2ab716cbd.0","@material/mwc-base":"0.20.0-canary.4773c773.0","@material/mwc-floating-label":"0.20.0-canary.4773c773.0","@material/mwc-line-ripple":"0.20.0-canary.4773c773.0","@material/mwc-notched-outline":"0.20.0-canary.4773c773.0","@material/textfield":"=8.0.0-canary.2ab716cbd.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.20.0-canary.4773c773.0","@material/notched-outline":"=8.0.0-canary.2ab716cbd.0","@material/ripple":"=8.0.0-canary.2ab716cbd.0","@material/shape":"=8.0.0-canary.2ab716cbd.0","@material/theme":"=8.0.0-canary.2ab716cbd.0"},"publishConfig":{"access":"public"},"gitHead":"fbc8b44864ae10f0bb46e568b25bf4de49eab777","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/fbc8b44864ae10f0bb46e568b25bf4de49eab777/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/fbc8b44864ae10f0bb46e568b25bf4de49eab777/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/fbc8b44864ae10f0bb46e568b25bf4de49eab777/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/fbc8b44864ae10f0bb46e568b25bf4de49eab777/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/fbc8b44864ae10f0bb46e568b25bf4de49eab777/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/fbc8b44864ae10f0bb46e568b25bf4de49eab777/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/fbc8b44864ae10f0bb46e568b25bf4de49eab777/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/fbc8b44864ae10f0bb46e568b25bf4de49eab777/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.20.0-canary.4773c773.0","_nodeVersion":"10.22.1","_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","dist":{"integrity":"sha512-6rRa7kmUEEx+AtwMuQlrbh47eJSs1elIIVm7CO1Nwwxb1rLmp2f2ikPGKjdIyxr3e9yBG34s5SiO/Vq8WG2t6A==","shasum":"d1858675cc81ea75d01b4174d4149cbcb0bc0729","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.20.0-canary.4773c773.0.tgz","fileCount":13,"unpackedSize":199556,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfih/kCRA9TVsSAnZWagAAuQUP/A0m9o7mTkRr4Blu8Tdd\nbTv/D69bbDe2qUdI0mJvgd1bbX4d5DrhM+82EYlxQNEsRI+Eiasf/MSyiTj0\nfMzFKQCGpk4TPSrcudHbqoq4ST/SF1HjNjeuQGWSPjbsgyOp92W2uCgja3jW\nrc1Yo8Bvp9Oo86mX7XxTyrY0Dthe+HtTgzXpjMGt/XP9XZScEhMta5JjDHj4\nsLchhXPXoVRB5cr1WPmuMjxtuS6MuSMcD/Rk05L38ZhMiDvLBSik+9VzMsAr\nJxKMl3IWwB903f4Awmsmdrc1uUtkz0YI9a4hm5ZLLlT7gZuM22epRI+lh6sI\nJwxgoUfMS8Wj8yzriLC4SHJENYByUm1+xhFAmcFzaFMUEOySrlKcwO1ayjP6\nTcIunSzgU7QvAs+ZnYuV9Oqj3rRCc7KW1dztXOURiCo1qctpY/FTZ6zWF34b\nxUu9AxEWjQSYkA26YKAUd4aUCExJW5HEsM4pWducnlS7lUDrNoaF+ymcwa3R\niOoPwQ3shReZ2Oi4R1o1Mbdqenbh4JIIK2v6yNwYKcARnt5GWFBLaUVc9YRf\nMk3hmOw2jtkfv2kDm/WeOe5eseNSw13Ib6r8TQN0mDqc4BcyC8xJJM4+3RAG\n0Q/4CBXWo2jCYvv9emigyPVjIXKkmpOtGBD0KIM0Ow0iMEFnPNNajA2sNL1O\nwS8A\r\n=L3kF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDNKI7WsUSD5sNTClxyKFzcCW/dY+pV6W4m+HHghGUM1AIgKWVYqM8KJscBwORWtiVVlJ/1MEX3t3mbTHpoGTl6oYQ="}]},"maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.20.0-canary.4773c773.0_1602887652082_0.4452706372609685"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.20.0-canary.65787913.0":{"name":"@material/mwc-textfield","version":"0.20.0-canary.65787913.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.43c1c5e2f.0","@material/line-ripple":"=8.0.0-canary.43c1c5e2f.0","@material/mwc-base":"0.20.0-canary.65787913.0","@material/mwc-floating-label":"0.20.0-canary.65787913.0","@material/mwc-line-ripple":"0.20.0-canary.65787913.0","@material/mwc-notched-outline":"0.20.0-canary.65787913.0","@material/textfield":"=8.0.0-canary.43c1c5e2f.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.20.0-canary.65787913.0","@material/notched-outline":"=8.0.0-canary.43c1c5e2f.0","@material/ripple":"=8.0.0-canary.43c1c5e2f.0","@material/shape":"=8.0.0-canary.43c1c5e2f.0","@material/theme":"=8.0.0-canary.43c1c5e2f.0"},"publishConfig":{"access":"public"},"gitHead":"b21d55977da5e0c291e9fcf3fb992ff4c683233c","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b21d55977da5e0c291e9fcf3fb992ff4c683233c/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b21d55977da5e0c291e9fcf3fb992ff4c683233c/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b21d55977da5e0c291e9fcf3fb992ff4c683233c/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b21d55977da5e0c291e9fcf3fb992ff4c683233c/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b21d55977da5e0c291e9fcf3fb992ff4c683233c/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b21d55977da5e0c291e9fcf3fb992ff4c683233c/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b21d55977da5e0c291e9fcf3fb992ff4c683233c/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b21d55977da5e0c291e9fcf3fb992ff4c683233c/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on input rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.20.0-canary.65787913.0","_nodeVersion":"10.22.1","_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","dist":{"integrity":"sha512-EqiJMR7aJUjpNoh/9cTRnRP1YFJ3DTg6Ean8Lb1xEsL0zyM3/4kz0/1j+XqvR+H+D+L/DuEjeNN2ThDlM//bWg==","shasum":"c7f5971c452ca3186ee42f321fbe7295d3c4a022","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.20.0-canary.65787913.0.tgz","fileCount":13,"unpackedSize":199556,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfjeAUCRA9TVsSAnZWagAArWUQAJ5fq/zmbjgL6HzSUDRu\nvZq9x7dfPvFzNB3kxW/Fsl+a/Mm0I2+RBoduc6io2uZKObu6n63ZdpYusleV\n69s0qYyr7Ig9oyj5WrtlABLeIOqPuTVHELiAlD1v8oQZAiR+QJj2SugPrhhT\n6d1ATNTSlzzLN8/iE/JnLPTnqO0t89j40tw3udHPi0V6Mz3Gj9VqknZdUwSy\niJckgwivAGwDsDh9ZdQ+7dJt0DLG32AA8dmTPlpiQsZ4e/hvkwGZ/Jrsjy0r\np/+aXa+lUHC+AAYHMSSQEg4fWKIXciFM2R0OQTGmZgXqV6eN3YygKbmv+Fxd\nLoNtmyo4ynKNCTufeUMcGQ+7lbNFse43esR/RwAR4S9gnM05NGe2PMrJo4Om\nbPrEWghpha719Bn3RQXpfdWAQUeP4sExaiv2QS08Jy21bLMARE3INYBImdNF\noxU/xOEjJ+IGhQqoq7DtheeXMGYU3NcRHMj2eLH1Rdlx61lK4T27oBopINor\ndSWtymQf3DIp9nigQoLy7uEpeZ9m64uu75QqCfb/GpoDsXR3/4N3pbp8c/+p\nfI17t6Ig03JWVkvxnVU2Mwr6G7S9deFEJ2Sxs68c7xHl4/9I8Wv36G/mfj3n\ncaBvzQ5ETAmEPwkYeyxykzM9b06MOUwRKUIukzKvWMgm+CdLst7+l+C1geaU\njbgJ\r\n=3Pt/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFBICSDcICD3MTRXGF0aFHpmfVmLW9N8aeMuvM2qQAm8AiEArPm9jlWXQgB6QoN1yCGyZJbIaSoEytmbpY6pyKQmFl0="}]},"maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.20.0-canary.65787913.0_1603133460283_0.386218820427388"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.20.0-canary.5485fba3.0":{"name":"@material/mwc-textfield","version":"0.20.0-canary.5485fba3.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.43c1c5e2f.0","@material/line-ripple":"=8.0.0-canary.43c1c5e2f.0","@material/mwc-base":"0.20.0-canary.5485fba3.0","@material/mwc-floating-label":"0.20.0-canary.5485fba3.0","@material/mwc-line-ripple":"0.20.0-canary.5485fba3.0","@material/mwc-notched-outline":"0.20.0-canary.5485fba3.0","@material/textfield":"=8.0.0-canary.43c1c5e2f.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.20.0-canary.5485fba3.0","@material/notched-outline":"=8.0.0-canary.43c1c5e2f.0","@material/ripple":"=8.0.0-canary.43c1c5e2f.0","@material/shape":"=8.0.0-canary.43c1c5e2f.0","@material/theme":"=8.0.0-canary.43c1c5e2f.0"},"publishConfig":{"access":"public"},"gitHead":"9648298c6a3406f312222d0c0949954cc1e250e4","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9648298c6a3406f312222d0c0949954cc1e250e4/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9648298c6a3406f312222d0c0949954cc1e250e4/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9648298c6a3406f312222d0c0949954cc1e250e4/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9648298c6a3406f312222d0c0949954cc1e250e4/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9648298c6a3406f312222d0c0949954cc1e250e4/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9648298c6a3406f312222d0c0949954cc1e250e4/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9648298c6a3406f312222d0c0949954cc1e250e4/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9648298c6a3406f312222d0c0949954cc1e250e4/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.20.0-canary.5485fba3.0","_nodeVersion":"10.22.1","_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","dist":{"integrity":"sha512-J/tXzZpM1nF57TuKDiiw08TcdUcxfc3SreA3PcnURi1GiRzDe4aW+8Kgo5U4h9utps4RYW+O+kLe1go+4LRLqw==","shasum":"7dfd53efa4be5f8011382d573f00d624c30405eb","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.20.0-canary.5485fba3.0.tgz","fileCount":13,"unpackedSize":200239,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfjgQNCRA9TVsSAnZWagAAn+sP/RlHndTrDAkwtc5jBiCf\nHKsSL0j/7MtpLkE5zqV47jfFR/LE0g5pDAvNmuA75Iyv7ge/lpaTrPyKu64+\n6+oLH5FtnEJMXi9dG8MyFsiFfJaBZWKmf7jTQ065JuIXqfru/sdVOO4EuxDT\nwnFtdFs6n99DPx/QesvJ+lW1zjyjw3JvOI03wII1q6YXD2tABdtCIUQE5zP8\nlY5vIO6Pm/nB8sIl6gPzyemhkGNtjS+7XFIpYq9KpBXFqlCQFO6n/TA6OT2D\noerA8lsQFF7ad5Sf+2CrEPIsW3LR36IWp0MhzIKm9IYH1bL8pNuGclwBaydG\naVSAn4DJ+l32mMn0ISKLdLVMHlDaAyl10ZVTTneCGNuxVTSuZnFWEXpYzAyy\nlvHA31DzCIuU8qWjiRL8za0OtTwJd8csx1wBBNJGKBuKiBFy+zsWvSxarwAY\nY+bD5KiTrBL8Q2JYhNxdGpfzm8cWWBIoxPwqZwcvhKueYGmwkV9d5jvaVbfX\nhSDMTq8xtLy/V6ytCXKSujFQwxTcMpR2+CUwlu3VWKpFFi/ENtFQiA/vPRy2\nrCJEPQPqYRdH4OMvzwqavQSlktQt6CFndSeITIvv4qwdJ58WJOCURN3xJ2Dq\n5igCsDudG3wES0Rvcyqu7jlOmRq6YFJ2SCiBQ4V6PnkmdeCbHVRNQ3wLORVN\nmdMR\r\n=Tv4s\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD+7kiCR7krJzvAwrJnlZH8yNws7+CVTCOZL8kd8NnXbQIgQBf/6bCsAvvYcTdi1gk/0myQzmZaVvJWo/IamyRnftc="}]},"maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.20.0-canary.5485fba3.0_1603142669434_0.11017821483074486"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.20.0-canary.a39d0a92.0":{"name":"@material/mwc-textfield","version":"0.20.0-canary.a39d0a92.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.43c1c5e2f.0","@material/line-ripple":"=8.0.0-canary.43c1c5e2f.0","@material/mwc-base":"0.20.0-canary.a39d0a92.0","@material/mwc-floating-label":"0.20.0-canary.a39d0a92.0","@material/mwc-line-ripple":"0.20.0-canary.a39d0a92.0","@material/mwc-notched-outline":"0.20.0-canary.a39d0a92.0","@material/textfield":"=8.0.0-canary.43c1c5e2f.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.20.0-canary.a39d0a92.0","@material/notched-outline":"=8.0.0-canary.43c1c5e2f.0","@material/ripple":"=8.0.0-canary.43c1c5e2f.0","@material/shape":"=8.0.0-canary.43c1c5e2f.0","@material/theme":"=8.0.0-canary.43c1c5e2f.0"},"publishConfig":{"access":"public"},"gitHead":"c523e6fd9acdd92ef501444da567a8910ed478e7","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c523e6fd9acdd92ef501444da567a8910ed478e7/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c523e6fd9acdd92ef501444da567a8910ed478e7/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c523e6fd9acdd92ef501444da567a8910ed478e7/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c523e6fd9acdd92ef501444da567a8910ed478e7/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c523e6fd9acdd92ef501444da567a8910ed478e7/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c523e6fd9acdd92ef501444da567a8910ed478e7/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c523e6fd9acdd92ef501444da567a8910ed478e7/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c523e6fd9acdd92ef501444da567a8910ed478e7/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.20.0-canary.a39d0a92.0","_nodeVersion":"10.22.1","_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","dist":{"integrity":"sha512-Ke+CPHeooai0GHrDOtmgk5oU05RC7k/7kjNm+uC3BXzPPpaX3jOcaEHqqVsv3ZIaAW/MDpl66APyQ+dSvi4LwQ==","shasum":"132d6e09836f094213dd92d65bb63e64453325b3","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.20.0-canary.a39d0a92.0.tgz","fileCount":13,"unpackedSize":200239,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfk0nmCRA9TVsSAnZWagAAFDEP/A2cS4Ez31mX6x14iAf7\nfcrxcMKFFnpCHSWnPa0tkBAAew2NUcx2Fmn70zdbeIeJccHmjGaKzGxh6+fo\n8rOGXSYkZdebknounh9eKB2b0NJKzBUFAVb5MKkL3FFHuHGKXQiMW/vQfUvC\nJm+UrSFMp2stuv4JOlvbFpa86qNZw2xiq6+/ZW2Pvtf+QLvdu6N6U02SvcIM\nSeC0fFspnb839zSMUZfp/aAdoCGBAFWhgoDvDLsZczI2EEPwkfYc4uvgsz/g\nty6ssuew95HdIXHo9sORCdFIHtaoWHKuPtea45gYNcz+xhI6EArDxW7enYdC\nlnZ6BgBacr4kpgfGy5GFU+iNdppjdJ3LPQivStVv1kloJfqcCzcYhZ2/+K/G\newAxnNCnALFBWQ9fFSuWEBq9a+dkP0KDkH8DnVPd7CWN62svAat1+oWQhgis\nhFgTvS6Hem7HjvoEGhUH0cuBTfRf7rK/vewP9Sxvh2wY7rTpDJvt9ae3b+8V\nBDHXVd9J7CPTFtH1cNJ0DA2VPYCS/OkP619WzeWJU+Ro9lUhkvBEQiYjGtJ1\nhmz1A3taCNnNSewEEwxcsK2MdtLw1Yt0RQWrO0Ug9REwNUvVuy12adEmzZgJ\nB9twehqOfgdEdxuXZ+iqD8g86H+OP/aSyhwv5Yx9Ho006wfPHJ3n7q0fHOPp\nSVdc\r\n=CCTE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC6ANFPCqFLwXAGdyeZUqQaGZaD/QkuLlpieB/Pv8njWwIgJ+4pXd0hlHoCY0pOhhg5JTgYeOGDorCeAs0wabEtsCo="}]},"maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.20.0-canary.a39d0a92.0_1603488230265_0.9087613277839117"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.20.0-canary.4eafcbc1.0":{"name":"@material/mwc-textfield","version":"0.20.0-canary.4eafcbc1.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.ccc64eea3.0","@material/line-ripple":"=8.0.0-canary.ccc64eea3.0","@material/mwc-base":"0.20.0-canary.4eafcbc1.0","@material/mwc-floating-label":"0.20.0-canary.4eafcbc1.0","@material/mwc-line-ripple":"0.20.0-canary.4eafcbc1.0","@material/mwc-notched-outline":"0.20.0-canary.4eafcbc1.0","@material/textfield":"=8.0.0-canary.ccc64eea3.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.20.0-canary.4eafcbc1.0","@material/notched-outline":"=8.0.0-canary.ccc64eea3.0","@material/ripple":"=8.0.0-canary.ccc64eea3.0","@material/shape":"=8.0.0-canary.ccc64eea3.0","@material/theme":"=8.0.0-canary.ccc64eea3.0"},"publishConfig":{"access":"public"},"gitHead":"d5be869d7cb28aaf425a4fae37a4f61d918dc1d4","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d5be869d7cb28aaf425a4fae37a4f61d918dc1d4/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d5be869d7cb28aaf425a4fae37a4f61d918dc1d4/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d5be869d7cb28aaf425a4fae37a4f61d918dc1d4/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d5be869d7cb28aaf425a4fae37a4f61d918dc1d4/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d5be869d7cb28aaf425a4fae37a4f61d918dc1d4/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d5be869d7cb28aaf425a4fae37a4f61d918dc1d4/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d5be869d7cb28aaf425a4fae37a4f61d918dc1d4/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d5be869d7cb28aaf425a4fae37a4f61d918dc1d4/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.20.0-canary.4eafcbc1.0","_nodeVersion":"10.22.1","_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","dist":{"integrity":"sha512-dfnDEHtSnVvZk397RrZT8z5TNj9VbpVvnooh92ZNhOKKZ294K4qjSDFjevgaKDI+PFb7WBOF+MBUwmBaPS18zw==","shasum":"ab9d64c4794dfcf6b4bb8e7ad4975f33a8f40fdb","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.20.0-canary.4eafcbc1.0.tgz","fileCount":13,"unpackedSize":200239,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfl3X8CRA9TVsSAnZWagAA0DsP/A5dV6VYM/lfcRbAxTb4\n1w5e3WqnkSMZdxZwEsHHrONSwp0+s+88NMY8hDi2bEJ2bUY0dAz/fXCesb7f\n4LngYZa+dQb2NzohbUwQZif034Zg/SAn0J4fnzu60xafEkq8Tm/7AbZEjpIe\nxF06jWOzWQtezHrijhMl8hxYmZxIudgvNt7E6lPYTIPhAMJRglSkkCvu3MOX\nxZvYsHLXyh+esK2+A+FnY5MkHT5fsLUMK5BXsBxIFKj9+wijcIoRFs8APL5+\n6VZJV51Om6zKcUazfpHDzdYqLyTAV7NFy6nkFNj4vYHe80CBlLKyKccPDEi8\npmK2GCeePktvNuOINrjzL32RVYaRJmy0iLyDAZC3bFO3ZW6tX1zwWZ0HP4XS\nHzoVNUaHd95P7K7PoxQB16BRdUzs4Y22vpLbORtcEpzi2atXtKMLof7TfSd0\nk+GGvBkatXX7pM//tZJDbsOVqV9zqjpsJCvuTyZEBBlvCgBfQBoEQjULZxPo\ntu0ZPqFvEqBXe6C8J6thu9K2MfYXm98EQLhx/oqIs+sppoMA4/b/P9m2gU13\n10hmsOEpwKp/OZq9NcAi18wfhum2yG8XfTCy8eGoC4Qe1HNF5yd/8T4A+kfz\nGZzVid76f20ppfkrYF22dVz8HJjauji0dzBc2ZFRXyXjGoDN+RUlQzn/m6sV\nYOPN\r\n=nwjw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIACD0fsafwU/XMjmkZcRJAb79XaOUJhcQ6Pc+HjTOjG2AiBcbdCugdpdFJE2lpUnB7FDdEpaZmaPXvctyDZMdn/tkw=="}]},"maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.20.0-canary.4eafcbc1.0_1603761660246_0.7003933474187256"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.20.0-canary.32961593.0":{"name":"@material/mwc-textfield","version":"0.20.0-canary.32961593.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.a79cdd019.0","@material/line-ripple":"=8.0.0-canary.a79cdd019.0","@material/mwc-base":"0.20.0-canary.32961593.0","@material/mwc-floating-label":"0.20.0-canary.32961593.0","@material/mwc-line-ripple":"0.20.0-canary.32961593.0","@material/mwc-notched-outline":"0.20.0-canary.32961593.0","@material/textfield":"=8.0.0-canary.a79cdd019.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.20.0-canary.32961593.0","@material/notched-outline":"=8.0.0-canary.a79cdd019.0","@material/ripple":"=8.0.0-canary.a79cdd019.0","@material/shape":"=8.0.0-canary.a79cdd019.0","@material/theme":"=8.0.0-canary.a79cdd019.0"},"publishConfig":{"access":"public"},"gitHead":"af0d60d5c2174ff8ae5098ea73212398be59bc74","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/af0d60d5c2174ff8ae5098ea73212398be59bc74/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/af0d60d5c2174ff8ae5098ea73212398be59bc74/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/af0d60d5c2174ff8ae5098ea73212398be59bc74/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/af0d60d5c2174ff8ae5098ea73212398be59bc74/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/af0d60d5c2174ff8ae5098ea73212398be59bc74/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/af0d60d5c2174ff8ae5098ea73212398be59bc74/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/af0d60d5c2174ff8ae5098ea73212398be59bc74/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/af0d60d5c2174ff8ae5098ea73212398be59bc74/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.20.0-canary.32961593.0","_nodeVersion":"10.22.1","_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","dist":{"integrity":"sha512-dhEQ2orwftvaecrcdHu+qccmXWq0p5ulAgGfsBvMV+kDDM3UQ6vU5YZ1J/xInI3HOuarwihyxjppsJLZ+VbVVw==","shasum":"2ce900081714e415cf6c9f06d253717ac7b8eb94","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.20.0-canary.32961593.0.tgz","fileCount":13,"unpackedSize":200239,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfmL3ACRA9TVsSAnZWagAAIFgP/jk9lO6uprk0ZfDeceAz\n6l7hP0eclYoSV5OWVX205hl3wZiziQTQo+ObH404eqH1K0mWCq0JNyqEZLcr\n/EL5Z9sm3ej6WU2GJV4YHOoR6Wf9zRDu/GiTRN4f5LetRYuXG7ImPhNG56JR\n53sSxNst/9vBzlg1ML2c97O16+3RueRIUWbMSE49cfniD967iJHQ2JVsemtu\nY0vNCcpaznMLngeNaFgidqQhcZJ+g/hJQS4UAueBBVy1VjG+s5ehtmwxKSqB\npeeaKsUaqKANx39u6sxevMJlR+u+yTaYQggywXYkke6Oc7z4dG3i/PXl764m\nK3iCOyfxzaxZm3Jh3My9fWtNNFqC9jkcdLLDdvabV+yuuuWAjTgse1Dy7vxp\nj69+9n7OC3hkVyp4csb8Zb6+VQPP21ufPWrNl/NbPG70wnA1FIFpJVwZzVo2\nN1Xb43JEXp8yLqKpd01tKOwYX7R1QPyT4zJGhR46m+6raVRSNSgshUcV/lOj\nAQ/f9U2xp01u341F3Sv+PWYwFWW/vtG+5Bd622pMXud1vQFVfx5LZrSyoc3p\nKKrxnC5X3Ti2+xytotWOKenuZSnBFD8ouTGE/RT+buiwCH3ZUP/c4PCsPJFe\n847r3ZjMPVKi+8jNwaPxCsYr9dOpFeW95gbEQeJN0v9VHr4J7XDZaA84USEZ\njyRQ\r\n=+n00\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGWtPgZFqIt7iuQuXdYDu6K3jgm0aygSCggUsYftbekaAiEA3pUV5neala3i0z5hpDKrjJ2IaurxnJspaGr2Vm7v+RM="}]},"maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.20.0-canary.32961593.0_1603845568022_0.32081500181065525"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.20.0-canary.8e3a0601.0":{"name":"@material/mwc-textfield","version":"0.20.0-canary.8e3a0601.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.a79cdd019.0","@material/line-ripple":"=8.0.0-canary.a79cdd019.0","@material/mwc-base":"0.20.0-canary.8e3a0601.0","@material/mwc-floating-label":"0.20.0-canary.8e3a0601.0","@material/mwc-line-ripple":"0.20.0-canary.8e3a0601.0","@material/mwc-notched-outline":"0.20.0-canary.8e3a0601.0","@material/textfield":"=8.0.0-canary.a79cdd019.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.20.0-canary.8e3a0601.0","@material/notched-outline":"=8.0.0-canary.a79cdd019.0","@material/ripple":"=8.0.0-canary.a79cdd019.0","@material/shape":"=8.0.0-canary.a79cdd019.0","@material/theme":"=8.0.0-canary.a79cdd019.0"},"publishConfig":{"access":"public"},"gitHead":"a21493f177ef3992fcd667ec3ce774d4fc926d7a","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a21493f177ef3992fcd667ec3ce774d4fc926d7a/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a21493f177ef3992fcd667ec3ce774d4fc926d7a/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a21493f177ef3992fcd667ec3ce774d4fc926d7a/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a21493f177ef3992fcd667ec3ce774d4fc926d7a/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a21493f177ef3992fcd667ec3ce774d4fc926d7a/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a21493f177ef3992fcd667ec3ce774d4fc926d7a/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a21493f177ef3992fcd667ec3ce774d4fc926d7a/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a21493f177ef3992fcd667ec3ce774d4fc926d7a/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.20.0-canary.8e3a0601.0","_nodeVersion":"10.22.1","_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","dist":{"integrity":"sha512-r7C8OXMi3irtBwQ9FwOgu/qpAP0PW0rWWdZU+ho0nrM/MzSbWf+3brgiXPYYWvkOcP8nSIwvO8vHV58vfH8ZMg==","shasum":"f5943a5d2b644705faddc7c15da8f4af00c960e7","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.20.0-canary.8e3a0601.0.tgz","fileCount":13,"unpackedSize":200239,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfmzX6CRA9TVsSAnZWagAAHL8P/iFomJtIpx50tXnhofkW\n0KVEiTZUmgsH/EjdOH+yaYQbZrthQYUm6EpIrOPMljUQYciAZcySrqqeLytG\neTz4hM6XQfdPRy0ska8XFPvar5TVGH7RnhRhE2s3HqtGH0CHq8IBpGWsR//d\nj8GoysKs+9bOrLUwdVkRChIPpZsxUSks3r6eEVTvA4Cg9js0n6k0ARtlS2qI\nRd3FwY0d03xeFlc/MZBhS2Rmq5IDsUnqI+DvlFrTcJ/iRmc9rjpzSDiaGYST\n6N8mi1GotQxZQnGOE74Mb1uDcJxmtAf7prekacaeATqD6nHX0/x4+qD40LB3\n2a0fDEjmaWxQEvQ+3paYnurBEJ5eFv00CyFa/NRdupKdkr/EEq0vGhV1FZ3H\nphZwGM1JJ1CkKtKKBX3qygTAsrlcyIc88UXTWsdJGO25QjHyUOfCz2xnVtVG\nTGr8/ppOGQdvrardeZw6pXkLrRswsXXH1tuxyn5XTGbTuHy/gBmVyz5TYdiY\nJcpf/6faMgm/ehxzKSJPLwIBa3ueNOjHZQ0axM/8Zyphjlt8jljdGRAfbl1k\ng5MDUc2p2kAsXhtrnJhBTIeNm8pZFsO4KuCzM6cJiJ3Teo2KQWw3rALrabzT\nytPHbkdYStUl8sHmoN6EVpaG3xoy822foXKedGRawO6J4CqCq3Xd75n9FfJF\nvzB4\r\n=zHR/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGiY6s8Gv0bN1bOiug/oEvNwpm5Ul/50FDykJukTwYNbAiBpAGaYge3Lab+PUHJlmvO7nZMLniJnKxAUPLIXhZK0pA=="}]},"maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.20.0-canary.8e3a0601.0_1604007417882_0.718226067776226"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.20.0-canary.178c25b4.0":{"name":"@material/mwc-textfield","version":"0.20.0-canary.178c25b4.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.6d9648ab2.0","@material/line-ripple":"=8.0.0-canary.6d9648ab2.0","@material/mwc-base":"0.20.0-canary.178c25b4.0","@material/mwc-floating-label":"0.20.0-canary.178c25b4.0","@material/mwc-line-ripple":"0.20.0-canary.178c25b4.0","@material/mwc-notched-outline":"0.20.0-canary.178c25b4.0","@material/textfield":"=8.0.0-canary.6d9648ab2.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.20.0-canary.178c25b4.0","@material/notched-outline":"=8.0.0-canary.6d9648ab2.0","@material/ripple":"=8.0.0-canary.6d9648ab2.0","@material/shape":"=8.0.0-canary.6d9648ab2.0","@material/theme":"=8.0.0-canary.6d9648ab2.0"},"publishConfig":{"access":"public"},"gitHead":"80850b707414fb51c8072422d293bc7fea8a6d8d","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/80850b707414fb51c8072422d293bc7fea8a6d8d/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/80850b707414fb51c8072422d293bc7fea8a6d8d/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/80850b707414fb51c8072422d293bc7fea8a6d8d/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/80850b707414fb51c8072422d293bc7fea8a6d8d/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/80850b707414fb51c8072422d293bc7fea8a6d8d/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/80850b707414fb51c8072422d293bc7fea8a6d8d/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/80850b707414fb51c8072422d293bc7fea8a6d8d/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/80850b707414fb51c8072422d293bc7fea8a6d8d/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.20.0-canary.178c25b4.0","_nodeVersion":"10.22.1","_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","dist":{"integrity":"sha512-tLCXVCViMrXWimu3McEV4x89rigg3o1fMB0cK5RGm/btSjSgKs9njL9So7Y7x7QtPiDhl/79cjwurAU6JVdTfA==","shasum":"1192e765f6a3a4da511254fd6e9955d170e57057","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.20.0-canary.178c25b4.0.tgz","fileCount":13,"unpackedSize":200239,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfmzkrCRA9TVsSAnZWagAA7m4P/3Ex5GfBE+Kpk/XuB6fG\n2C0gZtANITsvnmQTBUjRUCI5gCGSTcyX0sBuGIS02NKH5fVPm6ps3SAxn3Sl\nNQvIXwmt3b9xVUGupr+v8Cu7VhN0jGJPE9XiU3whnKjE6wheKK8rPndeqqTN\nAxq2CjV3i8PT2paj8SFuzIBvFRwqj39Nh9zSvV9AP9nXEQA6qVRyLcuPjQZr\nZ+GqSkeFQ2Vgb17shrs6dMB6M2v20sGYksMwUz6/xfpW5/PkHkrRlbQs+smk\nSShIpxMxFFqAlpK1v1I3ymKQI3BPNLs3Zf4tR+3sZjP5arYopvupSsmSow4K\nA46eMuMSjPSrTlP9bV32PX/Qcm1+tRNO7MZvTLDVpWuwgyyxRSRRhMiM/yP5\nM77YOhm1uJI5PF+7Op+nnsRY3lURXuGAJLbut0yypO24/O/fvDeZO0l+8ET+\nT7EgrWfaJrqxW2znc3+xI2byfSYtIkp8r9QE0UExzvo+0cCoVV7G6A7r16ru\nuhuSx3NuU86K5OU70yYvKmokL69Mo5RmWmF0MpEXrx4QWZz2CRbbMWeLgTdS\nvuKGuf3pJz+dhHzN/o3wSCmxAsPabC65Y3c/TD4kC68nD9z7M2+RALkGugM0\nMaXJqEnbE86D74K9AE+TTI06Lx6vdnIRlvdWteYnBdYoUF4RCT5LycH/IwIi\n+ebi\r\n=ai1f\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDJ7dGhB6fPjotYHymtUh960cU4YSMUWYWBi/HjRxPOngIhALvOx2J481f5ka0LA7J+9cmN+O4n8VA/AbMzWfSEuuxi"}]},"maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.20.0-canary.178c25b4.0_1604008234874_0.43042213339588087"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.20.0-canary.124beb49.0":{"name":"@material/mwc-textfield","version":"0.20.0-canary.124beb49.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=8.0.0-canary.6d9648ab2.0","@material/line-ripple":"=8.0.0-canary.6d9648ab2.0","@material/mwc-base":"0.20.0-canary.124beb49.0","@material/mwc-floating-label":"0.20.0-canary.124beb49.0","@material/mwc-line-ripple":"0.20.0-canary.124beb49.0","@material/mwc-notched-outline":"0.20.0-canary.124beb49.0","@material/textfield":"=8.0.0-canary.6d9648ab2.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.20.0-canary.124beb49.0","@material/notched-outline":"=8.0.0-canary.6d9648ab2.0","@material/ripple":"=8.0.0-canary.6d9648ab2.0","@material/shape":"=8.0.0-canary.6d9648ab2.0","@material/theme":"=8.0.0-canary.6d9648ab2.0"},"publishConfig":{"access":"public"},"gitHead":"8d314226afe84cba75086ef952556fa1fc0c5de7","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8d314226afe84cba75086ef952556fa1fc0c5de7/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8d314226afe84cba75086ef952556fa1fc0c5de7/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8d314226afe84cba75086ef952556fa1fc0c5de7/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8d314226afe84cba75086ef952556fa1fc0c5de7/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8d314226afe84cba75086ef952556fa1fc0c5de7/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8d314226afe84cba75086ef952556fa1fc0c5de7/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8d314226afe84cba75086ef952556fa1fc0c5de7/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8d314226afe84cba75086ef952556fa1fc0c5de7/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.20.0-canary.124beb49.0","_nodeVersion":"10.22.1","_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","dist":{"integrity":"sha512-KZGCZvvkwRFV3jSB6alD2TxEIpZ/LcKaNqyaOKcfF+D/Kg4F6Zb+lakNPymLAndPLqafAonRnHEnlhjkHxwpOA==","shasum":"b3b90fcbff7e4cde3568383f7a955cd72cc1f9ef","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.20.0-canary.124beb49.0.tgz","fileCount":13,"unpackedSize":200239,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfnKqLCRA9TVsSAnZWagAAbMgQAJDpg9q15WDlEb7CLm/c\nlbF7C8WgYnjRZJlVLFzeD1UMO58UuPLMhytVGP/3MwoqpCq6bFdOGOz/FiUz\ndp2xb8qrtf8w8ejO7bCN5DJRm2bKVq/Vr1wl+yMEkKHrnU/ggJP+yYM+N9OD\ngIF+hz427K61qcwuzlQ5b/8AhUJS82aWUU0dJxjXLp8mI09AN2O6sZ9TDApg\n5FuZeIssKs4VeZaftud3rJ73Uebw03XU+FozlVD4gqrmEC7a8sVqpNC9rOt2\nN0a1QWm4JV7cv3G7+tx+AGVDeBdLqHnCQa7idYGbkEgr0M8T56MKJe0xnhK5\nrj3M134UQkvHJ1fzyf202oadN6+PwPN2YKp8USOf+iorX1RPaFNHzjwsz3yR\noYMdfV/yVxqCTRME6wZmFQrETS++/BkdcsEdD3tUv76KQaK7xktDTUgMsYmq\n+/GKyXKTpruWf2JWwHn91HD0+qV+vX8BvoCgzBwSd1ETxB+PHWMKlLdu8X1y\nvqpAuB5UNZKc6agKDGTGTwSlU0MZM8dTP79bVOkENOndEIPiHIsIxagrsTda\nIU7J5YdNhjHMCwAK3EYqoFXo30EG7N0a1qpQcfDvehR5H/d/25YPUm357w73\nh8xwWPlHX2pQg7DbmkOj+65LnLOHYOnF//sBcjomm/qPVpvyTGv9zfvMfOyb\n1vtE\r\n=uOl/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHp286GdOjynjkXgOzT9QXm6LrXloNQme5fK9qO2nFhKAiAC/YehyWOIXcuSd0kNI4KE1UwovhmiGqBuuc4jBVQjpg=="}]},"maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.20.0-canary.124beb49.0_1604102794917_0.7555962563698511"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.20.0-canary.5937f468.0":{"name":"@material/mwc-textfield","version":"0.20.0-canary.5937f468.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=9.0.0-canary.d6b5cd418.0","@material/line-ripple":"=9.0.0-canary.d6b5cd418.0","@material/mwc-base":"0.20.0-canary.5937f468.0","@material/mwc-floating-label":"0.20.0-canary.5937f468.0","@material/mwc-line-ripple":"0.20.0-canary.5937f468.0","@material/mwc-notched-outline":"0.20.0-canary.5937f468.0","@material/textfield":"=9.0.0-canary.d6b5cd418.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.20.0-canary.5937f468.0","@material/notched-outline":"=9.0.0-canary.d6b5cd418.0","@material/ripple":"=9.0.0-canary.d6b5cd418.0","@material/shape":"=9.0.0-canary.d6b5cd418.0","@material/theme":"=9.0.0-canary.d6b5cd418.0"},"publishConfig":{"access":"public"},"gitHead":"d1d2934f5269407a8c0f85d5112be5354c17a971","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d1d2934f5269407a8c0f85d5112be5354c17a971/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d1d2934f5269407a8c0f85d5112be5354c17a971/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d1d2934f5269407a8c0f85d5112be5354c17a971/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d1d2934f5269407a8c0f85d5112be5354c17a971/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d1d2934f5269407a8c0f85d5112be5354c17a971/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d1d2934f5269407a8c0f85d5112be5354c17a971/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d1d2934f5269407a8c0f85d5112be5354c17a971/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d1d2934f5269407a8c0f85d5112be5354c17a971/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.20.0-canary.5937f468.0","_nodeVersion":"10.22.1","_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","dist":{"integrity":"sha512-0fwnbx3s2m2rtizXaaIiHXSVHBKZfgMsOPyZSjD0ySftas06ygLLCvjiPchbkIMiquWd6lxRzJdhr9On7vFdIw==","shasum":"4014542966558ff6000254eb5dea5f71c60a37f2","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.20.0-canary.5937f468.0.tgz","fileCount":13,"unpackedSize":200239,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfoxfSCRA9TVsSAnZWagAActUP/3YatyFHeJV/E2XQZvsT\nkTcvMn3NiWJpVG8n+T16fZJalKGj2R9DmLaeKkKi9LHNf/ghDA0pFoh0Q5du\no95IDguTSpS4GEt/4MvQdXv/+dc3pLDQ2kySIFU/vfJbVFAYvO1DKOGel/nG\nj9URNxJW5rOrsvkP9IxepsnV2bgVlUJysGrbaJQ64lAyM769Su6DUBq+Wk0T\nJmwADwqqOmsx23++h6FW6t/0zawpFYkGgn7zGN8kQ23PILNTjzVIwlStDOCu\nWzyLlZ6jZQaXGXfMcJ54R9JTbkTMMoRpQIzVJjyaPUQpXFTVtIKZ72VD6I7C\n6gPdLp3ihL01JUPoH5cxZJABC7d6imCOTPybC/bdrdg13q3MXTuwtF7nTjCJ\nQC4zaXXIoAktZwaBhL39G72s7q/chSZ4rB0x8VQf9ESDW3IMeEzeklYYW7gb\nag6AjSyuUygK/PXU2l+3iAkHG/9M151zKGSfKBtTZo1cxWrYlWzHzbQGQ88c\nN/pRdofJU7HwKdqstNxsXpQRSDaasgr/WpjKk7TP9Zb/BgZW4ka3nRQ02zfw\nXpFqmg434cOwNO8M0UyoBTqQQQfofMUfaJEQXgy0RxcEJjrzeWrYh0/7HC9Z\nJNFrA5+MoWNIgDEXCnLP+bmFk1GKfKv+PeO4XseM8BePHupN5lnd99XBNAfw\nAAQT\r\n=r/pw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFCSdqDq5icpzUUHW5+mr3vJwnWn2U0xqXp4FpcB6+PYAiBUSPVXcwxbrCD5B9Xx/IIsH2hkkzWGOiYNG+kHKfxROg=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.20.0-canary.5937f468.0_1604523986060_0.25118545952994986"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.20.0-canary.a9bafaee.0":{"name":"@material/mwc-textfield","version":"0.20.0-canary.a9bafaee.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=9.0.0-canary.d6b5cd418.0","@material/line-ripple":"=9.0.0-canary.d6b5cd418.0","@material/mwc-base":"0.20.0-canary.a9bafaee.0","@material/mwc-floating-label":"0.20.0-canary.a9bafaee.0","@material/mwc-line-ripple":"0.20.0-canary.a9bafaee.0","@material/mwc-notched-outline":"0.20.0-canary.a9bafaee.0","@material/textfield":"=9.0.0-canary.d6b5cd418.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.20.0-canary.a9bafaee.0","@material/notched-outline":"=9.0.0-canary.d6b5cd418.0","@material/ripple":"=9.0.0-canary.d6b5cd418.0","@material/shape":"=9.0.0-canary.d6b5cd418.0","@material/theme":"=9.0.0-canary.d6b5cd418.0"},"publishConfig":{"access":"public"},"gitHead":"672dd0ebc89e93768abf9e9fb4a31fecdd7873ce","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/672dd0ebc89e93768abf9e9fb4a31fecdd7873ce/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/672dd0ebc89e93768abf9e9fb4a31fecdd7873ce/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/672dd0ebc89e93768abf9e9fb4a31fecdd7873ce/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/672dd0ebc89e93768abf9e9fb4a31fecdd7873ce/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/672dd0ebc89e93768abf9e9fb4a31fecdd7873ce/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/672dd0ebc89e93768abf9e9fb4a31fecdd7873ce/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/672dd0ebc89e93768abf9e9fb4a31fecdd7873ce/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/672dd0ebc89e93768abf9e9fb4a31fecdd7873ce/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.20.0-canary.a9bafaee.0","_nodeVersion":"10.23.0","_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","dist":{"integrity":"sha512-gdtR65HJSG7S6j/uEjzBE8lvuatKYzZoB4L3ZIGMfs/git+Wuvk5UKPX4ETUzcMv7g+L3nfk82pbanMWz/xrHw==","shasum":"f7ebb9139f09777933e0841a45ca4184f9becb0b","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.20.0-canary.a9bafaee.0.tgz","fileCount":13,"unpackedSize":200500,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfpH0YCRA9TVsSAnZWagAALKQP/iFhGcZlM4BonpOgm9+h\n5NIHYYT+blH8u+jNMUM122ysApBY8diJZ7zgbvWdIlDx8SX6ZjXBMSh79qpS\n4iBXotezcPxfgAknYAdChHHVjdhTlv1Zvfc1FFd+O8hfOa01ZuwYjQi87wSC\nRSX74fxroNiqa0iv2xXcVoij1DevnFvZGNZ93afBkh9EjzsjzxCf1UvTX/Z2\n/cXYIs1NoHNaICpoQB6JuYpryXc4mBtckWFbaH+TgywT6+k3rj7cnr3L20Oj\niH1tZK7S8tHrAxyQh5fcFqsR/MXTUFdK5y/5h+Dq7i2vK1x9d5KpL5pdbY2v\nUzzkF3SOoY8tqCijpxvsg/utl+/ZDsELgnjs7ZUegSLYOZJonNSxHhV01cfM\n61xWSs0o7yhsZk+nN6k/7WDYqkxWilfwAbyaFyH9zUuuMEM6HWmzYdrJg+Aa\nvp5Mwh9xavjK1aIk7aor4d9hAd4wzb4rJn0GzoIyqwwGb9AiCMbgU1nqtauu\n4Oz9Kz4OUV9Wqsu+6Fe8IYGcqJgPrsA9oNBWjalQn1cAx72olwmT7oHW3xsS\ncR4FEUeDhOrqc6EkFk4E96SAz63HiqRU068kXESiqx4fgfukyBl5fif6xRfO\nEC/QchUde+GKNMmfQ7ijg2Rw7ZbQxn8wwLtlkrxCobu4z1CDL0Vbh8EJFfq0\nTpz8\r\n=G52e\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCfzlt9mQAiWknuasiDpJJTf3ERn3bYSvihcm2RkjuFAwIhAPZ4qg8sNQk2SeW3VY17TUgC7cY0/yxckrdNDpGUj0XD"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.20.0-canary.a9bafaee.0_1604615448381_0.7545224667385002"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.20.0-canary.184861ee.0":{"name":"@material/mwc-textfield","version":"0.20.0-canary.184861ee.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=9.0.0-canary.b39094d14.0","@material/line-ripple":"=9.0.0-canary.b39094d14.0","@material/mwc-base":"0.20.0-canary.184861ee.0","@material/mwc-floating-label":"0.20.0-canary.184861ee.0","@material/mwc-line-ripple":"0.20.0-canary.184861ee.0","@material/mwc-notched-outline":"0.20.0-canary.184861ee.0","@material/textfield":"=9.0.0-canary.b39094d14.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.20.0-canary.184861ee.0","@material/notched-outline":"=9.0.0-canary.b39094d14.0","@material/ripple":"=9.0.0-canary.b39094d14.0","@material/shape":"=9.0.0-canary.b39094d14.0","@material/theme":"=9.0.0-canary.b39094d14.0"},"publishConfig":{"access":"public"},"gitHead":"292f005e510c59c9b761c4120c56e8c9854e4595","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/292f005e510c59c9b761c4120c56e8c9854e4595/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/292f005e510c59c9b761c4120c56e8c9854e4595/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/292f005e510c59c9b761c4120c56e8c9854e4595/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/292f005e510c59c9b761c4120c56e8c9854e4595/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/292f005e510c59c9b761c4120c56e8c9854e4595/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/292f005e510c59c9b761c4120c56e8c9854e4595/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/292f005e510c59c9b761c4120c56e8c9854e4595/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/292f005e510c59c9b761c4120c56e8c9854e4595/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.20.0-canary.184861ee.0","_nodeVersion":"10.23.0","_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","dist":{"integrity":"sha512-JtGzIO6ghu0lH4wNRArGXpWZotrHHVQIR8Hbo+XqkiNfevRWZWnvWTFy3nXB8jV+ZcD3qxhS4oFOy56mkvF/tA==","shasum":"a2a4f9953a547d66cd8f870c7f13b81116ff4e8e","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.20.0-canary.184861ee.0.tgz","fileCount":13,"unpackedSize":201254,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfpexWCRA9TVsSAnZWagAATd0P/3x3NQQZYyycI9IYVjmp\nHpwD7Dp7zlACGxgHJlNzZ8RHVtCTTtSIg/OywxKH2LMtcplyNtug7szvV95o\nxu+Fl/TjR8A2MljYB/qOIraO7CoBhrXUixoKeXa0GjKHqXpKnLWuu1SOReou\nwJwNRFWGdub5FQLi5kCFfn9rTaSGT3Gjl8Lz82uS2oMTQIc0g5dYg2WG9gmN\n2g5SZzFWEDvqepTAF2g3el03Q5kNumPnBuwh+IJokPAHNrZS0SKz230KeaKq\ndPDwl//wY43ErYkpXPxgDdEZKJMxTFgSbgUdlVF4UyzeITaKisInM16zut1C\n4szaBCb8xkguxlmv6WUZUojmMk9oYNQyJz/dnWmkK+Is9e8a8EFUcJDDpxJc\n/+B/uJNbVrnLza4u51tsAgp8/OY/f+0Sw65xBItYGPoL7L6tbFh/5/l6ytXj\nxu7xHMK96NNMKTtFyjw4Z8eHvv/UfhlDc0/qHPZ8/NbUtRoUYex7N9Tr39ub\nAVnrSGGiZHannpiKe037ungnp2NXwO4KwgFjkOJFteJYzzvAfZMLobxKN2A6\n+gn0HP8r9BoN8mWGAj6u/N73FWBFATbcj66N8u/dvwIm6eSedETTFz9cIiP7\nFvDDKrhT8Gvt5fzwrOJ/G4Cjb48uaGZvGin+0I899vgQn6HMuX2zyOTOgwGc\nuaJV\r\n=Yu6c\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHgF+1oBDVeIf7CI7d+gtciSmt36KSwSL4s3m7ZG5FQmAiBmkn/c7IFCLNptdABd9zcpSds4OIOiCA4U5QWqFjPmlQ=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.20.0-canary.184861ee.0_1604709461560_0.30247863744503345"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.20.0-canary.6c6ae2d6.0":{"name":"@material/mwc-textfield","version":"0.20.0-canary.6c6ae2d6.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=9.0.0-canary.b39094d14.0","@material/line-ripple":"=9.0.0-canary.b39094d14.0","@material/mwc-base":"0.20.0-canary.6c6ae2d6.0","@material/mwc-floating-label":"0.20.0-canary.6c6ae2d6.0","@material/mwc-line-ripple":"0.20.0-canary.6c6ae2d6.0","@material/mwc-notched-outline":"0.20.0-canary.6c6ae2d6.0","@material/textfield":"=9.0.0-canary.b39094d14.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.20.0-canary.6c6ae2d6.0","@material/notched-outline":"=9.0.0-canary.b39094d14.0","@material/ripple":"=9.0.0-canary.b39094d14.0","@material/shape":"=9.0.0-canary.b39094d14.0","@material/theme":"=9.0.0-canary.b39094d14.0"},"publishConfig":{"access":"public"},"gitHead":"38ecce3da3f921a8c45ce342e47456c702623761","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/38ecce3da3f921a8c45ce342e47456c702623761/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/38ecce3da3f921a8c45ce342e47456c702623761/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/38ecce3da3f921a8c45ce342e47456c702623761/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/38ecce3da3f921a8c45ce342e47456c702623761/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/38ecce3da3f921a8c45ce342e47456c702623761/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/38ecce3da3f921a8c45ce342e47456c702623761/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/38ecce3da3f921a8c45ce342e47456c702623761/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/38ecce3da3f921a8c45ce342e47456c702623761/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.20.0-canary.6c6ae2d6.0","_nodeVersion":"10.23.0","_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","dist":{"integrity":"sha512-KmxpKmtRYgiPpgpfG00XcS6C8fb3TIWWDPvEpsiccSncZTCq8GQAPaND7W04CIbR5mu89isvl6NiOHEQipwoTg==","shasum":"ff7e740c442cd4be51365e3fc76019c97bf4711b","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.20.0-canary.6c6ae2d6.0.tgz","fileCount":13,"unpackedSize":201679,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfqT6wCRA9TVsSAnZWagAAuSAP/0rdE/0JFUxBFCBVgjMs\nyoiEDieXMS/5/OyqgpTrpQnlGA2A5NHOq7KinMRTqxwcv1IGP3oRknFpDWw8\npAt6eDZma2NNfCD2+TC+Ds1Yui/ph1NZTin3ybj2AjEnf8/XlReuYpTbmDm8\n1SujDqaFvXZl0Uyy2mezwnMintWpolCx42E4YUr3XWFJ7mZzrftJj6pSRMZj\ne9VUiq4KDu9z8Rl7f4L6NizbA2ndNv6/l0jHcOoiK2ROjENjNrmJdo3WKTcp\nB2P7LVGxQGgUF6EoqpGAeBfMOicGa2pZGAJ7p28Oa2ktoy4Ip2F1RilSXUwe\n47cFDTKtFzjvZZLaNpJZT7/ikV9u/Wou0b2jVqmkGm5AkJCbK8fFSjVzP+rH\nomCiYYtD+BBIHGRfLpmL30MPYGxY2Fl2eNxUnfc+7NLqGd1/xot7TUVumys/\nXju/S8axjdSoPora/IGbnQa3pJs7cHLv9HLmscK4d9Lq5NUJKXwEr9l8w3Pb\n2ONAC1HQlBqRYFRhO0e13AbDhcaQZ7xJ+Nps8Robl/UWIdbliWm6v0ztqsOQ\n0MC809Mf4Pin5xwuT2cq0hRvrsAlvvx1IzcuT+zNwXD6DEc/jORcvwyvUuvC\nYH4qqlBzPWz4MxmzeIQjcJFdkKmC2Zwox/R6OpLdcKfMGwWlPCKFQBjazcL9\n5VVm\r\n=z2LQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC/MLzDX4HlTkOy4mqWcwO1Y3AeLZ9mAaEneBgU0HSX+AIgaci6G3K2XIuVQXlCPI/e60M87aLGvJVPERR1WzFwWxs="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.20.0-canary.6c6ae2d6.0_1604927151957_0.2595382172935954"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.20.0-canary.ea2aa477.0":{"name":"@material/mwc-textfield","version":"0.20.0-canary.ea2aa477.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=9.0.0-canary.b39094d14.0","@material/line-ripple":"=9.0.0-canary.b39094d14.0","@material/mwc-base":"0.20.0-canary.ea2aa477.0","@material/mwc-floating-label":"0.20.0-canary.ea2aa477.0","@material/mwc-line-ripple":"0.20.0-canary.ea2aa477.0","@material/mwc-notched-outline":"0.20.0-canary.ea2aa477.0","@material/textfield":"=9.0.0-canary.b39094d14.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.20.0-canary.ea2aa477.0","@material/notched-outline":"=9.0.0-canary.b39094d14.0","@material/ripple":"=9.0.0-canary.b39094d14.0","@material/shape":"=9.0.0-canary.b39094d14.0","@material/theme":"=9.0.0-canary.b39094d14.0"},"publishConfig":{"access":"public"},"gitHead":"44e884f1fa66508713a0632b0fd8052b5a88aa77","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/44e884f1fa66508713a0632b0fd8052b5a88aa77/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/44e884f1fa66508713a0632b0fd8052b5a88aa77/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/44e884f1fa66508713a0632b0fd8052b5a88aa77/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/44e884f1fa66508713a0632b0fd8052b5a88aa77/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/44e884f1fa66508713a0632b0fd8052b5a88aa77/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/44e884f1fa66508713a0632b0fd8052b5a88aa77/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/44e884f1fa66508713a0632b0fd8052b5a88aa77/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/44e884f1fa66508713a0632b0fd8052b5a88aa77/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.20.0-canary.ea2aa477.0","_nodeVersion":"10.23.0","_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","dist":{"integrity":"sha512-NKJjcbARYjUJYoVzFJR0b8u4QEGVuJbRISnSJ8I7ZYZjPAdyv488XEaEFeopvaVS+4x0+xYyTf08zxJHEaxjow==","shasum":"b5d4f82e81da0ff4dba223ba6ce40f45266928be","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.20.0-canary.ea2aa477.0.tgz","fileCount":13,"unpackedSize":201679,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfqdeWCRA9TVsSAnZWagAARBkP/1DUhtd7j9ionW9hXDtN\nt5l+mYquY6lOdb7CiMnw+InoerGet2sEn3exW4RRJDqcFvUVdGFTnoRolcEN\n04jdAXdh6bnCEeK98FQgDDlYDkxsNuO4aFmzhYJvsfxZz8SbD07Fs7SMWSgR\nKBQRplMKh3TVGqqaYM9PU21UDbyuY+bMWtVoUY6LDnt74r88PTMlpX8xplE9\n4SoXjCDPz46848/dDbcMIRJXeoo4vD4A/fiUOqhZ+5wk1h+wwoePz7xkXtAD\nW0HnYMWKT2iZ9avGL1u9nW3vEbsf66JokTvwAuOJkvFTBglVOfz4kj4Gshfj\nTr4O1tKp+tf8vTXOte3R2UMS3S/cyON7lU3AEHBjlmFjmD2GkybEpbMWBtQU\nXOPGJIvxeJqtAkDsbYpQlaV1KmfwEqiavrGrBi41v8TRy81tfale1uPBWCcn\nHeJBfOyHH9uLtDYsP7aBwl9liBKzJrDHyKEHoSWH/RKz1vuF3uPromsRL4ld\npIgjlJZC2dcfL1YVqxwuxw59kQ9cdiSfjMSJLGbr95xhaAOTBg3WSg9hk9mF\nEzaeLn6CG6JtJlDuv4SNofkW4DYrD57i3m/WBcm5rpCBSr5hHXLy3UInN0sa\nG0G/Q7TQiFh/YL207Njg4DlbKQtr5Kvo2ur9jc6VdsaXUMelr1NvAzRRzt0X\nwYz/\r\n=hHtg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBg1m/cz6ttBjhyKAJp3CALD4+IwzUSq1v5/hR/DFKu5AiEA2SvUpRYm7OhA1NsuVnNVEptfElxPUlxKuL5xBKRYkFE="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.20.0-canary.ea2aa477.0_1604966293602_0.09860540662146366"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.20.0-canary.a2c088dc.0":{"name":"@material/mwc-textfield","version":"0.20.0-canary.a2c088dc.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=9.0.0-canary.b39094d14.0","@material/line-ripple":"=9.0.0-canary.b39094d14.0","@material/mwc-base":"0.20.0-canary.a2c088dc.0","@material/mwc-floating-label":"0.20.0-canary.a2c088dc.0","@material/mwc-line-ripple":"0.20.0-canary.a2c088dc.0","@material/mwc-notched-outline":"0.20.0-canary.a2c088dc.0","@material/textfield":"=9.0.0-canary.b39094d14.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.20.0-canary.a2c088dc.0","@material/notched-outline":"=9.0.0-canary.b39094d14.0","@material/ripple":"=9.0.0-canary.b39094d14.0","@material/shape":"=9.0.0-canary.b39094d14.0","@material/theme":"=9.0.0-canary.b39094d14.0"},"publishConfig":{"access":"public"},"gitHead":"60aecd658763ef0aa8ea8055ed91f03f6d3697fa","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/60aecd658763ef0aa8ea8055ed91f03f6d3697fa/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/60aecd658763ef0aa8ea8055ed91f03f6d3697fa/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/60aecd658763ef0aa8ea8055ed91f03f6d3697fa/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/60aecd658763ef0aa8ea8055ed91f03f6d3697fa/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/60aecd658763ef0aa8ea8055ed91f03f6d3697fa/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/60aecd658763ef0aa8ea8055ed91f03f6d3697fa/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/60aecd658763ef0aa8ea8055ed91f03f6d3697fa/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/60aecd658763ef0aa8ea8055ed91f03f6d3697fa/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.20.0-canary.a2c088dc.0","_nodeVersion":"10.23.0","_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","dist":{"integrity":"sha512-ivh/s9sBgUeOMg4F3PShGdEey4qywxFghMxnucl/8vR6MjsMTCWHxL1QwfEr8ESxRheBUnJAx7+u5NmrHLFAvg==","shasum":"04ded4a3d8bb0483db242c6cfaebffa42d11353f","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.20.0-canary.a2c088dc.0.tgz","fileCount":13,"unpackedSize":201044,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfqqKFCRA9TVsSAnZWagAA1/IQAJ9uy8PdxorXA9fDUW33\n/gtL2lqC4VM1YCl1InXmdpzK9JQG5IVes0ZC98VdfejYH5AQ+W3y5CrS7ZT1\nAcmFcURs2ub3dzMrIkPaLrqX4PQ8xfULysYPXXfqcweCMR7cUR0euuG0bsiW\nVBMQW0SayxQWZ831c+nhS/Fnnglf0GAI0kwWwSFCBb6AMGSzA/hu5zF7Gayb\nG8NxrnCMuVqxtrSfmR1ils+q0aTZDylzO0w951Syokbsd48G1LjzeX5u5Wi2\nVRFXgf1g5NTE+7Kd0Dc3piz1+Y8V58dYGObQ71s/lwLQ67x7WeaKtAh7GZ6w\nH3iEQ6xHX+3RFIH8ePmRtGwzZI1NZCoHa8jCikn42BjZkmqcd4wB1na//jrX\nqO8DJxJ9fSOx9gYbekatk0Pbwh1Dxi2D+eDxCsyJvWHQOMf94bW40YnakLWX\nYga3LLZ043e6kudY4NyshH5iShcu1FVLgnY659eOTD6aFcsLhQStYj8SpfxE\n/CyH+bIc3/g+jKB9QiniLByYRKUeAaAssGcKb0T4XroAiU2wyKKN/15oE6Hs\n8X95omlmYInJ9ZRfT3eFVAvSAduAGBRJUD00oMJ0kvgGKnTiQPBR6OnVNpvy\njX/+ZzByV1T3a7g65uLdsg1RftuWm58y+3Urf0E0aMMDlmtB5BcFemjCumRb\nTsKJ\r\n=XJlz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAWwXPSBG8ePwdIRbIyI34rmpP+T9FFDxHO12v7KxWYjAiEAiERJW2xlJUBsZb+KgMmSHrxm6F/JDBcjQgrOpMJo52s="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.20.0-canary.a2c088dc.0_1605018244988_0.8571353097099375"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.20.0-canary.b04d71d4.0":{"name":"@material/mwc-textfield","version":"0.20.0-canary.b04d71d4.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=9.0.0-canary.b39094d14.0","@material/line-ripple":"=9.0.0-canary.b39094d14.0","@material/mwc-base":"0.20.0-canary.b04d71d4.0","@material/mwc-floating-label":"0.20.0-canary.b04d71d4.0","@material/mwc-line-ripple":"0.20.0-canary.b04d71d4.0","@material/mwc-notched-outline":"0.20.0-canary.b04d71d4.0","@material/textfield":"=9.0.0-canary.b39094d14.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^1.10.0"},"devDependencies":{"@material/mwc-icon":"0.20.0-canary.b04d71d4.0","@material/notched-outline":"=9.0.0-canary.b39094d14.0","@material/ripple":"=9.0.0-canary.b39094d14.0","@material/shape":"=9.0.0-canary.b39094d14.0","@material/theme":"=9.0.0-canary.b39094d14.0"},"publishConfig":{"access":"public"},"gitHead":"6c9d3a1dee5f50ad7d82b0f0e59f7c21d9524452","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6c9d3a1dee5f50ad7d82b0f0e59f7c21d9524452/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6c9d3a1dee5f50ad7d82b0f0e59f7c21d9524452/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6c9d3a1dee5f50ad7d82b0f0e59f7c21d9524452/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6c9d3a1dee5f50ad7d82b0f0e59f7c21d9524452/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6c9d3a1dee5f50ad7d82b0f0e59f7c21d9524452/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6c9d3a1dee5f50ad7d82b0f0e59f7c21d9524452/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6c9d3a1dee5f50ad7d82b0f0e59f7c21d9524452/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6c9d3a1dee5f50ad7d82b0f0e59f7c21d9524452/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.20.0-canary.b04d71d4.0","_nodeVersion":"10.23.0","_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","dist":{"integrity":"sha512-7/YVYxXTvQNlTK5WAQjxxNvgsBD6fa7YmA4pLDAgM8uzkaMy0M7ahk6SdAwuDnU514FX1xYDCvRN4mvkK48VtA==","shasum":"c76d4464a90c3852bebaeeaf28a4c44bb60983c4","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.20.0-canary.b04d71d4.0.tgz","fileCount":13,"unpackedSize":201044,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfrRF5CRA9TVsSAnZWagAA+Y8P/AgSrTpZVbvnTEaDBf9O\nnx4joy1MvFB0jDXQWg3IBGWGIrO1C2i0sKlYr8GZ1tI7CUKKtBlNe3uO+qIw\nLntQo4fiJBGzcZIxJ0cNKlEXkMyeAm4cr4J1A0lXZeZNrU70oJOH4E4uqhgQ\nGilMAOaVDVlZUGXoDbcl//6lBOmtGDx6r0tUcUo68qSsKa+xPcUVh1QdllML\na5TkOgr3EOJDm+yXabrIFATvSyh4iWIwENgpkKJCxk5KqSFSTDdZ8S7QLipt\nk+wiSN5ump2nuGpXo0Qw64Fyn9u4nCz8Hmu6NwCSv5E7ohygf23CDD0INvJP\nJlpHxo1WkymsHNta7pxiQCKydBXbZYYDuUuKBn44CxpcWNjOsPO63nFNvxab\nk+hwmVYRIeu1H7RLDpZxqpZmLnom245avbgga0eGXetvowdcmprpAaJQxeJq\ndGTfnihod5fL5zCztrHjzi+4P/gVuDAL4dJXk19zZ2wSm9rfUBl6yMxRSRSF\nLbytloaU6QTkWY2DcHF1/b7HhVdCa/8W+EZqn4zqiA2TeBYdlTBfnPYtZOW7\nvlKqHU7FpafXTyUoDT46hUBDQHCLIRlBJC65v0x9pygWsj8keheNKG9QNPoa\nVZKred6Vb9UX96Ntx+jXhjW6aogcN3cIcrL8EwRjxVZ8TfpokCB6N0Ejn81T\nWluO\r\n=gDFm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDJOBujUiHoRDAlyzgeOTaqQgWsmznyMf07ZGYXrUbp2wIhALfL+CcKZDd7s20MO+GZWe5vHIbonzkgVcvPCdtXUoDj"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.20.0-canary.b04d71d4.0_1605177721297_0.3323973687777033"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.20.0-canary.2c553352.0":{"name":"@material/mwc-textfield","version":"0.20.0-canary.2c553352.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=9.0.0-canary.b39094d14.0","@material/line-ripple":"=9.0.0-canary.b39094d14.0","@material/mwc-base":"0.20.0-canary.2c553352.0","@material/mwc-floating-label":"0.20.0-canary.2c553352.0","@material/mwc-line-ripple":"0.20.0-canary.2c553352.0","@material/mwc-notched-outline":"0.20.0-canary.2c553352.0","@material/textfield":"=9.0.0-canary.b39094d14.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.20.0-canary.2c553352.0","@material/notched-outline":"=9.0.0-canary.b39094d14.0","@material/ripple":"=9.0.0-canary.b39094d14.0","@material/shape":"=9.0.0-canary.b39094d14.0","@material/theme":"=9.0.0-canary.b39094d14.0"},"publishConfig":{"access":"public"},"gitHead":"7a02baa2ba85467edeb67014cb8c6e5bba77edec","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7a02baa2ba85467edeb67014cb8c6e5bba77edec/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7a02baa2ba85467edeb67014cb8c6e5bba77edec/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7a02baa2ba85467edeb67014cb8c6e5bba77edec/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7a02baa2ba85467edeb67014cb8c6e5bba77edec/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7a02baa2ba85467edeb67014cb8c6e5bba77edec/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7a02baa2ba85467edeb67014cb8c6e5bba77edec/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7a02baa2ba85467edeb67014cb8c6e5bba77edec/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7a02baa2ba85467edeb67014cb8c6e5bba77edec/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.20.0-canary.2c553352.0","_nodeVersion":"10.23.0","_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","dist":{"integrity":"sha512-QyefzgoixBJ8ApSypJ0uEvhXs5iCgHCJbcx4Cae/RVwLeDQocboUD+pDa+2qh68NUjO7jRgnt97yQCozwXhq1Q==","shasum":"dec40ff18d9f02ee2e85e6bcca8ab7e60a37e6e6","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.20.0-canary.2c553352.0.tgz","fileCount":13,"unpackedSize":201044,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfrbpkCRA9TVsSAnZWagAA6HoP/17tXVfk9KwZHA8T6jpW\nB0kZb5iemPCc13W/ojDLTH+9WxQHtveerT5gizwf2PTEDdLhefTqjBTBR2BF\nxyDNTdnPKafcs2KcMzJiJ/M1UV0nVSusXdB9WM8nOKjS612Fa8ZpAz4AzR7N\niUNOPCTPbKxt6z4Fy8qWKBYEqCJFt70Wn9njCKJ/bICR4JgSWG24WrUv7Bcb\nLVk3OxYXsn52ZYts2f0yXUdZtSUgZ4hTPL9JGjZ5dFS4hZFDVFWQfe5EEXs/\ne/SI4ORIkcwMY9NdrwufEsOrM9HRe66JxJs6EmfLcHq+4G3zpi1ydNbkNf2o\noRpWuBU/XYmrv31g1p1gKj+GoSg0dm1O8Gqd7nHuXaW8Jo1s02QLC09JcqNG\nmlRiVysmmsCrJBdUNxy70gUU+b3cgK22Mu/iUT4v7XO2ZEIO4A7etCa7GdQR\n+0jMqVaNl5CqYTVJoB8qypblcv9c6FJw7iPgfr5azay+6U7g14nKpNN/gB9T\nBOUM0pLYFS17GoYmrqPThmySApIxMOqtu7aTWr4qCoSlKU0dVYCyGJVmyuJl\n6dLiWzKtQBDjA8OSDMoCsgOOFEdFXdqSyEmkiSMjm/QyQe8cOrYPtlj05X1J\nvYCIPtkfdq/WENrV8eDlerhXEBlVkyyDqa8qISzGFzzC9sAZjf4mGGbP6bR3\nzRFM\r\n=eFSZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEJE0SSkUHjZp15Pflxvcf8vzXZS6OeGmb/8Hg1CpMl9AiEAli1lfkHIlEWY+LxmOzpXiv4VaKPoUqDbtkHSj+a3AIc="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.20.0-canary.2c553352.0_1605220963952_0.1642726271400914"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.20.0-canary.6560d19a.0":{"name":"@material/mwc-textfield","version":"0.20.0-canary.6560d19a.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=9.0.0-canary.240c5f74f.0","@material/line-ripple":"=9.0.0-canary.240c5f74f.0","@material/mwc-base":"0.20.0-canary.6560d19a.0","@material/mwc-floating-label":"0.20.0-canary.6560d19a.0","@material/mwc-line-ripple":"0.20.0-canary.6560d19a.0","@material/mwc-notched-outline":"0.20.0-canary.6560d19a.0","@material/textfield":"=9.0.0-canary.240c5f74f.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.20.0-canary.6560d19a.0","@material/notched-outline":"=9.0.0-canary.240c5f74f.0","@material/ripple":"=9.0.0-canary.240c5f74f.0","@material/shape":"=9.0.0-canary.240c5f74f.0","@material/theme":"=9.0.0-canary.240c5f74f.0"},"publishConfig":{"access":"public"},"gitHead":"2b2093b7a8ece484614a94718cdac5a72d7e9cfa","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2b2093b7a8ece484614a94718cdac5a72d7e9cfa/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2b2093b7a8ece484614a94718cdac5a72d7e9cfa/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2b2093b7a8ece484614a94718cdac5a72d7e9cfa/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2b2093b7a8ece484614a94718cdac5a72d7e9cfa/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2b2093b7a8ece484614a94718cdac5a72d7e9cfa/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2b2093b7a8ece484614a94718cdac5a72d7e9cfa/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2b2093b7a8ece484614a94718cdac5a72d7e9cfa/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2b2093b7a8ece484614a94718cdac5a72d7e9cfa/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.20.0-canary.6560d19a.0","_nodeVersion":"10.23.0","_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","dist":{"integrity":"sha512-hB6S+zNQJ+v5e02Wc3Yx//45s+kHP+6UzF+8QMhH10OJ28D/LAYa/QE6xGSYExQ4Y8L4jlPRt72vXijP1o7j8w==","shasum":"94ad02157a11e2e7776d47f4550623299be76f78","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.20.0-canary.6560d19a.0.tgz","fileCount":13,"unpackedSize":201044,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfrvEbCRA9TVsSAnZWagAAefEP/22XbXmzoTMD/fwyJjYd\nCgwfIiaxMfW1399GRSNfSqgK89Ovvsv3eabUke2DzjXOeD8LaAxGsKzt2T9s\n0WnWT3dVKdA7VVuLElDPwL2cGr48fnsCzmPZuo3/i974G2jjP2vzoQKK9ROy\nj9KYRAk8ZWPgK0uc/mIJn4Hkkxf31H4TQ9o45QvzWGAZ0S8dA7v5req8VjJM\n/4MLMXyKL1e/uFu81WXCvDOpx4+7OokAu3iz4jfUscPfYZvpKmoVciQ+vc5E\nKVajY+UzAHuysVA+aeA1L6s3jb5eQ9tiu3Q6+Xr5iJ9MtWXZYN7eKbObDTeL\nS0Gwv5SeThVYmcYsM80wvVFK8knAyp+CZWqpD8UbZbQoJZ+B4KGF0Mj9n0Zu\nYi2tankWBTyqaNWCqPH1FJmSNQVw7gzg/NjqFV1GUIY2ApNJa3svrCHqCtml\ndAtSSvmOwuLAkOhAL/wTZjMfoqNaxRLt8RIaopV9sfRwCqpAAMHDqe2wwIHt\nxIWPZzSVLeBgufch9wBckll2YROiMqdLlGwog6RqskWyt23hUPm1szjvULqh\n3H5CtdvkdoVFVAc9IvJ3foAobaZX74M7q8Wdc3hhoYdhmLtOHbv7+uBBQi64\nlR59CDW3tZn9pR4hdsXpw1Rw93y3ACTT4pyIimkQAEHpPkdC6x+wiOwFa6zB\n7mdu\r\n=lt1c\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIENWmefcaz5ST7PcCKq2lZyFxKaKVT9s5QVgwDJ/0Sw3AiAaZLdRTfDj/9OXLMzEJakeK8cOD1BfBLMcIInp9r+Xkg=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.20.0-canary.6560d19a.0_1605300506661_0.5578020522733627"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.20.0-canary.a28d5ec3.0":{"name":"@material/mwc-textfield","version":"0.20.0-canary.a28d5ec3.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=9.0.0-canary.240c5f74f.0","@material/line-ripple":"=9.0.0-canary.240c5f74f.0","@material/mwc-base":"0.20.0-canary.a28d5ec3.0","@material/mwc-floating-label":"0.20.0-canary.a28d5ec3.0","@material/mwc-line-ripple":"0.20.0-canary.a28d5ec3.0","@material/mwc-notched-outline":"0.20.0-canary.a28d5ec3.0","@material/textfield":"=9.0.0-canary.240c5f74f.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.20.0-canary.a28d5ec3.0","@material/notched-outline":"=9.0.0-canary.240c5f74f.0","@material/ripple":"=9.0.0-canary.240c5f74f.0","@material/shape":"=9.0.0-canary.240c5f74f.0","@material/theme":"=9.0.0-canary.240c5f74f.0"},"publishConfig":{"access":"public"},"gitHead":"f24283a75330ef6de8cd16f8373ab1bba0eabec6","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f24283a75330ef6de8cd16f8373ab1bba0eabec6/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f24283a75330ef6de8cd16f8373ab1bba0eabec6/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f24283a75330ef6de8cd16f8373ab1bba0eabec6/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f24283a75330ef6de8cd16f8373ab1bba0eabec6/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f24283a75330ef6de8cd16f8373ab1bba0eabec6/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f24283a75330ef6de8cd16f8373ab1bba0eabec6/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f24283a75330ef6de8cd16f8373ab1bba0eabec6/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f24283a75330ef6de8cd16f8373ab1bba0eabec6/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.20.0-canary.a28d5ec3.0","_nodeVersion":"10.23.0","_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","dist":{"integrity":"sha512-J2GrhT+tVeWmTlKbz/syYMSkBGoKvV0BqV7OVYQH8dHaWpCd1Cq4ZvW9QyGKNcobAMbDztSe56g49WSKWrJ9AQ==","shasum":"d62d4e3edf2e9381b4195a7bf0af38e503e687a3","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.20.0-canary.a28d5ec3.0.tgz","fileCount":13,"unpackedSize":201044,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfs+sKCRA9TVsSAnZWagAAw9wP/3UjCY1T14o1QztUuzFk\noPs2aMpif6TEYgqzNJOJYwfk4Y/avn6sIwPDw/bep2IrJo6VAD/jYljrmqFR\nyh0VqSw6uJ+5K7xJZmO3Hfj8R2YuwVvqKbxUSxz82Ozo4IISrZoP+9Lr5uPk\nvhfalsJtG6IFUXd2aZxWC5bIKVnIFqBxdInzFEKr+LMBEuywuItPZXcJqmdW\nnrBXiHV4cMTEkEfl/lOW8bf42pqzxA3S9CawqMFOq2zmPu5QnQYnmOOEg1tN\nYJTtv4jSrm5xg/uVaBJJMbeLtP0YHqc+N2BkFFKBYwIyt0EsHOlbE02eukIS\nA9HTs94XcWJcX8zg1iBxT7xcZbI7hV5pGHCs9ieTjfgdUqlK3Ty/C8QdUFvB\ncXkwEouel86EZfJJ4kmjWmAZ/EmNcqwGb6sS2x4O4iiVJmMGfE+zyDpqAEEU\niNmP88sAp2KhHaZgwL7PUlZ/6RlY3hEE3RrpQ4y+clbuprz+C9itPY4+JmMh\nHfpQ4oykWQstYrZHj2aGylTQMZ8LQIKdFBAJnyPXCQ6/Ym4uEpZybi83mMxm\nY4cBod6pwY7MnlETBdIQpQDK+5AXYO279Zlt7UJKx0JfaFKmu1r1QOSRlfkk\nbXKCaDEn/N0oD20Rj+0Cpk+raLCEo6Rh0J7Dx9v6vvScV5ktbNtON4xwd4EC\nfA/R\r\n=Qm0J\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCfBIdZc+b9BkElMSGI6VAMvcTfAWiAQOmrDcEFHLXSEwIgKoodyhAXD+Whw7+A5bfTK6OWFxn/wLDJlV3lkKhPVIY="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.20.0-canary.a28d5ec3.0_1605626633809_0.7984438769363937"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.20.0-canary.03e7e778.0":{"name":"@material/mwc-textfield","version":"0.20.0-canary.03e7e778.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=9.0.0-canary.240c5f74f.0","@material/line-ripple":"=9.0.0-canary.240c5f74f.0","@material/mwc-base":"0.20.0-canary.03e7e778.0","@material/mwc-floating-label":"0.20.0-canary.03e7e778.0","@material/mwc-line-ripple":"0.20.0-canary.03e7e778.0","@material/mwc-notched-outline":"0.20.0-canary.03e7e778.0","@material/textfield":"=9.0.0-canary.240c5f74f.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.20.0-canary.03e7e778.0","@material/notched-outline":"=9.0.0-canary.240c5f74f.0","@material/ripple":"=9.0.0-canary.240c5f74f.0","@material/shape":"=9.0.0-canary.240c5f74f.0","@material/theme":"=9.0.0-canary.240c5f74f.0"},"publishConfig":{"access":"public"},"gitHead":"b828c4befe76e485a57dc3be64c348c56f37f89a","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b828c4befe76e485a57dc3be64c348c56f37f89a/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b828c4befe76e485a57dc3be64c348c56f37f89a/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b828c4befe76e485a57dc3be64c348c56f37f89a/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b828c4befe76e485a57dc3be64c348c56f37f89a/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b828c4befe76e485a57dc3be64c348c56f37f89a/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b828c4befe76e485a57dc3be64c348c56f37f89a/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b828c4befe76e485a57dc3be64c348c56f37f89a/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b828c4befe76e485a57dc3be64c348c56f37f89a/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.20.0-canary.03e7e778.0","_nodeVersion":"10.23.0","_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","dist":{"integrity":"sha512-XQhCzSbI1POwmwUonXj2iZyNZuXS2lP/0H5SHMl3G/ptY9N6lyNsFzD0E5it2JtGBRlQT4J3Z3xVDrkLo7tPMw==","shasum":"00aac8bd2c8df00ad63a33e2062c9b6c7b7c0325","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.20.0-canary.03e7e778.0.tgz","fileCount":13,"unpackedSize":201044,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJftCPACRA9TVsSAnZWagAAnJIP/iAXrkJ2SOGK+M1XmBJm\n/odc65IKVsKy7Tb+puURkEHe+YzkJRkQgMyMKQwpRpP7ZVXA/a2J/fvGQVQy\nJfAnssTb5mY6qBjXHNEFO8h+P9xwtlgZhZf9Q78aIZDxw0AFudVnpceIU+Jw\nZGsQirp1Es3deaA1XhzlkLGA0S9rQMGaIbWXNRp8xeDoSQeEvG0rHm0uBG5j\nk/IFdYD2xTuSobcWgK98dMj911SvofQKqVMx4HFYE6O6EepnQoMGBxq5EGVp\nA4WEJblSykbcBoGttGctgo5oPzHXNGOsgablVMpLO/85vqC8FCSaYmC/E/Ve\nhcoPVIkayiy6BVDscYjX0SuvvxZysweXpr2M/clrWwAuzCDoC+WseoIxowGt\nfXbunIKLN4f5MErwQlE/gkSZGHSJBOwBUJXHI0nY5wyvD+JmLc2bY/wS3uJM\nv3H22GSMPzdNVvgUkgjwN+lPeQLmeQx9yAKyZ2Cw5hQ3k1UpjGT013U1o2Ik\nAyE6qGs15B4ZjLpFQAsmEf4T75InAJMXcePdR/i2Zr17iOt/XRe2S/h0NinZ\nYRTFU0eaUUxF9xtvoSBvoX3IeegS9x9h+zMELXlRDVs9AumTdiUzn3D92B/4\nFs/qmcnMI2wdiEVf+eCN4sjAIUSnMJJu+KqVkEdlK8kOas9J7upA0KwtKFgA\nHrao\r\n=Rzy2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCItrZP23/o6fnHsjjSfn8Qbq9ifHSwUlOOvEDgFRCfJAIhAMjRkBbkBlq+CMwTefFqPn4FeNCjRsp14xnFza1V3cBk"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.20.0-canary.03e7e778.0_1605641151951_0.9976459143088598"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.20.0-canary.ac8ed597.0":{"name":"@material/mwc-textfield","version":"0.20.0-canary.ac8ed597.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=9.0.0-canary.482ff9091.0","@material/line-ripple":"=9.0.0-canary.482ff9091.0","@material/mwc-base":"0.20.0-canary.ac8ed597.0","@material/mwc-floating-label":"0.20.0-canary.ac8ed597.0","@material/mwc-line-ripple":"0.20.0-canary.ac8ed597.0","@material/mwc-notched-outline":"0.20.0-canary.ac8ed597.0","@material/textfield":"=9.0.0-canary.482ff9091.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.20.0-canary.ac8ed597.0","@material/notched-outline":"=9.0.0-canary.482ff9091.0","@material/ripple":"=9.0.0-canary.482ff9091.0","@material/shape":"=9.0.0-canary.482ff9091.0","@material/theme":"=9.0.0-canary.482ff9091.0"},"publishConfig":{"access":"public"},"gitHead":"324571445f4ed0575cda7f727c54e156bce8d624","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/324571445f4ed0575cda7f727c54e156bce8d624/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/324571445f4ed0575cda7f727c54e156bce8d624/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/324571445f4ed0575cda7f727c54e156bce8d624/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/324571445f4ed0575cda7f727c54e156bce8d624/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/324571445f4ed0575cda7f727c54e156bce8d624/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/324571445f4ed0575cda7f727c54e156bce8d624/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/324571445f4ed0575cda7f727c54e156bce8d624/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/324571445f4ed0575cda7f727c54e156bce8d624/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.20.0-canary.ac8ed597.0","_nodeVersion":"10.23.0","_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","dist":{"integrity":"sha512-CCn62xuSvDvO2I9aJCXhvqc+5SPBOeuJTYX9BGWN6jZA4Vc814CTVPdiHHH+3rUR9AYs//HXV+WjyqhgOGkJ6w==","shasum":"2720009e59c6c3674db52d7227502116099c9a88","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.20.0-canary.ac8ed597.0.tgz","fileCount":13,"unpackedSize":201044,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJftEqiCRA9TVsSAnZWagAAufQP/2iLgq/kehxjJTBEG952\nbyXhq7X594WJ3yobJDfyaiT5ht6iCRAAFopc9jTWOzMBma2129RNHn+eCaiB\n33gB3y9M5c0o//1bmJhv4JsCIfGdsKJY1Gz5QJotPbuDD74bAru81jyGeT0J\nDE0RJ0J8/C1WFkeG4unUlZjIlqGTAaN3io4nHOec909Eag9hCjfP9+Zauwxs\nc0qKyjfj64XX5Wxxh7ZI68qEAYWSVpTNt0FZzRgh270airc6qbXvUMA8xRqt\ntOt5BCR1Q8o2fT3APTj+r9KoYZ6J7nQy3KVy3FjRNdSzo1aVdzPVS8qZvBKu\n7GHySHbvHmY7AE9OvuD8Lmk1Fwz5Pc3zJxkUBWw+9PmsAnJ2OzJ7XSRnSGZn\nc3tqvd4ZvGppMza/KJrWXGqxukSA23MAeKnuEplpd2M0clS2f9cN661e3/oP\nd361odUYX72lqUnMt3fZ1malQdqHjAAr+/EJ06mLKpUWc9JiOfzeS9iCmKYv\niiVOACXQq7bCdUBJaQbi9Ab/ESk3ScfTj2w731Ur3Jvf8a0SLT/8jNBvvdnz\nUyZReOzCzkBDJ5TUZsHKAsbHjVJOCshPwa+rCnqjwSf0DeBNcsSby/wzZCZq\nD2fRMpXr0HyoCPjBjTP3VOlc1yEEydKm1itZKQ3Ge0yHS6VO8cXnK508YwZn\nVaKz\r\n=z4yN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAbL6C2mnpyJMoRtfr9WYaYNuePA3iUHS5lgg7J7thddAiAUpvBlo2bKwKeXZmXKMthec7LO3aELhbvMOSZDN/SByA=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.20.0-canary.ac8ed597.0_1605651106532_0.07113267404329826"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.20.0-canary.b6a60f60.0":{"name":"@material/mwc-textfield","version":"0.20.0-canary.b6a60f60.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=9.0.0-canary.482ff9091.0","@material/line-ripple":"=9.0.0-canary.482ff9091.0","@material/mwc-base":"0.20.0-canary.b6a60f60.0","@material/mwc-floating-label":"0.20.0-canary.b6a60f60.0","@material/mwc-line-ripple":"0.20.0-canary.b6a60f60.0","@material/mwc-notched-outline":"0.20.0-canary.b6a60f60.0","@material/textfield":"=9.0.0-canary.482ff9091.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.20.0-canary.b6a60f60.0","@material/notched-outline":"=9.0.0-canary.482ff9091.0","@material/ripple":"=9.0.0-canary.482ff9091.0","@material/shape":"=9.0.0-canary.482ff9091.0","@material/theme":"=9.0.0-canary.482ff9091.0"},"publishConfig":{"access":"public"},"gitHead":"423d1aee62c72c8c88e9e5e792712bc5d4d10b13","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/423d1aee62c72c8c88e9e5e792712bc5d4d10b13/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/423d1aee62c72c8c88e9e5e792712bc5d4d10b13/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/423d1aee62c72c8c88e9e5e792712bc5d4d10b13/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/423d1aee62c72c8c88e9e5e792712bc5d4d10b13/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/423d1aee62c72c8c88e9e5e792712bc5d4d10b13/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/423d1aee62c72c8c88e9e5e792712bc5d4d10b13/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/423d1aee62c72c8c88e9e5e792712bc5d4d10b13/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/423d1aee62c72c8c88e9e5e792712bc5d4d10b13/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.20.0-canary.b6a60f60.0","_nodeVersion":"10.23.0","_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","dist":{"integrity":"sha512-UeHS+WRknGggAbnSBdsEkyxPPCY3FU49EQsDFblF4SQ+pcHUv0zQ7AaSs/WmOSKw5JIeOzvhjMlvbDp2Meqnnw==","shasum":"ba98a25f79e4028b4e6eae0bc53b0830dc27c8e4","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.20.0-canary.b6a60f60.0.tgz","fileCount":13,"unpackedSize":201495,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJftFQYCRA9TVsSAnZWagAACiwP/jlZhBoEpTXTnYlJpNnA\nMhCuDM8KOBqGfKdX9YCNa0s9dEzlBZo/oGEH8svZbIa6baCy647JCHTElhwd\nf6upm0dQIQ5pUpLtRoGBTGSRz/tESt0mIsbBWy8y9wvtOu6DHKdfEryHE8xZ\np3qFVk9AKlX07TGzNhqLbebGfNbW7M37R8e5lK51OHGk8GCu+PgtKc6p2oJI\niuNeEk8YtplH3J/raByvi+UfUjjKltGhZFuZEj3Xkw0nKdnGkyA2El2eZYdl\npelQ7la3v1GIe7jewvIBgxwvjs2O7CU6ccK01FzUwt9dZSwQKEG37KQBUzVM\nPLB8ogULEJfV7q8G/BOyeScJjTwup0wyjfrGdh71KEYQlYuG520X5OKGrDKd\nnxfeMOoUIJwH5gdptnHJ2UFhc155Mbxz3fVj3xNA8fsrUsnliJrvmMRoxwB9\nOiUnI5AxulziyDAhNphgISw+DBsdR8UB08YRbpgcweQEw/5j9b5N6Qh4TCel\nIRi6CFxHbfebJFxlcQO5SpbGiOVk/TVR4k84Qp3LHptuJOVL5lNd+1yrXRqd\nBBwxRRMv1+rHHerGg8egdt75XPFpQMlvxiHSjszqakgrimXAP/3UU/eCaGqb\ntGfnWn6gEJOJG+ADuJKoeE7ui4vpeAdIlbSj/hAgjdTFubpGoGeTtNObaN4s\ndFmT\r\n=iKjh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDC4hKj1vGwpB6cEO+kSGn17XyFa6d2+yLvvxLCNVD2DAiEArIxMfHOGXIWFT8lMg6tDGhW/vFJk7bCmUeaFXdBiRAY="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.20.0-canary.b6a60f60.0_1605653528438_0.29417080459348677"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.20.0-canary.71cc24fb.0":{"name":"@material/mwc-textfield","version":"0.20.0-canary.71cc24fb.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=9.0.0-canary.482ff9091.0","@material/line-ripple":"=9.0.0-canary.482ff9091.0","@material/mwc-base":"0.20.0-canary.71cc24fb.0","@material/mwc-floating-label":"0.20.0-canary.71cc24fb.0","@material/mwc-line-ripple":"0.20.0-canary.71cc24fb.0","@material/mwc-notched-outline":"0.20.0-canary.71cc24fb.0","@material/textfield":"=9.0.0-canary.482ff9091.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.20.0-canary.71cc24fb.0","@material/notched-outline":"=9.0.0-canary.482ff9091.0","@material/ripple":"=9.0.0-canary.482ff9091.0","@material/shape":"=9.0.0-canary.482ff9091.0","@material/theme":"=9.0.0-canary.482ff9091.0"},"publishConfig":{"access":"public"},"gitHead":"04fde8dbd7934f14927b0407ac285d7396fe68e7","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/04fde8dbd7934f14927b0407ac285d7396fe68e7/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/04fde8dbd7934f14927b0407ac285d7396fe68e7/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/04fde8dbd7934f14927b0407ac285d7396fe68e7/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/04fde8dbd7934f14927b0407ac285d7396fe68e7/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/04fde8dbd7934f14927b0407ac285d7396fe68e7/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/04fde8dbd7934f14927b0407ac285d7396fe68e7/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/04fde8dbd7934f14927b0407ac285d7396fe68e7/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/04fde8dbd7934f14927b0407ac285d7396fe68e7/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.20.0-canary.71cc24fb.0","_nodeVersion":"10.23.0","_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","dist":{"integrity":"sha512-54OjQW/CJFCNfopEfDBvKOr8NScZD57ZxDcL5u/pK8/DiThfwdWFhAIWUqcx6c26A/rdzZCVE88Ug1pCeUMw0Q==","shasum":"9495c6beab15aecc7c7d085b3b297972b594003b","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.20.0-canary.71cc24fb.0.tgz","fileCount":13,"unpackedSize":201495,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJftFnZCRA9TVsSAnZWagAAPegP/1LF7Z5K1Y/2oU7RSV+p\ndCgOdTG3YkQ6ImmsW9+Ych4HxbdnGVYMGaA5x59w8GmmURAyTikrTkKX8kMN\nBDjgSA+xeW/f9geDa0BmWqAgS2q7oS5rY1/oEmX0aK1IaNUGh5vxlX/+ybZh\nzwuNnxV29i66IsqonYu2r+u1Rep4GsIb2j4hJRMd0C5laSCTNahk2NVjpX3a\nC6OlRWUPkEHMfIbc5x7myaGSyCtFludW0KXNXYaujqsdoPO6KZDXxdoTVqhB\n7ytFq/NbkMrCdpI9fc1AuS7+k36/x1fvb2nb+Kp98DCl2IeunHeZW0VE54Gv\nOmnUyJwXcmv4BFJXNEOzG1Ed250roCMYGdFFjL9mjlw0xtUlcMAC31w9qyZE\nUu2Ln4a/FwMzmCGslPYx3ZG8THqWY1BHqyX048qU+8Z6sNYhreYOrEIrAXxK\nyKbyhc/MGcT3hiM+cTaDBXtsV6A2bxLXxTTsqlJP6noIrsxyKoDuLR3ZrXaJ\nRTZK/Au2Ze4uuqttqUCR1U2OwDzaIoenkyojYpEBhOx6TUpfiAPUJp4D/DNi\nC8t07Ga4Tl4+jcHqnDbiHUUKYaQZl78jbh1BASxFkM7Rd8RGHPggoIPNqt7f\n1BpBCn54v3YGwdzPyEe3BwuNjvjNvZInDRq96ma/SkeXXmhr5mZXOUJRjgIe\nKERc\r\n=rWAy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCxuZFMcq33p6mqnwFKkaOuYksPPj4mbZlDJtAwUrL1JQIgb3jyPXoZ8doQS/GYmQSLgFoi1EqHjSh9Si6eMShHoSY="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.20.0-canary.71cc24fb.0_1605655000936_0.338269682014136"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.20.0-canary.761027ff.0":{"name":"@material/mwc-textfield","version":"0.20.0-canary.761027ff.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=9.0.0-canary.482ff9091.0","@material/line-ripple":"=9.0.0-canary.482ff9091.0","@material/mwc-base":"0.20.0-canary.761027ff.0","@material/mwc-floating-label":"0.20.0-canary.761027ff.0","@material/mwc-line-ripple":"0.20.0-canary.761027ff.0","@material/mwc-notched-outline":"0.20.0-canary.761027ff.0","@material/textfield":"=9.0.0-canary.482ff9091.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.20.0-canary.761027ff.0","@material/notched-outline":"=9.0.0-canary.482ff9091.0","@material/ripple":"=9.0.0-canary.482ff9091.0","@material/shape":"=9.0.0-canary.482ff9091.0","@material/theme":"=9.0.0-canary.482ff9091.0"},"publishConfig":{"access":"public"},"gitHead":"eef81b2f51aebd88194386f191f7a40e504b6a70","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/eef81b2f51aebd88194386f191f7a40e504b6a70/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/eef81b2f51aebd88194386f191f7a40e504b6a70/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/eef81b2f51aebd88194386f191f7a40e504b6a70/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/eef81b2f51aebd88194386f191f7a40e504b6a70/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/eef81b2f51aebd88194386f191f7a40e504b6a70/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/eef81b2f51aebd88194386f191f7a40e504b6a70/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/eef81b2f51aebd88194386f191f7a40e504b6a70/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/eef81b2f51aebd88194386f191f7a40e504b6a70/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.20.0-canary.761027ff.0","_nodeVersion":"10.23.0","_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","dist":{"integrity":"sha512-is50I4U27l53KR/E7qhcFyjDo+TwTTCqpSe+tKtM0vi6cFW2txKUiSyo/djay9z/MRx9F7e5bjgWzZ3lp8b1Kw==","shasum":"fbfdc9782bad864cae3e8c743738856cfcac07db","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.20.0-canary.761027ff.0.tgz","fileCount":13,"unpackedSize":201495,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJftZysCRA9TVsSAnZWagAA4xUP/jz1soPKMbBFK/LxiWaT\nTR7KT2amD12k75XMJPZ8wQRxmn7SK1mrGAsVQPPdmsvsJJbeTGb7XITEAZ2C\nrq6ZoP720SQmsO21tFT/wwue/hrGmE+8HP6xLmUm4McDstrze2jiCLBtPngs\nuR5rbbxnY+aXuoS7/Inr/sTg8z/VwQgqt514zR3xt4ftdeS+sdvnlvQpiGC+\nbD/GW+uZah/jLKy1syRyIIHZIEo2Xp986bP4BiO98r74tPp84aMMPg7PpA1E\nFiYGyTd5LUw/I1dBcOzvlOQ9+hHGU5+VRTU7NpdaU5Zs9L2wwYI5nNsQJuUT\nUVzsXXysc1Q+3NseRcPvu436C7BbT+aBKOIkFx4rz98OZqsR5MegtH0z57RO\ne9MWZRwMpnnKUxUj+2MpeUkG8AKFNgh9McHn9o+CyS2mhbpe+cIEpGvxfu3i\nPs4ES5vH0kNTO+T24pzfpUL1Kf5sbnpzDachILRi3I+AE1/N6LI78sy1ALkD\nbW59UHHw0cOuYJ3vG1Gtglyibj0p2/d++45X8a5e6xeg2pC9estd95hopEpD\ndQKKxAFyjj1Qv4SDDojKcLUCbuI3Sm7OIJKx/GTpBiKCWx/+geWnqfeLrUGQ\nsvNlMpdP0dT0akg78tvHud3JFDEXXbmUSMOzkmvO9gghPhSWyPFudoU3vFAm\nQ2QL\r\n=HrfD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDC/163zcXiXDWY8j3IxfRY7oKJLuKDzUyn3STUB32RkwIgBOS3pWU2Ha2j8wKiBfjRMDzuT9/bYr7GuzYnP0Y6lOU="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.20.0-canary.761027ff.0_1605737643368_0.2625021625233366"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.20.0-canary.dc93d04c.0":{"name":"@material/mwc-textfield","version":"0.20.0-canary.dc93d04c.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=9.0.0-canary.99cfb6bd5.0","@material/line-ripple":"=9.0.0-canary.99cfb6bd5.0","@material/mwc-base":"0.20.0-canary.dc93d04c.0","@material/mwc-floating-label":"0.20.0-canary.dc93d04c.0","@material/mwc-line-ripple":"0.20.0-canary.dc93d04c.0","@material/mwc-notched-outline":"0.20.0-canary.dc93d04c.0","@material/textfield":"=9.0.0-canary.99cfb6bd5.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.20.0-canary.dc93d04c.0","@material/notched-outline":"=9.0.0-canary.99cfb6bd5.0","@material/ripple":"=9.0.0-canary.99cfb6bd5.0","@material/shape":"=9.0.0-canary.99cfb6bd5.0","@material/theme":"=9.0.0-canary.99cfb6bd5.0"},"publishConfig":{"access":"public"},"gitHead":"c3e20c69c9dd47eb0b31f0ff51e8150d8d27ee3e","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c3e20c69c9dd47eb0b31f0ff51e8150d8d27ee3e/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c3e20c69c9dd47eb0b31f0ff51e8150d8d27ee3e/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c3e20c69c9dd47eb0b31f0ff51e8150d8d27ee3e/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c3e20c69c9dd47eb0b31f0ff51e8150d8d27ee3e/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c3e20c69c9dd47eb0b31f0ff51e8150d8d27ee3e/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c3e20c69c9dd47eb0b31f0ff51e8150d8d27ee3e/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c3e20c69c9dd47eb0b31f0ff51e8150d8d27ee3e/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c3e20c69c9dd47eb0b31f0ff51e8150d8d27ee3e/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.20.0-canary.dc93d04c.0","_nodeVersion":"10.23.0","_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","dist":{"integrity":"sha512-+4YV68k2trYfKaeDhv+MX9YQOHDrMcuWHpyate6gT6UenpJ6c/lon8F0cCSgIJcXzIivB6cX7lzFyKQC3rh1nQ==","shasum":"18dae94f97b841adcb1cd4adb7de056dc97b03c8","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.20.0-canary.dc93d04c.0.tgz","fileCount":13,"unpackedSize":201501,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJftZ4HCRA9TVsSAnZWagAAaIkQAJUrUT1dQqWT/JEVmqrH\ncKhOlJxOQ297KxfD7YuUuS2yCV74Go4vz3pgSCwiKF344eldQYO7MkwEnAgd\n7Rr47wtYbq3FlScv1hystmzxxVreL61XGxCVQi9rrovZSQagCtrH2GyCYoRi\nPrTF51+XRznvDYmXlctR9WDuMwqQvs3F/ufskvSbmb6DlTf9GoTryc2FDV9z\nrPLqQJcktmXfv8GruAnL6xXEwe6U1NnT3DzUpW1KqW8AJXfvnd8vpY6H7oET\nXrI///cVAECmVaeDRnbUrYyEnxhsJG/mCyJgxJRibRKyztT0KcAdmkU4pZoR\nUfRs5P35teHLGjoJfMZ2wQ42nv4XR+6Pef9D0Pd+aeAWGokQOazyAsfsvEhd\nwvv7wzW9RZ0kQjjbG6337S1sckJGUbZO/i1UqnYB7r/IQxU8tSr6sQVEhUhc\n7QZlZmGAaJqiC+hNpfId5xYhsYUNoXaltJ0ZHN4kxEJSrPCRNyhtjZULTkN5\ncY66H58UWfjLBXSRCMxO7z8ElnVbVD1IIHVFHTyN3EzWLjntbAKV5fn2YtVL\npNFCJsnsrV8T6+v6CKN/+DfvoPtz1+qKJEKn9HAbtXeWLlSSOcNBaVjHX29p\nakuxWR+dYyigw3Sma+9MSSPgJoZ0KZcDmQ0scKO7+w85S/Hjb+yaG88/D1jc\n7aSf\r\n=c3gk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG0Cw7P3mtIijYKCzmdH2a91NWKYp99Spe/og8RS2YLJAiBozvOxNewnEbz/DfQv07qNn7Mb/ofdrkDFCEChRpnn9Q=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.20.0-canary.dc93d04c.0_1605737991247_0.9214812587703487"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.20.0-canary.4a5d4eeb.0":{"name":"@material/mwc-textfield","version":"0.20.0-canary.4a5d4eeb.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=9.0.0-canary.99cfb6bd5.0","@material/line-ripple":"=9.0.0-canary.99cfb6bd5.0","@material/mwc-base":"0.20.0-canary.4a5d4eeb.0","@material/mwc-floating-label":"0.20.0-canary.4a5d4eeb.0","@material/mwc-line-ripple":"0.20.0-canary.4a5d4eeb.0","@material/mwc-notched-outline":"0.20.0-canary.4a5d4eeb.0","@material/textfield":"=9.0.0-canary.99cfb6bd5.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.20.0-canary.4a5d4eeb.0","@material/notched-outline":"=9.0.0-canary.99cfb6bd5.0","@material/ripple":"=9.0.0-canary.99cfb6bd5.0","@material/shape":"=9.0.0-canary.99cfb6bd5.0","@material/theme":"=9.0.0-canary.99cfb6bd5.0"},"publishConfig":{"access":"public"},"gitHead":"6b9b0de3adf5b550661d63baa970642b71da5fa5","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6b9b0de3adf5b550661d63baa970642b71da5fa5/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6b9b0de3adf5b550661d63baa970642b71da5fa5/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6b9b0de3adf5b550661d63baa970642b71da5fa5/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6b9b0de3adf5b550661d63baa970642b71da5fa5/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6b9b0de3adf5b550661d63baa970642b71da5fa5/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6b9b0de3adf5b550661d63baa970642b71da5fa5/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6b9b0de3adf5b550661d63baa970642b71da5fa5/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6b9b0de3adf5b550661d63baa970642b71da5fa5/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.20.0-canary.4a5d4eeb.0","_nodeVersion":"10.23.0","_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","dist":{"integrity":"sha512-FAVw8k/7+IXbGSoHo1ORTBokS1Li4No7rYEbfHBtkdf+sz+8vpEdec2k/X3qBIubaTbMfA2AF63u5OA3QfFRMw==","shasum":"c42aa6c612438a8d9152c751b864d99665bfb38d","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.20.0-canary.4a5d4eeb.0.tgz","fileCount":13,"unpackedSize":203204,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJftldcCRA9TVsSAnZWagAAT6EP/i7mpi2IKcaGY/asNFxc\nBQsNND1JV4lv/3HATGVMABZTkEKxfZPVLHdAxrZqKf9+L9Xa3touTZ4twe9b\nq6HEbETKmcj7oIkY3XVXW1VMf5RAZWmNfWD7s0B3GHvL5kNJJtLkJx4tYrRe\n7c+n6zYzVu/v4NRVoFyM06JxVdb07mSjp4xI2Cb82nQdXCMN7VyxCfXCamtz\nQJ3mSgbEsnqOhRCey2s1tLHsGEPQVEr6nuICCaUoN3/SM24g6WKSMYvQ0DGI\n7CcNz0KdGW90B1sqB0C0xBcsTFOjZ5PNkl5PR6Q+Ts+GbcOiPVHQyzcxv58M\n1JjvKxLuhzz1eI4mf6AyJcdV2WCFWE4RUNlXPcRpN1UEzeCRZ265EojiQ4Rk\n06EpV9UVR0gDkjgXTjOtOcfjPoib3cTDAW1UN90sThuTP0BDiMiJ/TvPUg/Q\njiORtb/9oWajQjg03ymXUwW5Zu06lXFlLjbkgTSJR65RVz3z2ktMirBQopcf\nANpQ06w5ydp0alNS9WqnrW+PRsfZV6PKuOTiseGiogcRGng1Zvt3tt0GVrS/\nRpPc7D7890MguRdL0LtZoAAs0UEBHlbBGQzfOKt0emADMwDzU/R2PyxvKN3X\nxPU+Y1xzPgT6U/8206EhPWmrl9UdhCsayQGDBJXiQZ8LcvcAw8oC2lPsdM1O\nMNxL\r\n=k5Dv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDng+QqbPW69eh298kiTWeVFla3aHOZAJsD8+abJWa1PwIgbSojgo5ddZ6tlhUYLhk55OCISEmOFCEJ0LjfAahrGZY="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.20.0-canary.4a5d4eeb.0_1605785435663_0.9966484492425407"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.20.0-canary.bd176a15.0":{"name":"@material/mwc-textfield","version":"0.20.0-canary.bd176a15.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=9.0.0-canary.30c11bfc2.0","@material/line-ripple":"=9.0.0-canary.30c11bfc2.0","@material/mwc-base":"0.20.0-canary.bd176a15.0","@material/mwc-floating-label":"0.20.0-canary.bd176a15.0","@material/mwc-line-ripple":"0.20.0-canary.bd176a15.0","@material/mwc-notched-outline":"0.20.0-canary.bd176a15.0","@material/textfield":"=9.0.0-canary.30c11bfc2.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.20.0-canary.bd176a15.0","@material/notched-outline":"=9.0.0-canary.30c11bfc2.0","@material/ripple":"=9.0.0-canary.30c11bfc2.0","@material/shape":"=9.0.0-canary.30c11bfc2.0","@material/theme":"=9.0.0-canary.30c11bfc2.0"},"publishConfig":{"access":"public"},"gitHead":"8c9d27b834d60d0f197616dd1acd74cbf2cada07","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8c9d27b834d60d0f197616dd1acd74cbf2cada07/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8c9d27b834d60d0f197616dd1acd74cbf2cada07/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8c9d27b834d60d0f197616dd1acd74cbf2cada07/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8c9d27b834d60d0f197616dd1acd74cbf2cada07/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8c9d27b834d60d0f197616dd1acd74cbf2cada07/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8c9d27b834d60d0f197616dd1acd74cbf2cada07/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8c9d27b834d60d0f197616dd1acd74cbf2cada07/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8c9d27b834d60d0f197616dd1acd74cbf2cada07/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.20.0-canary.bd176a15.0","_nodeVersion":"10.23.0","_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","dist":{"integrity":"sha512-JuSguXP8u93uzlsSakqS5mL/PKVz6aby06cbJQbCjCpDU8m7t0+Xqm/SDk1IiD7RZgtLCUz1SaYVpzx8YC46dQ==","shasum":"d84cd51a1e73d0ce4cf80df77319b6827484a60b","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.20.0-canary.bd176a15.0.tgz","fileCount":13,"unpackedSize":203204,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJftsMWCRA9TVsSAnZWagAALtAQAIoYkGn6ZYE06n3p/sw6\n7nZNJNOnoZWClS8QIX8sb78V31HWnJL+qMqQm4+DBD/29Kgh9oMjSxGfEgIh\ngojNtoL14+zw5KIE/FjPftjweph5P2avIrH+SL4x0uUaDR7ILu0E8D+3FFmo\nyfj3H56XDxtIoD3fc3HBpD7vuqsNv6dn6qDnmf8L2Von6qPY9H+cOeOArkNG\nqH0bvP+TAmGhJpWhd8sfn2Ec+yNhHtB+7QakL39LfQm4EpOLrEX5ElEYzeUV\niKJ6DzcalgNb7J7i+L8dlGzT89PBPd38qT1a0Rdw5a37mYfOMy5rb1bHUf+P\norCugZEEQMkUkbbCihNomm2VGwzUjTJSDyFDuBnR7DC64+EzNCcY0V15HIaz\n1kBWyjBCXTVQuzGnVoNhnP0A6EJDOVCpVcqbsqK+kxjiJpKl3+eQAzvs9dc5\nti41LPa8LWWOFFwdrJ8WRPkH6AHvg1YU8qnD/uRMiK/pUuwCqRo/eht+JfFu\nlGDJbJGyHl54oppabelXFkFx8lvkUwCFwKLTzkJrlQUj4YTvYBynOifzx1vs\nyz5ZkJSztVvfhNSovFm0NpdtQ1G4EeXQfeSy27zMa1jRfe9ksv8zbrrUY08W\nHi4U7gl+qEiOXQG1v75ShMQiC6BP8Ww2Juswo4gy45X5XxLJf7NZ38VTe5eM\nEoHT\r\n=A+y6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQConbpmreQctJs21u5pNVOGZr78t318lEhcW1hYRSumXwIgD+vKrGu2vlIca7CbfdfQeEkgums45xaDpFYR76p+4OU="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.20.0-canary.bd176a15.0_1605813014101_0.10666459946120721"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.20.0-canary.e85aa60d.0":{"name":"@material/mwc-textfield","version":"0.20.0-canary.e85aa60d.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=9.0.0-canary.c927a5d05.0","@material/line-ripple":"=9.0.0-canary.c927a5d05.0","@material/mwc-base":"0.20.0-canary.e85aa60d.0","@material/mwc-floating-label":"0.20.0-canary.e85aa60d.0","@material/mwc-line-ripple":"0.20.0-canary.e85aa60d.0","@material/mwc-notched-outline":"0.20.0-canary.e85aa60d.0","@material/textfield":"=9.0.0-canary.c927a5d05.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.20.0-canary.e85aa60d.0","@material/notched-outline":"=9.0.0-canary.c927a5d05.0","@material/ripple":"=9.0.0-canary.c927a5d05.0","@material/shape":"=9.0.0-canary.c927a5d05.0","@material/theme":"=9.0.0-canary.c927a5d05.0"},"publishConfig":{"access":"public"},"gitHead":"3a749ec8278eb0b5833500696f08308837328144","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3a749ec8278eb0b5833500696f08308837328144/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3a749ec8278eb0b5833500696f08308837328144/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3a749ec8278eb0b5833500696f08308837328144/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3a749ec8278eb0b5833500696f08308837328144/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3a749ec8278eb0b5833500696f08308837328144/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3a749ec8278eb0b5833500696f08308837328144/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3a749ec8278eb0b5833500696f08308837328144/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3a749ec8278eb0b5833500696f08308837328144/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.20.0-canary.e85aa60d.0","_nodeVersion":"10.23.0","_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","dist":{"integrity":"sha512-EqWF8W6HqZDpLdbwHzBLXkHkcqfUpUIpZccSMdLett+yZVaBAMt9MNDXsIkQHYgxreVDBL2tdDefYmpm99FBIA==","shasum":"0d1b843944f3285d1edfc8628a4959010827933f","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.20.0-canary.e85aa60d.0.tgz","fileCount":13,"unpackedSize":203204,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfvDamCRA9TVsSAnZWagAAeIYP/1DoMwXAm2bakiIAvnH0\nP3uzkXxewcHIAd5T03oJ0PR7i5kOKq4R/v9YFm3gOQvns6aTY3Z8wSTXLKRt\n3aEoDT1cvOmzi4CpyYSNIY4Xwr5wg/w9QywdS5xt9jE7V3EFwKsLXvICvb6J\nmVbtg3L+oeV9cZITtWOsUZrgSGjhGE+qEi2pvvlCvT5mBy0qvSzZ9Az3Jhsr\nvZCQV53Fw7Q5Uk05OPH8134A3wHtIofCu9vDlkMS0jQumZl4rx49COoir0Pv\nzpWSDasdiZuaMNTi4Vz4dX0m4YXCAlttGSbSVNix6IqQuKrsTSlu67Q1fkq+\nLTxqvmsBYMJF6azE5O8qk1ime11ADCqScxEsxKDdNo/5G1/Rl3N3LSuX7gd+\nEtjKhWDClJjUfn5cnldcJoXNw48a4akmBcV7FTCRvOqIqeAwoosWKhWZ/oAa\nryq3dGiccWvh45jyy97GPiejBe77pok/pIAKH0zd9AS7Eh7eyRzNOmpvQfXd\nUMKTLK7o2TFebYYDfOH3PZ0PGG+hc5uNe5+eR6gVav3jXoWBtdVOBWs9lpG2\npBEUHTDgdqWX3EUOWMG2zc441dEMY9C+Uu53C/4NmlAVH5gfPl3d5+YFvu5H\nDgYw8oQFIfXSvxeFSDqj9tqEiJYLyYv5ThlO8BdQ2dQIo2UrY9meAYTxVDL1\ncJwr\r\n=08AA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFAHJuk7Vis2zo56T5yZAZh605UQ0etdHljBQ5ltqmoYAiB9xAl8pkkZYfO6QUTsVl6ADNiAhboK+10SwSfAAcTA6w=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.20.0-canary.e85aa60d.0_1606170277662_0.22507261314629368"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.20.0-canary.72092360.0":{"name":"@material/mwc-textfield","version":"0.20.0-canary.72092360.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=9.0.0-canary.c927a5d05.0","@material/line-ripple":"=9.0.0-canary.c927a5d05.0","@material/mwc-base":"0.20.0-canary.72092360.0","@material/mwc-floating-label":"0.20.0-canary.72092360.0","@material/mwc-line-ripple":"0.20.0-canary.72092360.0","@material/mwc-notched-outline":"0.20.0-canary.72092360.0","@material/textfield":"=9.0.0-canary.c927a5d05.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.20.0-canary.72092360.0","@material/notched-outline":"=9.0.0-canary.c927a5d05.0","@material/ripple":"=9.0.0-canary.c927a5d05.0","@material/shape":"=9.0.0-canary.c927a5d05.0","@material/theme":"=9.0.0-canary.c927a5d05.0"},"publishConfig":{"access":"public"},"gitHead":"ad7741df1b6ab1f1eaee400d6026dc5ab7821d66","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ad7741df1b6ab1f1eaee400d6026dc5ab7821d66/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ad7741df1b6ab1f1eaee400d6026dc5ab7821d66/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ad7741df1b6ab1f1eaee400d6026dc5ab7821d66/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ad7741df1b6ab1f1eaee400d6026dc5ab7821d66/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ad7741df1b6ab1f1eaee400d6026dc5ab7821d66/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ad7741df1b6ab1f1eaee400d6026dc5ab7821d66/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ad7741df1b6ab1f1eaee400d6026dc5ab7821d66/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ad7741df1b6ab1f1eaee400d6026dc5ab7821d66/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.20.0-canary.72092360.0","_nodeVersion":"10.23.0","_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","dist":{"integrity":"sha512-iKAYpVhkTRLM8RfhROIwHc2LEANvLH88yUnekCS0g3uRe5WjX2cqf6QKjub3S6radRz+iyiI5JS3ZT1c1PpKjw==","shasum":"ff4aa687fdc65414634df1c187ba991e71bfdead","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.20.0-canary.72092360.0.tgz","fileCount":13,"unpackedSize":203204,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfvImBCRA9TVsSAnZWagAAdsEQAJ/Jx39e5Fd1K8ARYj3A\nhxjMcFPwf1NiAR7qK0eCdCfsTx9IvypkZFCDaiAt7ygQk6jQpaJR8/eGKWhK\nbgGl9PyDx5JtnAmcZzIqlu+VncEKjkNuixIabWXV/e0Zdxu290vSV5i4xVyj\nSujIErPHW8eszJkWgxjl0gwwk8R5KlvMhVce9miN3pKqd72xXgPCWxq1L3cj\nXAeBdYZL82oStUWfYLPdDDu3Qq5owHvkz6UC04ZUDRKJ+0XpX7kcebHmB3hM\n5+tQABgss/l0NaXWV+QERD2mR8kCLwqe5YA1WvS3giqL9OvhuhjJyBaU+ikJ\nUp4V0V7GSXUlZMbDfVExeR9z6k2oK1FDq/HkXbVYuUAkY67Kxsqs94hoz56y\ngOXEI5Y6E+CxgEVyKtScHMiZM4pdKrGinHQv3++6ptX8vhjMvofkc+LqT6YB\np/xjrgT0C3g56xcbNpIHQdygr4b0J40jfqvixu2MS1wFJPpCDBE6gQhqpE+0\nwEIic5/Pi61ESafsthbl/F2fmdTophtkBQ0Znmyw5JIstewf9x4gomiJuqav\nD+eNQ6jHyTyMeUx+xyTNTa1l52i3nV/5yqzVnUoDqCsAZzHKNrgawfZIi2Bw\nuNJQtLi6YCJFr1d5uOvI8OY3Kb+OAn/PleCOzZzhUZuj2arPzqmbzjKW542q\n0oiv\r\n=pdZk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGvzHyFaTQg6Jke7M2qNDyh7CQfG2T/VCcJO0yJ2BfhgAiEA6BZ37JiaTcWju+gSiHfl1H0lKEYBwJZO8BtukkkZq48="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.20.0-canary.72092360.0_1606191488772_0.2575717325879574"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.20.0-canary.baf9d39f.0":{"name":"@material/mwc-textfield","version":"0.20.0-canary.baf9d39f.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=9.0.0-canary.ae27b44b0.0","@material/line-ripple":"=9.0.0-canary.ae27b44b0.0","@material/mwc-base":"0.20.0-canary.baf9d39f.0","@material/mwc-floating-label":"0.20.0-canary.baf9d39f.0","@material/mwc-line-ripple":"0.20.0-canary.baf9d39f.0","@material/mwc-notched-outline":"0.20.0-canary.baf9d39f.0","@material/textfield":"=9.0.0-canary.ae27b44b0.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.20.0-canary.baf9d39f.0","@material/notched-outline":"=9.0.0-canary.ae27b44b0.0","@material/ripple":"=9.0.0-canary.ae27b44b0.0","@material/shape":"=9.0.0-canary.ae27b44b0.0","@material/theme":"=9.0.0-canary.ae27b44b0.0"},"publishConfig":{"access":"public"},"gitHead":"aaf8660af2b57dfe4523a224abf621deb5b5d3c0","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/aaf8660af2b57dfe4523a224abf621deb5b5d3c0/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/aaf8660af2b57dfe4523a224abf621deb5b5d3c0/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/aaf8660af2b57dfe4523a224abf621deb5b5d3c0/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/aaf8660af2b57dfe4523a224abf621deb5b5d3c0/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/aaf8660af2b57dfe4523a224abf621deb5b5d3c0/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/aaf8660af2b57dfe4523a224abf621deb5b5d3c0/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/aaf8660af2b57dfe4523a224abf621deb5b5d3c0/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/aaf8660af2b57dfe4523a224abf621deb5b5d3c0/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.20.0-canary.baf9d39f.0","_nodeVersion":"10.23.0","_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","dist":{"integrity":"sha512-kMJsakVlMgL5WrVpjGajBdvvlta8APhoRk0bFQE1ZY0StrvmER0DE2sX+TK1cWAUpdAWnVAhNcY6ukHxvih4uw==","shasum":"6c0dd2953d854888d7ea240d3d11b2cbd3818855","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.20.0-canary.baf9d39f.0.tgz","fileCount":13,"unpackedSize":203204,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfvtE2CRA9TVsSAnZWagAAugQQAJ53EBe2add3y5qnGgkp\nlRqL4/whh85ckDDuAyhLKxhU5MJ75H/RQ+yHCCzWoaE4OOhXDJspJIIhW6ZR\njYJ2Woto6d1rHhc9DgoZJHl/6Jgm6uAF+hRY64OFD2gyEXHomcfuQ9573TRx\nXNXTZip0gq+7RXZ0+e5LT469CZhiNjPoe+PnUUeZaVWSMtHJ3/0rF+1peU84\noLA0mOmXn+rg+o/EkCziPPkgDcF1CkoLQscqPkQuNLn9QQEe2cC6rfyWkT2Q\nynI62j5iKeDxKPHi+VkU9KCtLOYy7kVWz8s1yGAt7pHc8ECmbx0Rv3NkEBbB\nywcZg9alHnZhtRDgU/b6gGdY+Khob/10YuLRDGN1879fuyeYQsnz3L48mCqw\nN2fVamOoTGBIb8x9dWyut9G3wZYE90H5Tnb8aeFUU8CIPJgeL5eZpHO2V2En\naKhECttzmPafKR66CIJs4yaFe6lujYXsT+3k7ogbSzE2P/lKjlbb6JqbkBZs\nvQ1cE212GJLeOnfy9m8blg/iQ2CLiLOsekzKMqV/TkhmUJdouC7X8wOAcXtA\nWTdaxWCT01FZSwz7WIrydhL18aixJC2afN9i+QN4xu6KKGmdFnWF/3reM/4p\n3nMS1KgT20wqgA1U0EbpiGIhyKxoJKHLJS2rkSPDDBO2EGri+TSUf8xhRI8/\nS16H\r\n=H5sn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCWeZAqJbhbejQTNx4np7pdZRFTI2MGoqTG11O1ddRLJgIgAyChQZmccFjhBpcBguOX/+++YyGRypYIdmAFOZYr7+8="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.20.0-canary.baf9d39f.0_1606340918113_0.23975960897458237"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.20.0-canary.51aab0ad.0":{"name":"@material/mwc-textfield","version":"0.20.0-canary.51aab0ad.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=9.0.0-canary.ae27b44b0.0","@material/line-ripple":"=9.0.0-canary.ae27b44b0.0","@material/mwc-base":"0.20.0-canary.51aab0ad.0","@material/mwc-floating-label":"0.20.0-canary.51aab0ad.0","@material/mwc-line-ripple":"0.20.0-canary.51aab0ad.0","@material/mwc-notched-outline":"0.20.0-canary.51aab0ad.0","@material/textfield":"=9.0.0-canary.ae27b44b0.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.20.0-canary.51aab0ad.0","@material/notched-outline":"=9.0.0-canary.ae27b44b0.0","@material/ripple":"=9.0.0-canary.ae27b44b0.0","@material/shape":"=9.0.0-canary.ae27b44b0.0","@material/theme":"=9.0.0-canary.ae27b44b0.0"},"publishConfig":{"access":"public"},"gitHead":"ec218298fa6cb371e229348142cfd266d65cbfa9","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ec218298fa6cb371e229348142cfd266d65cbfa9/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ec218298fa6cb371e229348142cfd266d65cbfa9/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ec218298fa6cb371e229348142cfd266d65cbfa9/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ec218298fa6cb371e229348142cfd266d65cbfa9/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ec218298fa6cb371e229348142cfd266d65cbfa9/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ec218298fa6cb371e229348142cfd266d65cbfa9/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ec218298fa6cb371e229348142cfd266d65cbfa9/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ec218298fa6cb371e229348142cfd266d65cbfa9/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.20.0-canary.51aab0ad.0","_nodeVersion":"10.23.0","_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","dist":{"integrity":"sha512-oVSR7s3FCTruKIh79CnbBs7J/dWWfFFgVGRcpsZzAOxBYOy1YUp4/LWCkzUgddS2ygLUICtGG6KUWv2ULPLg2Q==","shasum":"7b211115843613c2dff3fd16d58ea13d451b839c","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.20.0-canary.51aab0ad.0.tgz","fileCount":13,"unpackedSize":203204,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfxZbJCRA9TVsSAnZWagAARl8P/jy95iLa8VfEkSFeNJ4T\nHPZa/vr6Nck0YAfOmfItUvBqTvEE/Dn6TNLP3C82KNkG85r5NRjbM4mlehG9\nS87aQTQqMm+jGs7o4ScsyIkW2CkofSh6JjRfIX4zBzMyHDylXBOvyE7lOZcl\nCUe1uka4QnKXKVDAdLvts2G4zT4tVBAIOY3Z2UCYMtSMr2rwwSzvmwxzCMIH\nJuXt56RHiyX1oDEDjBo9imHRSzBF94qh7qpasEER9XveYjK3BMgplZwsr8ZX\nRz9/Kq8L/+NalTd2U7kasZuZXtzAU9GGxQdgvBmMSlX68eN0lJEmaqDvlpVs\nJWOmswch0ehaIRw/fE8ftvZubg+P4/yAw+cbuqzb8chWwyeXd7JcPoGCL+66\nkIPHGB6ehR5dz/cYSmV2TAkE8B3gMxkzu7X+QM4cYb+QUkQXslcVX7gf0CXX\nEvDHpYu6E3ohrAMTMlCU04Pcq1eteKfNVhEKcRfxHDGwJc8PifddHjValGqs\nh4rGaKpZViePl62ORzv5uQxpnl9EiCTGAmFqYH/kKCMM72smdvMjMQlfe8UN\nG8qd+cVk/2hNRwdRlp5XhzBDbjSXh9fSkOwbnq4HFuS4ztJDmtCDsO5xcNhe\nKf0xbZa8OK4srgNkNxWurIo/+/yqELuznZYU0FJ9jXg0z2hw3OMqi7dNejwy\nLqwJ\r\n=ywN+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCBCih+243eGHlAE4n3bxuxU4C43OF9yYnx2ZEg2dYbxAIgfXIuA2CjwBRwsOiv1lB3dq/N/N2GisLvdt4uDbStnk8="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.20.0-canary.51aab0ad.0_1606784712757_0.6688314973816478"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.20.0-canary.8fd4af5b.0":{"name":"@material/mwc-textfield","version":"0.20.0-canary.8fd4af5b.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=9.0.0-canary.ae27b44b0.0","@material/line-ripple":"=9.0.0-canary.ae27b44b0.0","@material/mwc-base":"0.20.0-canary.8fd4af5b.0","@material/mwc-floating-label":"0.20.0-canary.8fd4af5b.0","@material/mwc-line-ripple":"0.20.0-canary.8fd4af5b.0","@material/mwc-notched-outline":"0.20.0-canary.8fd4af5b.0","@material/textfield":"=9.0.0-canary.ae27b44b0.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.20.0-canary.8fd4af5b.0","@material/notched-outline":"=9.0.0-canary.ae27b44b0.0","@material/ripple":"=9.0.0-canary.ae27b44b0.0","@material/shape":"=9.0.0-canary.ae27b44b0.0","@material/theme":"=9.0.0-canary.ae27b44b0.0"},"publishConfig":{"access":"public"},"gitHead":"5b16bb5535dfd0f880b710b51d20b7085d91658c","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5b16bb5535dfd0f880b710b51d20b7085d91658c/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5b16bb5535dfd0f880b710b51d20b7085d91658c/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5b16bb5535dfd0f880b710b51d20b7085d91658c/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5b16bb5535dfd0f880b710b51d20b7085d91658c/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5b16bb5535dfd0f880b710b51d20b7085d91658c/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5b16bb5535dfd0f880b710b51d20b7085d91658c/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5b16bb5535dfd0f880b710b51d20b7085d91658c/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5b16bb5535dfd0f880b710b51d20b7085d91658c/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.20.0-canary.8fd4af5b.0","_nodeVersion":"10.23.0","_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","dist":{"integrity":"sha512-v3Hrverutz0wyLLL4CnF8x7DMLNc4bdx0oS2MJC81ntr006sZ1rlnnDTN8J2wbU9kkbAbe8e8S7V1IMo/BSLrA==","shasum":"7e4f49e676fbf938aee5b0665bce0212aebb5e16","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.20.0-canary.8fd4af5b.0.tgz","fileCount":13,"unpackedSize":203303,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfyDDdCRA9TVsSAnZWagAA4mwP/07IhPrtj7GV9nZdcO7E\nDzftfFOaS/bl0LoKavQhrG9VU1CYAs1S+dV/LfyVYxxifmm1mtL5cDsyQX0Z\n+R7sQuezcN5cglnbfAvaqASvylDqeMlDVFg1W2RN/W9mMV9OnRxgA8XYLTOO\n/1a08cD/oi/ihmJQFy6EJ1IwkSs+xK4sv5TCvW85Gmn14QHZgWZ5H+9iax1Z\nNKVpqjN5SkfjrX2am4GJFEK85peW7YCR2Z26q26NN1fugZuv9WwiILMsZKbs\n7hMZwmKL6+J6j7vSUz7gY+4QnwjU089ANxI7XEbzQqS1lUXWC5fNAJGH2cO7\ngyEANrwJZIatD4KK4nxrVgqMqlSzR86Hnf9BhvIU8QWHfVBYgu9qjLz2KKfi\njxYQpTQpLiMMwV0TWawdgW2z9xu2aPT547VdbgWgdXiaNye/8MbIUNUo7pad\n2uOwwmzDino3KLPSye9ApAzxUbWRFq3wK4+6p0a1nV+XCQgJ0ORca8aJG0ly\nX0uw3/K7lSnrYpcK6UGx36sq6CV4Lh30vHO4FKjfHQbXwGSs5jOwlWW17tEl\nnN7SCC5fFn7pVGxTFyIsj8sZmdS5jmOoeqqZQ44SH+DPolpEwGds04RhWcFc\nAJ3p/ngZcrB2EnKOcwy5x+5dTxOK1paAhq0roCDbcaz9Fwse/HRBy4Bqt1cC\n2Al3\r\n=3rc+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCZjerPbzxUSaEI0g8UEYevmQMKer/z9UCi3J3f/KdUaQIgYJqE5ggjz4KuCuR3jPDUiYlTPVqcaOeMK1E95XDzpTQ="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.20.0-canary.8fd4af5b.0_1606955228813_0.4406948703977309"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.20.0-canary.26d14d2f.0":{"name":"@material/mwc-textfield","version":"0.20.0-canary.26d14d2f.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=9.0.0-canary.ae27b44b0.0","@material/line-ripple":"=9.0.0-canary.ae27b44b0.0","@material/mwc-base":"0.20.0-canary.26d14d2f.0","@material/mwc-floating-label":"0.20.0-canary.26d14d2f.0","@material/mwc-line-ripple":"0.20.0-canary.26d14d2f.0","@material/mwc-notched-outline":"0.20.0-canary.26d14d2f.0","@material/textfield":"=9.0.0-canary.ae27b44b0.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.20.0-canary.26d14d2f.0","@material/notched-outline":"=9.0.0-canary.ae27b44b0.0","@material/ripple":"=9.0.0-canary.ae27b44b0.0","@material/shape":"=9.0.0-canary.ae27b44b0.0","@material/theme":"=9.0.0-canary.ae27b44b0.0"},"publishConfig":{"access":"public"},"gitHead":"50590c8a7415327322f7e0115bead5b6a56b9d50","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/50590c8a7415327322f7e0115bead5b6a56b9d50/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/50590c8a7415327322f7e0115bead5b6a56b9d50/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/50590c8a7415327322f7e0115bead5b6a56b9d50/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/50590c8a7415327322f7e0115bead5b6a56b9d50/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/50590c8a7415327322f7e0115bead5b6a56b9d50/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/50590c8a7415327322f7e0115bead5b6a56b9d50/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/50590c8a7415327322f7e0115bead5b6a56b9d50/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/50590c8a7415327322f7e0115bead5b6a56b9d50/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.20.0-canary.26d14d2f.0","_nodeVersion":"10.23.0","_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","dist":{"integrity":"sha512-xcZsI/QlStbRNkeW2IVkR+UBHJgoA5qM3ynHDFwCNrBtYhKa/TwyWdjiG4J1GHOIrZTHjJCZ+f1sy/aVNHFcxA==","shasum":"90aafc0a01865c9c2c09e9944447f0fdfcf90aca","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.20.0-canary.26d14d2f.0.tgz","fileCount":13,"unpackedSize":203303,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfyDeUCRA9TVsSAnZWagAAxkQP/Reo9okqggscPBqWrPgx\nZ3rtyi3KtSI3fWntObCkuJhFLk7ZuGbZ0TXo8RPAaoqep8plU4Wz0z/bb4/4\nXBTMpTZDsP7QsqU0BcXsSQPVtGQ4IYlxeIozoVtxlC1SHV7X6xX+NOoj02oe\nDUtJrjZfIU7tWKrrwNewHnsMvX3N2ZXpS4lhHyFvv1GB/YJl7jyXadMXHf/E\nyZEEQF5ugFV1jDZtslt3oe5hQfdfqB+1MZd3wAJ9GNCMaUHonxTkTjO67BJO\nH27+I9MVjlLkBWTMR9fDgZdpw291sO9RD4Cq9kfvfwXtThreCJljK07GsCP7\nIVF3N3eVVhGEk/RuH8aqFt3e1TmR6bhC3Ho4R8amKJih5I8KJZVkq6PA09zU\nEigkGeSvkp/jAL+Z3DcAB0lUTQogiUtYqSdOjXptNpP631FFafGaHQIakUB9\nsUvekLPqcGkAo+kLzaM8MH3YPUDM8Wuk8VSoET+ivRbOZ1H553Tk/8CdP3Q8\nahG+VYgqZI+/rj+aWLrSj1dGn2XM4xKJUVo8bE+hm/w6O//e9+qZZHf3dDyn\nLLQbYdmUY1c3kG8FxgIlTEe1sRuXpGnrDd1AG1sMlvQyObCSTruiFRUGxUco\nMMTkP/EfBz1DvIU5qKdkcxObrJyvfcroZ6QOquUWla6KVY4W0rfkHdMyRSpT\nUMHA\r\n=RHq5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCs5aVdaL0ueW4QUOZz1nt+ijXn6ZBiQyZ4EY/p/1pECgIgKbonOAsYS48l2KsYFVc0YlorYT5h8egSlMDy+nAWeuk="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.20.0-canary.26d14d2f.0_1606956948108_0.3531505416681915"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.20.0-canary.1663d7e4.0":{"name":"@material/mwc-textfield","version":"0.20.0-canary.1663d7e4.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=9.0.0-canary.11da3c0db.0","@material/line-ripple":"=9.0.0-canary.11da3c0db.0","@material/mwc-base":"0.20.0-canary.1663d7e4.0","@material/mwc-floating-label":"0.20.0-canary.1663d7e4.0","@material/mwc-line-ripple":"0.20.0-canary.1663d7e4.0","@material/mwc-notched-outline":"0.20.0-canary.1663d7e4.0","@material/textfield":"=9.0.0-canary.11da3c0db.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.20.0-canary.1663d7e4.0","@material/notched-outline":"=9.0.0-canary.11da3c0db.0","@material/ripple":"=9.0.0-canary.11da3c0db.0","@material/shape":"=9.0.0-canary.11da3c0db.0","@material/theme":"=9.0.0-canary.11da3c0db.0"},"publishConfig":{"access":"public"},"gitHead":"864efc8adbe583a57a2a7554cb0b3d625f3d52bb","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/864efc8adbe583a57a2a7554cb0b3d625f3d52bb/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/864efc8adbe583a57a2a7554cb0b3d625f3d52bb/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/864efc8adbe583a57a2a7554cb0b3d625f3d52bb/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/864efc8adbe583a57a2a7554cb0b3d625f3d52bb/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/864efc8adbe583a57a2a7554cb0b3d625f3d52bb/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/864efc8adbe583a57a2a7554cb0b3d625f3d52bb/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/864efc8adbe583a57a2a7554cb0b3d625f3d52bb/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/864efc8adbe583a57a2a7554cb0b3d625f3d52bb/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.20.0-canary.1663d7e4.0","_nodeVersion":"10.23.0","_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","dist":{"integrity":"sha512-QtRAtHH6fTTNyancXteA+K2l+sioaNEXc7h85HZtM+B/1iB7hN0yhajWxIF8p+y3HZ1R0fL7YKmRGkovjBKHLw==","shasum":"2532ba1e4ade05a34eff64a359938350ff93cee5","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.20.0-canary.1663d7e4.0.tgz","fileCount":13,"unpackedSize":203303,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfyDxoCRA9TVsSAnZWagAA9dIP/0XHdDyZ7v9rQi8hawy4\nMUnMey1+1CJR0XhpqzdDWyj6kod1XYgc6qLl7VBYT1vZoqFcxFSBM5lUAHrB\nIZMqHCECJoXKN+rduruUTEZmpMHlAnFxgcFC4GstOqFNKbrQY9C8b2i55vf/\ncG+y7tQr92ErLqDBDTPopzoQYbJQxFjStDgYOYmUPrhLF4aw8OJChKI+n8Vc\nJkHiFyrpClXUMkgt60Yw7ENKr0+T+Qr77Z5H1X8uAVZ/9HBdj/ygZ1j0gyiC\nfuljgZSxIbVE+DOXQm8IQXYrmP1BJPm4Ya+Un8bajwXmAPn8NZi+zQ5hivnO\n0L+PbQwbqACmvMxM62sgepgml6MSGvFec1jtEM9XInzdTAn5vULYaRx1Z/PL\n+5ZFs9zoxAkJVbRciCf9JX2gv70Mdz1+6bjx8RuVw8PXHJwoOVT7hrYGBswx\nfbRk01WINskVav6HjmcI51NZQlQN6MmBZ5yZbPzUkFX4cQhx4D6HuNeNkLe7\nkoXQ1wX9TV/ezblQUDHuP35QJEnN4GwhdONJGgzpEHScH5mapvkeR1r+//4p\nXqyIIuw9+OuzpQOabEQkKpfWh/N8ccIqoGMzvw32xpHSFpb+/XdmKkzX2nIa\n5r4glscjuvBQpTwKam2RmJakgxQXzpkbsd+hCZ7sFjp2E+AxrkcLVolqV7gS\nSsO9\r\n=LK2+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEMXWaq9m4hAImoVuc4VWAyTeAUd+hAtdgVEevSEB3GFAiAsXSaMrATCbeE2YtewjNEEsDD3wusecTZON6wu4uANtg=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.20.0-canary.1663d7e4.0_1606958183892_0.004476419111162588"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.20.0-canary.cbe9fc12.0":{"name":"@material/mwc-textfield","version":"0.20.0-canary.cbe9fc12.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=9.0.0-canary.11da3c0db.0","@material/line-ripple":"=9.0.0-canary.11da3c0db.0","@material/mwc-base":"0.20.0-canary.cbe9fc12.0","@material/mwc-floating-label":"0.20.0-canary.cbe9fc12.0","@material/mwc-line-ripple":"0.20.0-canary.cbe9fc12.0","@material/mwc-notched-outline":"0.20.0-canary.cbe9fc12.0","@material/textfield":"=9.0.0-canary.11da3c0db.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.20.0-canary.cbe9fc12.0","@material/notched-outline":"=9.0.0-canary.11da3c0db.0","@material/ripple":"=9.0.0-canary.11da3c0db.0","@material/shape":"=9.0.0-canary.11da3c0db.0","@material/theme":"=9.0.0-canary.11da3c0db.0"},"publishConfig":{"access":"public"},"gitHead":"ecbb2ff521324d43ca1ca402e290e52618e0454b","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ecbb2ff521324d43ca1ca402e290e52618e0454b/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ecbb2ff521324d43ca1ca402e290e52618e0454b/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ecbb2ff521324d43ca1ca402e290e52618e0454b/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ecbb2ff521324d43ca1ca402e290e52618e0454b/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ecbb2ff521324d43ca1ca402e290e52618e0454b/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ecbb2ff521324d43ca1ca402e290e52618e0454b/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ecbb2ff521324d43ca1ca402e290e52618e0454b/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ecbb2ff521324d43ca1ca402e290e52618e0454b/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.20.0-canary.cbe9fc12.0","_nodeVersion":"10.23.0","_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","dist":{"integrity":"sha512-HF2rBr0iu0TBPSCOAja4NQw0McPO6fa2o5mjMGUv2sDWXo44J8XHtMWApueiemf5az5va3ZNju/XeKWpV7xi+Q==","shasum":"69468b87bdb7b53cb911ca1e90a85650b841d2c3","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.20.0-canary.cbe9fc12.0.tgz","fileCount":13,"unpackedSize":203303,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfyTdbCRA9TVsSAnZWagAA1RoP/3v1rJZUBOPRvZafTpLc\nkpmbxs7opS0nv/04AZljV+m4t0I0t23fdiLcBqiANVLVnKi4/G2kjyMV+/dB\nWyuq3E4WD2imJvftwJrc/hvJiuYQbV3EVGv2OdonxRQWZWDHBesVNa2UlZSP\n9RwZz/1DDdCTLxPtr7PBu2+B4KoaATZLtYpb0vkRce2B3Asu96HbcP5WdPWK\ncv5S192WiigttEtZBMALLdscU/j7igzAZ+aM+Kv4XgBu0WyCsyvT0n0aN4Fe\nuOrhYbVz3zng0N4pK3J7lvIXOH8FSmRTGveUWI79fatn3DwWp/8HOMXekmYU\ngyBfIU2bm0o4hEwiJ1iycPPahrwNGgUegj4gDWnIVOMAeyKD3WZQA1qCXHog\nUkEWiK0Ndwi/j36SKV35PdxivDRkoYoSQNMKtFXIq/Hy6bjOdhaok6cKT4Xw\nRYjNs0ZGU8daTkXPrdFc2uUbZLX8sts2cMoWK2wWmh/9PYC2IC/T+EshB9qX\nOY8PqtduwoJxFXLmIX2ZHOv3sYWDtbx5bvyZLqumTb6dTIgKggs0szuvLDrv\nCSzZquQCsHUGx75XSTSHZIscnDeZIqUIAyHIRgPGZIG8NH5S66/9tU/NK4TD\n+8lxn1vm4q5dnUbxQoTVFyyhgbMDMhL1yzFRFl5sJjkZXD4dSSfxcJop3vv7\nsCjL\r\n=YB9y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFL49eVVkL0RVQNcFDpnenXKDmHXPQIsU1YQuLzykcAZAiApId0hTgLF5fzkP3xTFj9qwgUjuq1+6alS/YY4A21awQ=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.20.0-canary.cbe9fc12.0_1607022427052_0.4780064381472897"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.20.0-canary.9755be10.0":{"name":"@material/mwc-textfield","version":"0.20.0-canary.9755be10.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=9.0.0-canary.11da3c0db.0","@material/line-ripple":"=9.0.0-canary.11da3c0db.0","@material/mwc-base":"0.20.0-canary.9755be10.0","@material/mwc-floating-label":"0.20.0-canary.9755be10.0","@material/mwc-line-ripple":"0.20.0-canary.9755be10.0","@material/mwc-notched-outline":"0.20.0-canary.9755be10.0","@material/textfield":"=9.0.0-canary.11da3c0db.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.20.0-canary.9755be10.0","@material/notched-outline":"=9.0.0-canary.11da3c0db.0","@material/ripple":"=9.0.0-canary.11da3c0db.0","@material/shape":"=9.0.0-canary.11da3c0db.0","@material/theme":"=9.0.0-canary.11da3c0db.0"},"publishConfig":{"access":"public"},"gitHead":"45ec0e755bfb97f054d48e3543837f693347d6da","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/45ec0e755bfb97f054d48e3543837f693347d6da/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/45ec0e755bfb97f054d48e3543837f693347d6da/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/45ec0e755bfb97f054d48e3543837f693347d6da/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/45ec0e755bfb97f054d48e3543837f693347d6da/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/45ec0e755bfb97f054d48e3543837f693347d6da/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/45ec0e755bfb97f054d48e3543837f693347d6da/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/45ec0e755bfb97f054d48e3543837f693347d6da/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/45ec0e755bfb97f054d48e3543837f693347d6da/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.20.0-canary.9755be10.0","_nodeVersion":"10.23.0","_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","dist":{"integrity":"sha512-evpmhGhQtY2dqeyv522WTXYVysZ/shvJ+Z1HlDTazEaWUg28BZh0GyjijAjbvI/MbgPQDsSxl12mfrHjD9//sQ==","shasum":"3062712a928aa9a7cfc289b09932d667de665b2f","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.20.0-canary.9755be10.0.tgz","fileCount":13,"unpackedSize":203303,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfyTubCRA9TVsSAnZWagAAILMP/jV3BQBZDwIIpWjbrqLd\nqDutrSLxunRQt3+YEBPgGnEbc41skZjzJ7AQrM4dt1gWlqjlXtW4UjhjEayd\nkYstPYNF8W2NOokB+GLEsQCukvhR5LKQxmHRmsk5t6Du0fe8S9zu+NiFTZ5M\nM6p+ET9JOTkZlpfxS9c78nva5TI8j5lJyFX38du/nH2AHDUjHeL53cyQt5fl\nZ2e3OnCipFWX6OTFTLHvSKZYroelF4eeBBSyIR1oVs+NGlqBVnwLCVYHY+78\ndvy5gS1c18u/awSDsOyLK3sdr9+GhV+9xQppIWOJseq/wHK+Cu4BvJ3xtBfK\nYEoSDXAVMLwLQGncmrKkrV+6ovG9fGZ2y2ULYYqW/pk4a5LBA/DJd9/8GyQu\nfbjRuIP1NlYO7LhEkDOKC28EknNryWpHWxGZFb9daLVIDoXn6+vcyrRfDuYI\na3Udx5NK+c5sw/CeIHKRuANlqWWK9Z0QL393thm4ZdxB5EfEzM10qmk6XIVC\nnsW2VvYBFDJGmznTpyDK/Z/Q6vPFnNDx+JCbJszNl5T9oVW6Ho8prwHDe47g\nubYQrA8Ipf0YRSaFj0urlJP6qsLcIea+oEpp99UrgB3nMUOAbhVskHRKPO6c\nG/QsVwcwbnKIQjKWkOtmfr+zIlIHU9s/GGY0WSsUXKLnzCYfaAiKhFLz/trz\njDfz\r\n=UgPP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHe5v7htcMEnQvnuOWkXWAIurVuinCYG9vEIU7azP5ZCAiEAz1NxXN6yu3h95Xth99CJHEZP9NS22drA4aOY2l0CXcg="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.20.0-canary.9755be10.0_1607023514993_0.9658324458516543"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.20.0-canary.3f64270c.0":{"name":"@material/mwc-textfield","version":"0.20.0-canary.3f64270c.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=9.0.0-canary.1c156d69d.0","@material/line-ripple":"=9.0.0-canary.1c156d69d.0","@material/mwc-base":"0.20.0-canary.3f64270c.0","@material/mwc-floating-label":"0.20.0-canary.3f64270c.0","@material/mwc-line-ripple":"0.20.0-canary.3f64270c.0","@material/mwc-notched-outline":"0.20.0-canary.3f64270c.0","@material/textfield":"=9.0.0-canary.1c156d69d.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.20.0-canary.3f64270c.0","@material/notched-outline":"=9.0.0-canary.1c156d69d.0","@material/ripple":"=9.0.0-canary.1c156d69d.0","@material/shape":"=9.0.0-canary.1c156d69d.0","@material/theme":"=9.0.0-canary.1c156d69d.0"},"publishConfig":{"access":"public"},"gitHead":"048e0b4e0ee67cb81910736a7dcdae5e949a5eda","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/048e0b4e0ee67cb81910736a7dcdae5e949a5eda/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/048e0b4e0ee67cb81910736a7dcdae5e949a5eda/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/048e0b4e0ee67cb81910736a7dcdae5e949a5eda/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/048e0b4e0ee67cb81910736a7dcdae5e949a5eda/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/048e0b4e0ee67cb81910736a7dcdae5e949a5eda/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/048e0b4e0ee67cb81910736a7dcdae5e949a5eda/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/048e0b4e0ee67cb81910736a7dcdae5e949a5eda/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/048e0b4e0ee67cb81910736a7dcdae5e949a5eda/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.20.0-canary.3f64270c.0","_nodeVersion":"10.23.0","_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","dist":{"integrity":"sha512-GWdEEJavMuWctAsowrXJQtFAm9rQhsYmgbvwOEp9KtIrzar/7eZOHRBmrvB2sWDPkOtJa72gm8FD6R74QKg4kw==","shasum":"5258ac98ee12021ed6dcf8d63a9387cb9e7c4788","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.20.0-canary.3f64270c.0.tgz","fileCount":13,"unpackedSize":203303,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfyV12CRA9TVsSAnZWagAAwrQP/34uqf3DG/0tho9ObUt4\nd2OWpM2aDu7kV6pTsyA1NIutHzvcUdxufEXxbkkdf/CpXqTqdf4LcLF8YsJY\nTCCHHyNdx344Vx0AQUunF12L/BUzvp+MwiQzDQCwvK/ZNHVaiesz3BejhilO\nS9xlNv3VPYIcdKUDs62y/XA4uuu7QhW0HcATYpaYV5vP8wxHdWzV5jFJ+RPA\nR+wAfJ1oXMddVBhE+CSG8nYgf24JZ8ySsTq5BCnONBkYDqe2PlWa/b9t+A6c\nOj19mj4MvUmeWFYsCIaMO5XH8XQE62wn2WX4fplXCqe2DLPN3Cpk5cV3bm0U\nOMUVnsI2B/HP0ATO5LdHsH3OBC1vPubul2NX4WOFOUk4m1jDiefhUO2R5vDJ\nDdUD525ibOqVPd3dHET26dFWO6TbmNRBezMPHrA6i8v+s5FIMCFRLgW+1ale\nN0K8dNooHxdpBilcFHUZFxVQ89BoLuL7ezUyPHkZVohF3CSVmipCpfR5EcCm\nnXTf6znv2IFgMeJm1YaAgLbFzSezuxCmiqGAD2fhZsnl02GGEzo8N48KrF4k\nxcgK1kU8QdtHO9XuCONi1CWh33HJwY6/IcdnL8LWt4cciAFVZggimvwKWu29\naqasjujJJMdk9P6upDil1tAvsjXz0OXAkdhg67ES/r4G1voMMzGXWsAr0hqt\neICf\r\n=9pa+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBy890wpiD9W5aLhKMRyA9weTlvEChMl0dA2pqC7qDeFAiEA06mKz6ZnSXBo+KiLDMbdlrZ//62jcO3fzpYr/ql6bDU="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.20.0-canary.3f64270c.0_1607032182454_0.7475687352957485"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.d893b14a.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.d893b14a.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=9.0.0-canary.1c156d69d.0","@material/line-ripple":"=9.0.0-canary.1c156d69d.0","@material/mwc-base":"0.21.0-canary.d893b14a.0","@material/mwc-floating-label":"0.21.0-canary.d893b14a.0","@material/mwc-line-ripple":"0.21.0-canary.d893b14a.0","@material/mwc-notched-outline":"0.21.0-canary.d893b14a.0","@material/textfield":"=9.0.0-canary.1c156d69d.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.d893b14a.0","@material/notched-outline":"=9.0.0-canary.1c156d69d.0","@material/ripple":"=9.0.0-canary.1c156d69d.0","@material/shape":"=9.0.0-canary.1c156d69d.0","@material/theme":"=9.0.0-canary.1c156d69d.0"},"publishConfig":{"access":"public"},"gitHead":"d85f7378e0640c2cfbe4f96436e664222a4c2571","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d85f7378e0640c2cfbe4f96436e664222a4c2571/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d85f7378e0640c2cfbe4f96436e664222a4c2571/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d85f7378e0640c2cfbe4f96436e664222a4c2571/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d85f7378e0640c2cfbe4f96436e664222a4c2571/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d85f7378e0640c2cfbe4f96436e664222a4c2571/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d85f7378e0640c2cfbe4f96436e664222a4c2571/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d85f7378e0640c2cfbe4f96436e664222a4c2571/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d85f7378e0640c2cfbe4f96436e664222a4c2571/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.d893b14a.0","_nodeVersion":"10.23.0","_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","dist":{"integrity":"sha512-W6ldCuz7Qfc2a8SVbydr8svY9Aa6iGKKlU1JLyrykh+IM8pWKnquSEz27K/lcQmjc18608hl9osjtpj6j2jEJg==","shasum":"e266dc0bc6d8a2564837ba125c9d3ef199892e4c","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.d893b14a.0.tgz","fileCount":13,"unpackedSize":203303,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfyWX1CRA9TVsSAnZWagAACrgP/RnsaG5NvJv0DcChdqwC\nzrSGtrpUXI8SHIlwgvPC83XOzBRYA8mK8z0OV5jryqyIrCznBLEyoyX/8829\n6fOKldG5jgGc8GYgPbnl045JfnXLN3yPV4yME6GW+KGaZ5xEWZ73SRdX1359\nNEW/amjMnHPTjYpF0L2PNx54XvCxS+XqCZE+69hd2+47sbFlyESlsmAEAMqJ\n623KA+hzD6/kVci3JFd4ddhJ9/kGPYkb+Ru14YQo2gEBN2D3LBIs6eYY/PTp\n64jWbMsOwcw253nTykWmMPpCkkKpbkG4KmSqfGYJLBlpss7s3IiF51vg3TsY\n2J3JYrMmiaJAszqJV168yXdbpKA6NTJQIZDWFa5TSyv6Gr4p0WUjW8VZ7NRG\nPJtQ+/x28Aj1s7SA7lmjM0pqtTD4PkcC9LVfbzlmnEQkUhetdbcYTaLSsphw\n1gGAFLzSTzB1Nk5eKQWFG3WhMm3RI+RlsNHHQYZbqWMKXU9HH6ez+y86kEhB\naxdFl7CH3hDg8mBAwfl7cyh617NYOv9qKUdH3GfEcZj1nMgRhquZ7q3og2Q+\nbFJ94oKSPZGEBKsxttV1hAa2KSeLqV7C2OauUt30w2cjFpRHFMQESi63fVY8\nyBBI/q9f/fbGcc+/d5HKcSL1QlPRpBdOG3mRqiTt3kksqb2Z8Py/NLwMdpJc\nVEum\r\n=BNKc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCPTTli6e5VXiDr9g4sxwfpyhHYShAe3aB8cO9QlzpnfgIgWJg7PsX/1rdKC7Zs3JQPa8MDxDIk4DMqt84UcmkbtSA="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.d893b14a.0_1607034356845_0.14262876747304798"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.20.0":{"name":"@material/mwc-textfield","version":"0.20.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=9.0.0-canary.1c156d69d.0","@material/line-ripple":"=9.0.0-canary.1c156d69d.0","@material/mwc-base":"^0.20.0","@material/mwc-floating-label":"^0.20.0","@material/mwc-line-ripple":"^0.20.0","@material/mwc-notched-outline":"^0.20.0","@material/textfield":"=9.0.0-canary.1c156d69d.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"^0.20.0","@material/notched-outline":"=9.0.0-canary.1c156d69d.0","@material/ripple":"=9.0.0-canary.1c156d69d.0","@material/shape":"=9.0.0-canary.1c156d69d.0","@material/theme":"=9.0.0-canary.1c156d69d.0"},"publishConfig":{"access":"public"},"gitHead":"d893b14a0846777b90c10839f3d05c36bc34692e","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.20.0","_nodeVersion":"13.8.0","_npmVersion":"lerna/3.22.1/node@v13.8.0+x64 (darwin)","dist":{"integrity":"sha512-VFy53M6En0REG+jY+E0dpi9PKSF25KwMIXt0OoCdHPLtWhZkCarpwbdkywbvV9GjyAllweVRhtdpLmZgivOV9g==","shasum":"a6f1e90e5e4fd001cf74f7e4ddac4410b3730455","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.20.0.tgz","fileCount":13,"unpackedSize":203200,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfyWafCRA9TVsSAnZWagAABIEP/2fTd/MXcfhB+1CfOW9q\nmoay/V7H8cTZwzQFrAlGhOav5jr/RJeSDbFiKn/LXoSgG0FoXysafdkFBkjX\n69Ggxr7JHh3Wy9Mf7VrnU+r0qKug42/4VH9slfCFja7av3qvOZCnZo7VekSX\nvu2Z/BdIsyc2MEWDExb78i3CZpOfW1KcagmYWZEht4eOrP4Nw1PFd9jF5Fy4\nTuIQww5LLSW1DXPyXSoV/EKCCnD6lkhvS/oOzqH8LHlgR5w5+IQsjpRICfVf\nQqB97lpQXwccfJdEn43HIHmOcbNO5uU56GabQe96OOur3ghjSUamPK3cb+0N\njw5IsIX87Dtbw82sVCtDW6O4Gdx284oTiosdDycPJvvxDtM178iQKUy1H5eQ\nOS5GfgKfNkUlB/RYziURFQPGwASGQ8fgXxceWejW5JwrsbiRvZOlJh6geMLL\naS9tX59/gjkQLkv9tAYsxqRg41cigwqJ+BNKnYEZyP5gcUH0KeL3sr0FrxOQ\nRMI2lW7VrPn6QlrbSlG46VIVeSaSTIetgMCzE3Wbb7C42v+JDgtPkg9O/eA7\njQ2vHKrZvONSXO5wmqWLohBhANDdsLZDr7RxSdjldw2lVu+YiIy8MOh2z4G6\nz2V/OOPiG0rjloOakRAhS9GcpQbfbnKs/bdpZvo9/DHy3eqLtH7HYLIiPgt4\n4ecU\r\n=JjTV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDrxb2y7njUR0/P11Gf0hssFFRZQ569kF4VZ+HjoDoIFAIhAI41POBVhWLgVP7eb/c2hGZUvF5VI4MOvE0XoOpvQ38z"}]},"_npmUser":{"name":"emarquez","email":"emarquez@google.com"},"directories":{},"maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.20.0_1607034526640_0.9688573171881425"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.47c7d7e5.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.47c7d7e5.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=9.0.0-canary.1c156d69d.0","@material/line-ripple":"=9.0.0-canary.1c156d69d.0","@material/mwc-base":"0.21.0-canary.47c7d7e5.0","@material/mwc-floating-label":"0.21.0-canary.47c7d7e5.0","@material/mwc-line-ripple":"0.21.0-canary.47c7d7e5.0","@material/mwc-notched-outline":"0.21.0-canary.47c7d7e5.0","@material/textfield":"=9.0.0-canary.1c156d69d.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.47c7d7e5.0","@material/notched-outline":"=9.0.0-canary.1c156d69d.0","@material/ripple":"=9.0.0-canary.1c156d69d.0","@material/shape":"=9.0.0-canary.1c156d69d.0","@material/theme":"=9.0.0-canary.1c156d69d.0"},"publishConfig":{"access":"public"},"gitHead":"670d83aacd771290b76b657bfe6ee631865c037c","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/670d83aacd771290b76b657bfe6ee631865c037c/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/670d83aacd771290b76b657bfe6ee631865c037c/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/670d83aacd771290b76b657bfe6ee631865c037c/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/670d83aacd771290b76b657bfe6ee631865c037c/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/670d83aacd771290b76b657bfe6ee631865c037c/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/670d83aacd771290b76b657bfe6ee631865c037c/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/670d83aacd771290b76b657bfe6ee631865c037c/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/670d83aacd771290b76b657bfe6ee631865c037c/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.47c7d7e5.0","_nodeVersion":"10.23.0","_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","dist":{"integrity":"sha512-OYIw645meYvU108J7fPIx09fSyPq2bq1xy2oXXJeM33epmvkgcKEGSafPJWbqH03USZAssBT2BC5gJAUBzDM4g==","shasum":"a97b0999b0246085e8bd429f0869ab96045fe2d4","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.47c7d7e5.0.tgz","fileCount":13,"unpackedSize":203303,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf088DCRA9TVsSAnZWagAA5ogQAKDQ1/lixwJRzOE2s0B+\nB7HsUJm5EK23LZGEJbFrm545/ZBfJERsYp9yx06ijYZkL0I1PEzJvt2lHSKA\nIvcpb/EHj3R7JDtNPnka11zg/IoYAlxHXise1zpb7KRQqqukfRX7BXtbaWWp\nqjDynuNZOVr0wo/SioPVoPBC/4/GqYspI28KfcQv05ZOoc6+vw5aPu0gCk8V\n4Fjlwd1YlbHCPa8ZO7axvIes+v5ZCHDwiuT2IUYL/4s09bcduNrbiS47X5cA\n5kOF1/6MoOiRNravuvyzBO22a45HMkQVEo+X7ZWsvqXEBkiaXfDEGtrkSFC+\nEaGQ7Oya4m+13Yqo5CNDc9zccqKCnwKKj63DAvFaVGkDXoryIJGDtcsycDdi\nJH7i7uoKtjB49W8MehEaE2HRpbgKVw4VEYfJiel616zj5QcTUbmRskKOeoYp\nZYPVp/orMaAVO1HMqsB5vzp6+NJR3N4F1etQhXE8u+lPCUbJNBH/JmtZP5Iu\nuBQE4x8JDS5rKR+e4M69nwmfgWcTdPd5gaCujCeLaKUKOOEeH8f2Czcc5Oyf\niu6dWE/vOG9Ybel8kGkprkcBi/yxZvhaZo2+Am/Ap1Zdk/uHTwpdSMFmd/df\n2lDjE/U2oIK9fwSJBXHCmz/pL7wUgUG6DqyqJBgCIMTORB9/TBnp/NG/L9LG\nISJ0\r\n=8acA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDZDa7T0LNBMQC0+d5WERC8ieg1rODIiPcWN3dgLNRO+gIgceHnDvq5rGRkOIyXS9SZV+M5bBB1xcEcU3oJKLyiWrc="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.47c7d7e5.0_1607716610449_0.4894487036896846"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.b304a78b.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.b304a78b.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=9.0.0-canary.9244508bd.0","@material/line-ripple":"=9.0.0-canary.9244508bd.0","@material/mwc-base":"0.21.0-canary.b304a78b.0","@material/mwc-floating-label":"0.21.0-canary.b304a78b.0","@material/mwc-line-ripple":"0.21.0-canary.b304a78b.0","@material/mwc-notched-outline":"0.21.0-canary.b304a78b.0","@material/textfield":"=9.0.0-canary.9244508bd.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.b304a78b.0","@material/notched-outline":"=9.0.0-canary.9244508bd.0","@material/ripple":"=9.0.0-canary.9244508bd.0","@material/shape":"=9.0.0-canary.9244508bd.0","@material/theme":"=9.0.0-canary.9244508bd.0"},"publishConfig":{"access":"public"},"gitHead":"44ea71b47f36de83be1e3319efa93b6fd3690c2c","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/44ea71b47f36de83be1e3319efa93b6fd3690c2c/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/44ea71b47f36de83be1e3319efa93b6fd3690c2c/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/44ea71b47f36de83be1e3319efa93b6fd3690c2c/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/44ea71b47f36de83be1e3319efa93b6fd3690c2c/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/44ea71b47f36de83be1e3319efa93b6fd3690c2c/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/44ea71b47f36de83be1e3319efa93b6fd3690c2c/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/44ea71b47f36de83be1e3319efa93b6fd3690c2c/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/44ea71b47f36de83be1e3319efa93b6fd3690c2c/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.b304a78b.0","_nodeVersion":"10.23.0","_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","dist":{"integrity":"sha512-HilYXLfyK0fiu/D8cqzd/KLiBKBynrsgkMogYOLgR8nmyUyuYexVU348CofzR6upUOmiweGsMe1ug05uG9LlVg==","shasum":"1698b53f6555d22e77a2cfa246ea1fefd70eab94","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.b304a78b.0.tgz","fileCount":13,"unpackedSize":203303,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf2RapCRA9TVsSAnZWagAAeFsP/jCyNwt+ucWUusRbgNu7\nRLIGf2vMyDgru92+M0OK+FITGyI/y5yI7zZiDsyPPcepE2UMijhLjRkdd8Jw\nTbhk/RuWcOCPpbjtEQRStZZtpKtVCGjQ5BUwCY7cBzNdfcTZlPsTHznh+WIy\n8xWhAg+i5L0mYkx/MmfBmDgBiVPs0ammgl1zXH4QLXYx1MXp+8avZ+b+QEgx\n/soNA5SEd0puijUC/QC4q6EFJB6xwJ8/o8RBLGWSfT/W6jPdpqAQhMZo17mJ\nEXzCyKe+mJL45BeQzPuNzMfp6ykHlb8dWtZ3SWK98hcW+tYLyG4/nMlZgADW\nNcbVztDORzIUDw9RRnkIyNbPe/PVOHvm9soqyThZO1rnMcMiZzbxjLeBGyVy\nMbqlRiJ5cTyXB6iiXj/EbQvM8m22DUqGZESU5xeRfT4ddFFHWX7VnAwKKBgD\nT5cikb2BBFHZxVfUVrUw2MVnEvQ6J1ZeCGr5by9S1j1Gg55PWAS9Y7eRYRZW\nlAmHpaByZtg1R4yFslBR2pTKymVZ6MT4T5ddXD36kpH9TlWREf0JaYVnL5Xf\nGQrqKAGyHqBxo/WXmSQcuGZARk2aMPmyjnGPfAFdkP/trtqnrsMM3zuyxCDf\nSmWsd//GYG8hRWuoa2qGud4edWXo2ug66ZCsyJQuCnX3G4z0v8/XC+qA6D1+\nkNGm\r\n=b8r7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCq8OBebIh6DgiOv+Y3HYqJbcFbqvVLW0FVw65TiNnOvQIhAJ6RMx6cQknVfkpuWZJ4WS8J/IVfSQMsutX3M4C+jFrt"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.b304a78b.0_1608062632743_0.05596670001968529"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.777c5fa4.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.777c5fa4.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=9.0.0-canary.9244508bd.0","@material/line-ripple":"=9.0.0-canary.9244508bd.0","@material/mwc-base":"0.21.0-canary.777c5fa4.0","@material/mwc-floating-label":"0.21.0-canary.777c5fa4.0","@material/mwc-line-ripple":"0.21.0-canary.777c5fa4.0","@material/mwc-notched-outline":"0.21.0-canary.777c5fa4.0","@material/textfield":"=9.0.0-canary.9244508bd.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.777c5fa4.0","@material/notched-outline":"=9.0.0-canary.9244508bd.0","@material/ripple":"=9.0.0-canary.9244508bd.0","@material/shape":"=9.0.0-canary.9244508bd.0","@material/theme":"=9.0.0-canary.9244508bd.0"},"publishConfig":{"access":"public"},"gitHead":"8e5f0e24042f2b54d3ebcac6c8bc11f89a7c1a1d","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8e5f0e24042f2b54d3ebcac6c8bc11f89a7c1a1d/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8e5f0e24042f2b54d3ebcac6c8bc11f89a7c1a1d/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8e5f0e24042f2b54d3ebcac6c8bc11f89a7c1a1d/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8e5f0e24042f2b54d3ebcac6c8bc11f89a7c1a1d/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8e5f0e24042f2b54d3ebcac6c8bc11f89a7c1a1d/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8e5f0e24042f2b54d3ebcac6c8bc11f89a7c1a1d/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8e5f0e24042f2b54d3ebcac6c8bc11f89a7c1a1d/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8e5f0e24042f2b54d3ebcac6c8bc11f89a7c1a1d/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.777c5fa4.0","_nodeVersion":"10.23.0","_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","dist":{"integrity":"sha512-/iU7BW0aZ93/Im8/2UFhA2f3vWU+GwSpTqb/6spi6wDUOjrxcpyG6HVr7dbqODp7eoIl9CqimG6ffIS4CH5UIA==","shasum":"fbe34a7daa29b5ad4fa59e3e200b04ae8a09d2b8","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.777c5fa4.0.tgz","fileCount":13,"unpackedSize":203303,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf2oH0CRA9TVsSAnZWagAAKG8QAI2MKnRsJiUBHZGF/jN5\nv4mp3ksz/jvyZUKEqORBLBIWLn3jvSdPedZKyPNoxI8E/1VU1X1SN/02w1z7\noYbtLmSp5okiy31moe7nLny/SMrIZUv4qh9NpWjseSN8flnWVI95h+kqqzBC\ntU0zoLWJ1UoLLt18acQvz/VnJlCF+eLiaFzbfcltaMFlnbfzdbqKiNWDv8It\nNnJS/hn1AwuFimLCB0pSLKYdAiE33QsNjcq5PoJMbkeOjN9vzL3IGRw4uUQ8\n0cWbS6QJYTaAk8zFNHqi1TmQhIqOkeBu6GO2d3r74Mj3pg4Fbh5ywuj0tGxZ\nnZ4ILfbyfJKDf+sFl6o85kr+DstWP8mIpa/0aWDOGu8ft5BmzX7tD+YvneJy\noY789NBuIJL0TF/kGTz3cKX+qY24FK50xhLg05DSOg2BA5YGmktIMpyiIaUL\nlB8w54HAZcBuLvgVTJ4wVdiXtb0yjDSx/JSH7x2v7+TZeawq19LdWxLgt81M\npm+eAQ75oneiOSsP9w/unrxtcnb743JGnsqv5a1AzhNjmj6uk3VY9IA3Nr/3\ntCnGi3rsPYGjJPcEdXU3y/467kqXr5uOqBudvgHyJD0+2FH7hIp+KR+k7hMH\nYIbeaqW2Rt2npKfD4jwVD9VWAbt2wR0lOYv2NMk2CdkkJTH+JfbjLfi2CN82\noMhV\r\n=xf3Q\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFP5p3QmOoykXWuMX+XmIrBMQlTszxvi3diJ4oqn9PkYAiAR/MfnsCT8tw9JGP2mkkFgx4EqaDJ4qp3ld4BUl5zXUQ=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.777c5fa4.0_1608155636067_0.5423580882111902"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.635c7996.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.635c7996.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=9.0.0-canary.30fdfd06e.0","@material/line-ripple":"=9.0.0-canary.30fdfd06e.0","@material/mwc-base":"0.21.0-canary.635c7996.0","@material/mwc-floating-label":"0.21.0-canary.635c7996.0","@material/mwc-line-ripple":"0.21.0-canary.635c7996.0","@material/mwc-notched-outline":"0.21.0-canary.635c7996.0","@material/textfield":"=9.0.0-canary.30fdfd06e.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.635c7996.0","@material/notched-outline":"=9.0.0-canary.30fdfd06e.0","@material/ripple":"=9.0.0-canary.30fdfd06e.0","@material/shape":"=9.0.0-canary.30fdfd06e.0","@material/theme":"=9.0.0-canary.30fdfd06e.0"},"publishConfig":{"access":"public"},"gitHead":"a0b572136cec769df6b66314ae5710101b643ea1","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a0b572136cec769df6b66314ae5710101b643ea1/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a0b572136cec769df6b66314ae5710101b643ea1/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a0b572136cec769df6b66314ae5710101b643ea1/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a0b572136cec769df6b66314ae5710101b643ea1/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a0b572136cec769df6b66314ae5710101b643ea1/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a0b572136cec769df6b66314ae5710101b643ea1/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a0b572136cec769df6b66314ae5710101b643ea1/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a0b572136cec769df6b66314ae5710101b643ea1/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.635c7996.0","_nodeVersion":"10.23.0","_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","dist":{"integrity":"sha512-/CCTGED4+cujaZjP4BxJFvztli6IJUYBVBgLSOq2cOUVbjR2vGNwrIoCIw+OWxXhG6+QmX0M8m0J0Opv29OusQ==","shasum":"49e2b90e2c93a6acc5bab74b3b7dc55a9fba326c","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.635c7996.0.tgz","fileCount":13,"unpackedSize":203303,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf2+pgCRA9TVsSAnZWagAAq+QQAJdECmZ2zSSSyodVuNHn\n29+5AAGvPkAUA0fgYA3jsAjCfZDWUWxJofdjWYVWb4VD6QVCDGGU2p1Taamc\nHA4RK7Iv6FX5W1eDM2wIXHL1o/VejgYQcK7rYRyhFxck5Qf4IdIaE6JQUe4w\n3/tGcZJOmQlQVXSv5PQUasTMG1vH2UPOY2OVkyjsLOTwl0keyhkNO5GaponW\ndSk9Ah/100Mof/8S4Eh4X92Iu2Sy9Ahvnj4M0Jwt0lD7MCiivNycuygkJ3Sb\nfLc/jr0CIFqdJg6TlQyxwx7V9L/5Q5lF2sM/XTI0rzYDcPu03WrSI+MEbonq\npA6F2g4FuitBYDhozpzIC4s1JtuFGC8q9mTTHI4PM+Pa4dO6Gf8LElluSwWL\ngJs7RfIU528dQ8xSbfEmEBxDvQn2jvq2UsmH1DibvM6Ag4+t6FPWA8mROtSd\nF6I7MB/euY/UcYoh7ee/MrHBAB6y1ASkn+3/ItYiInWG9tqxHFY5355h85dd\nDo2Dcjgfxl50aEkO2PuFkg7QifLWE2k8tzfx9glN4/hPSuqaYRKWeZeS5KWg\naJ0VDtL1t10pss6mvIpFiN7RC/UULEKQngKsUhKSZ4CdLkqo8cpNoby8+sd1\nDB2IyORS0I+C+FbFm6vdLr+x9HXMwtEWjujtgnXU1XANFuovPu0H5QlZCBni\nc+8l\r\n=99qK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCfRe/Ni3WDxBLln4HfPSkefdYjcE7rMdpF7+uQUjhdPQIhANW1gXgps5jvmG8bl0c+xICReQj8ZLzRZ2XnjCdeLV54"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.635c7996.0_1608247903799_0.9045021141190734"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.20b0045f.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.20b0045f.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=9.0.0-canary.30fdfd06e.0","@material/line-ripple":"=9.0.0-canary.30fdfd06e.0","@material/mwc-base":"0.21.0-canary.20b0045f.0","@material/mwc-floating-label":"0.21.0-canary.20b0045f.0","@material/mwc-line-ripple":"0.21.0-canary.20b0045f.0","@material/mwc-notched-outline":"0.21.0-canary.20b0045f.0","@material/textfield":"=9.0.0-canary.30fdfd06e.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.20b0045f.0","@material/notched-outline":"=9.0.0-canary.30fdfd06e.0","@material/ripple":"=9.0.0-canary.30fdfd06e.0","@material/shape":"=9.0.0-canary.30fdfd06e.0","@material/theme":"=9.0.0-canary.30fdfd06e.0"},"publishConfig":{"access":"public"},"gitHead":"a6bca4682b5b0bc23e8311853608b98f5594831a","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a6bca4682b5b0bc23e8311853608b98f5594831a/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a6bca4682b5b0bc23e8311853608b98f5594831a/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a6bca4682b5b0bc23e8311853608b98f5594831a/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a6bca4682b5b0bc23e8311853608b98f5594831a/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a6bca4682b5b0bc23e8311853608b98f5594831a/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a6bca4682b5b0bc23e8311853608b98f5594831a/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a6bca4682b5b0bc23e8311853608b98f5594831a/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a6bca4682b5b0bc23e8311853608b98f5594831a/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.20b0045f.0","_nodeVersion":"10.23.0","_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","dist":{"integrity":"sha512-vMrok3PKe48c0IJhYUJ5oFc/wEZ8S3Q9dTWG7jO4Hhq3739HMiE6j/4dlYnEGB1aYqjOfUeLI2Qzrz0VjKeUcQ==","shasum":"30fe51a52c1d02904f4647b4a8351c44c5b34b86","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.20b0045f.0.tgz","fileCount":13,"unpackedSize":203303,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf2+5cCRA9TVsSAnZWagAAb9cP/2BkZXIdOjKS8KkO7LQC\nRk5aiZkwp5n+Q0j1eeVUCaex4fJf5LxuDseV4kHmZTeC7WPZAEIJspVEqH2g\n+WYpvLJYl96whljhYKof2u434tky5izva1+LLQOByCNwkY7VrbK2ks27R1Wt\nLfxyr8l45CBqCVyyZI4pQ4/pSCDB5zciYT4Wb69hCURJ4biGC8LNd2BNkETa\npueHLMshLpkR349errrn/jMad15L5B3gSSYgVYaH0KLwSXk9lPwZqkbtt+Z/\n1w/HJ5u2TqmknnkoVGk65J3a1rdumy4wepNlr+KFBRs+zRSNyAuRHeHrFMkG\nu7AAC198DMlRim2pffsF1Rk7Bj9Ua18w5vk5cFjK3pHBlpkJL4z1mA6UX8/Y\nSKHgl/uKFHkxJ03zKQrXQu40MGyQ+mosiSkNWqDazbYgmDPlfAyK/7pn3qNg\nWPoxD1A318AV4hTFHFdpcTaVVDyF/r5fAqIivSQ7GrNtZjAH1xY0MIG5xr3F\n/NIrXg85M+FSjSV4CJOaPhhu8FWC4F2PyEnqfCxtj1rvJ/jvuIOR7rdI5TTY\nb/LeIGbCN4AhU0uziPDznJZhUTNmskIwTWoHPa4Xbgk4JgwO6oNSK1mLVZ/s\n6sxVYcGZooYsNP+rH0CeSbCpAtkx6SWjLMNOGfM0INjngWhw+GVh6kNgxuCF\nFUG4\r\n=Q0HR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICXRXqClk9rheaSgJ5FObrSXzkELAHB9m4DMFculvsEqAiEA4gqlJ4yofUHRKKVtSG7REt4BTVIQ+x+TzBCug1K284s="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.20b0045f.0_1608248924174_0.9999142822339537"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.41f77000.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.41f77000.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=9.0.0-canary.30fdfd06e.0","@material/line-ripple":"=9.0.0-canary.30fdfd06e.0","@material/mwc-base":"0.21.0-canary.41f77000.0","@material/mwc-floating-label":"0.21.0-canary.41f77000.0","@material/mwc-line-ripple":"0.21.0-canary.41f77000.0","@material/mwc-notched-outline":"0.21.0-canary.41f77000.0","@material/textfield":"=9.0.0-canary.30fdfd06e.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.41f77000.0","@material/notched-outline":"=9.0.0-canary.30fdfd06e.0","@material/ripple":"=9.0.0-canary.30fdfd06e.0","@material/shape":"=9.0.0-canary.30fdfd06e.0","@material/theme":"=9.0.0-canary.30fdfd06e.0"},"publishConfig":{"access":"public"},"gitHead":"59ffc250e9e7d85ede63c75495b12e981e365677","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/59ffc250e9e7d85ede63c75495b12e981e365677/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/59ffc250e9e7d85ede63c75495b12e981e365677/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/59ffc250e9e7d85ede63c75495b12e981e365677/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/59ffc250e9e7d85ede63c75495b12e981e365677/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/59ffc250e9e7d85ede63c75495b12e981e365677/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/59ffc250e9e7d85ede63c75495b12e981e365677/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/59ffc250e9e7d85ede63c75495b12e981e365677/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/59ffc250e9e7d85ede63c75495b12e981e365677/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.41f77000.0","_nodeVersion":"10.23.0","_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","dist":{"integrity":"sha512-akZ+3RKp6HaDo12d4f56DczB5s9Cvoh5o5rxykyV3iQO/dmY3seY/scQzZimjLRa0R/wcr1MSDjhEPHx/y0eRA==","shasum":"e31feba51c17930ee62d0a39e125d7a968b0cdfa","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.41f77000.0.tgz","fileCount":13,"unpackedSize":203303,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf2/k5CRA9TVsSAnZWagAArHwQAIWOt4khMXpVXfa98JDm\nlbMohpUEgaxnRHMdhJLTqsiE5XAiDTci4hgWDer1yoY1N5yIyXU4ppYzdf2s\n9XBdvLtglaFrwaLEBtErIuJp9GWTJGOhwJh3mf0LKAMbrwMd++8dCZy1O0ob\ndz6NlHlF/o0qElXEnw8+9tAtI4Y88WN0YxRhHrgK3ATgqXDRCewJT21cGuBQ\nJuvJB5G0jJ9aYXVHQChgtVrggy7R0Wjf4feQLAKqrntmeUyl9fC958F4UT6h\nZvTbe7jCSSlN8HosBERDtDjmqdgV/C8PQAvxGtvPKA+ygIpXtmVxCrm/13i8\nqdT29YYUCINmLvOIzbdIX6XzU1RDkVXrWTxQYJTg/qcNWv8nd2dzj3NGcR6k\n2v1Po0ujDoAp+Fi5l+QWvg9bXfIMug1wnMFSgRQmrCHodPzx3Jh8ejeK6HrJ\n8xErEs7Y/vHjpdM3/FyIt32jPUKx/XJ0M21Q7SBy8cE2KupJmKqrHiJezNh5\njbZu94HoxbVKs1Qmd/7xMJdVt94UOYag48doPygWoGr9LYXFJG+/GHnV6PLO\nGIKVkbrUuP0p8IaO7CQsfm1vlyaOi4szlKaOSvAKl6rfQoD5GE7xAqZblr7G\n0GiazMszLafvqBtw1+wgJpY9I4WJqhgGosnr6j9nt0hT5LsSVL7MfXMnpyck\nnnpF\r\n=nzpO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC54qf52jgjcFzugEZrfqwlVvdwDPEsYsu5JGCb6qIpDAIhAN/VmEokRNefVHUKtcBNKOD3aQmEuo4U/maxGzc9sM5q"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.41f77000.0_1608251704787_0.5988509921320895"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.afe4079a.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.afe4079a.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=9.0.0-canary.30fdfd06e.0","@material/line-ripple":"=9.0.0-canary.30fdfd06e.0","@material/mwc-base":"0.21.0-canary.afe4079a.0","@material/mwc-floating-label":"0.21.0-canary.afe4079a.0","@material/mwc-line-ripple":"0.21.0-canary.afe4079a.0","@material/mwc-notched-outline":"0.21.0-canary.afe4079a.0","@material/textfield":"=9.0.0-canary.30fdfd06e.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.afe4079a.0","@material/notched-outline":"=9.0.0-canary.30fdfd06e.0","@material/ripple":"=9.0.0-canary.30fdfd06e.0","@material/shape":"=9.0.0-canary.30fdfd06e.0","@material/theme":"=9.0.0-canary.30fdfd06e.0"},"publishConfig":{"access":"public"},"gitHead":"aeb3539e673debaa2381e0aa7f186b95e91ee563","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/aeb3539e673debaa2381e0aa7f186b95e91ee563/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/aeb3539e673debaa2381e0aa7f186b95e91ee563/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/aeb3539e673debaa2381e0aa7f186b95e91ee563/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/aeb3539e673debaa2381e0aa7f186b95e91ee563/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/aeb3539e673debaa2381e0aa7f186b95e91ee563/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/aeb3539e673debaa2381e0aa7f186b95e91ee563/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/aeb3539e673debaa2381e0aa7f186b95e91ee563/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/aeb3539e673debaa2381e0aa7f186b95e91ee563/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.afe4079a.0","_nodeVersion":"10.23.0","_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","dist":{"integrity":"sha512-ljja2rar4P3X2b6Ou2Wki8Y4e6m2Lq5Wg7xhY0ItVVSR0AdHgfLF8zaeb07k0fpmEbN90VmZVeoJ+PA/z2622w==","shasum":"7537b9773bee89c4efa070b2fb393993c3c79587","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.afe4079a.0.tgz","fileCount":13,"unpackedSize":203303,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf4i9cCRA9TVsSAnZWagAAKjsP/1hQN1X6+uHjIO2Bikrv\n+v5eFSDOVvpS/AsML2aaopecT+0ry6H3Mfol0Z7xcEqTw5bkqKnOmYm4fYU+\nkDIzieyLG8T8HsvD1gEVm78k09OHbDPVu4BpJe5uxesWefOkACDQzMtOfASG\nRkEUah/XK52HqmVR03GrSTT22WX05RjUEec1tyYQf/mMTDmpW2aWgXY8jYUK\n5Mav6YHXBW+i/doWOqyDbhPD49PfdEn3XZcOpONX1Utp5iAEAS8EeJCmQOXO\nxx1Js0ZZhUys1a2kXR9YOsgfPHOtBuvfpwScOkN6A1TjsqZs34p6X8rrBxnz\nERGL963BbL0XEsVfW+QdfG+IV3CQPI0GleWrlfzomN5mbVCIymUgF/pUC3NT\nng7C3xrb83KkrWGZT932m/JN8nm7brcwAr1+05zQzPKPcwMONIQ12LojfMm1\nu1uqIs8szPiqQRAi0ub9Rg6kTSRF6mfQqvl0QIYPXZSAQYa6vmw8beZv99kH\nm3oT3F+faqDtETgwMivJV0+f117i7fa6CQHYXep5Hk5Lwc4O8JN1vi7DujDH\n5CditQQ7OtIkyvuT1xTO07W0tq8OQqYIHBCpRFEV3njEOz1s1FC7oGR2/Thq\nbMgGx9PeMuneH/5HJCFWtwsZC4p2Ehc4bGsJELL0IUJrJ3976IvwcE/1HB+r\no6u2\r\n=RF+m\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC8BXHTI44+ymsdSOCHMd9MCD88uJtabOiQr2cbD0BJLgIhAM3f3tzoBLbXbgInDVpQYWyiZHvC4hipf7dMvvQ2za/Q"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.afe4079a.0_1608658779648_0.8631273558915673"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.407ef8f9.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.407ef8f9.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=10.0.0-canary.671d72d95.0","@material/line-ripple":"=10.0.0-canary.671d72d95.0","@material/mwc-base":"0.21.0-canary.407ef8f9.0","@material/mwc-floating-label":"0.21.0-canary.407ef8f9.0","@material/mwc-line-ripple":"0.21.0-canary.407ef8f9.0","@material/mwc-notched-outline":"0.21.0-canary.407ef8f9.0","@material/textfield":"=10.0.0-canary.671d72d95.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.407ef8f9.0","@material/notched-outline":"=10.0.0-canary.671d72d95.0","@material/ripple":"=10.0.0-canary.671d72d95.0","@material/shape":"=10.0.0-canary.671d72d95.0","@material/theme":"=10.0.0-canary.671d72d95.0"},"publishConfig":{"access":"public"},"gitHead":"b600a06f2f54a052373cbcc038980333a8068672","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b600a06f2f54a052373cbcc038980333a8068672/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b600a06f2f54a052373cbcc038980333a8068672/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b600a06f2f54a052373cbcc038980333a8068672/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b600a06f2f54a052373cbcc038980333a8068672/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b600a06f2f54a052373cbcc038980333a8068672/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b600a06f2f54a052373cbcc038980333a8068672/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b600a06f2f54a052373cbcc038980333a8068672/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b600a06f2f54a052373cbcc038980333a8068672/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.407ef8f9.0","_nodeVersion":"10.23.0","_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","dist":{"integrity":"sha512-vFuNzmTiSAOha1LBqKzvmj7Pdox96PgZC5FkHPaMM00I1AjRlOolJJ0AqB14aOHwFmnzxp9KLnxhL0Li3Y9MJw==","shasum":"90592e39583d0c2cacca9652cf5387c03d7959ae","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.407ef8f9.0.tgz","fileCount":13,"unpackedSize":203310,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf7QcOCRA9TVsSAnZWagAAhFIP/2kYenrbOazofpAKCk+o\nZaq06/MZO+KOqsgeRkwLvXBaWpgntgtPWi144DkJg64bykoBv09Eqpu+OFTZ\nvjvbw0nmJMD3pIzQ6tzP1eXqDBazRs3MQH9mJvJ8hp6FB0AW2X+opFQoq9Gd\n7+xR99YTbfaBDImdPn4tOauLshYlCcg5Dkw0/OUFUhQKrqE2+S/SDxpC3dKp\n9II0JiuX264Q9GeEDPrbO0CJfSU1jqXNRiS3jRtsYClyY0GCCu2SzYw3XL8K\ngpQYopIQh9tNeakI4IPwlpVisyVaEIthaNmkY03sZTZ5jwJhq08P5sod4yLG\nLf+deNYDVjNqASUk1j0GCuXGurvpsdQ+aT1nQMgiRrceTdu5bee+7MljUgBC\nb4OWD2H37xHTy8VmOiCP1ddlTkN2B7ygLuY2oMNgXkDnutPrDY/AWhKatfaI\nxuZCGw8cphgwF2XpWfPc7CKOei4/Sm2ttUP47ZnUD350oUWqjdEEgBcv8bdE\n/mS48jhQRt/OAv3jNiCjt4EIA743YuF7kKoCIGZeZG3IQ15CVh/xe5Z9fVEt\nmM1OyV4osuUr520urKJMs1WQjK4UfmIJJcIRp5jGASNXlu5BL0cNCvW6OWcD\nww7rQ6eg3vJrt5Skm4OXLGaM1WYvCLOczOUjtnElx73Q/ogj1cnt87ftGDGQ\nsPUW\r\n=DZOB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC1CNAqKihBr4twbSt4Y0nWgGTnO9gCxIFG+jtiX73Q0wIhAPkKg5mT1mii1VETH6o17SQ42zOaJLGqnSdQBO2cdaIZ"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.407ef8f9.0_1609369358540_0.07791591155156685"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.2e26e137.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.2e26e137.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=10.0.0-canary.365c69360.0","@material/line-ripple":"=10.0.0-canary.365c69360.0","@material/mwc-base":"0.21.0-canary.2e26e137.0","@material/mwc-floating-label":"0.21.0-canary.2e26e137.0","@material/mwc-line-ripple":"0.21.0-canary.2e26e137.0","@material/mwc-notched-outline":"0.21.0-canary.2e26e137.0","@material/textfield":"=10.0.0-canary.365c69360.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.2e26e137.0","@material/notched-outline":"=10.0.0-canary.365c69360.0","@material/ripple":"=10.0.0-canary.365c69360.0","@material/shape":"=10.0.0-canary.365c69360.0","@material/theme":"=10.0.0-canary.365c69360.0"},"publishConfig":{"access":"public"},"gitHead":"cd3d92f8ebc04ae6cd6d286c7983e3028e380428","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cd3d92f8ebc04ae6cd6d286c7983e3028e380428/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cd3d92f8ebc04ae6cd6d286c7983e3028e380428/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cd3d92f8ebc04ae6cd6d286c7983e3028e380428/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cd3d92f8ebc04ae6cd6d286c7983e3028e380428/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cd3d92f8ebc04ae6cd6d286c7983e3028e380428/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cd3d92f8ebc04ae6cd6d286c7983e3028e380428/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cd3d92f8ebc04ae6cd6d286c7983e3028e380428/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cd3d92f8ebc04ae6cd6d286c7983e3028e380428/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.2e26e137.0","_nodeVersion":"10.23.0","_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","dist":{"integrity":"sha512-bmk5FZX3rM4Cj4QSB3wt4/w0AtxiXH1uTb8OxEK7sJGLsACgbrn0DKG9o5JijkO2GMP1X+jmLlbghel4qqfOig==","shasum":"866fa10e1288e3d666a2374d993965106d63c3c9","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.2e26e137.0.tgz","fileCount":13,"unpackedSize":203310,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf9LS6CRA9TVsSAnZWagAAWoMP/RUQZQS6Hu/BMNx1uckR\nbamfMPmBml1tioexeQdve3EkkzQLMqNIw+spYbo5o99vSYM0DppkYGaiUtgW\nTkhIi+Fpu2XzHx0esnlU5JTg9agKtLCsZhiw6xi7kG1OESgUGRo549fJQl/N\nZEMqVMWwp0acPtNC7xK89ZwPlSz7c4tu7vHh9fq4HgoOJx8edsIcMGgyuce2\nKLguZC2RoFGNR9tBjh4ZX2h4vl8hmwBVJqHRb4dQuTvIXA/fwTp9TBL1sEAV\n1W9NO/LXeH8sewwRlSyuva97MQqtqrA4DN0nRjH4wxYHbwheK+YtoGYgf795\nteHNfmSLYRZCVeAqQAYrXvROGbimzJdsjXb8mR+hv25RKoHaLBBaTZZ1j+pp\nWeXGpj37jlm7EBK8XnFlY04vALaSv5JK7OD93zw2SaEeyGhJea0V42RusiYo\nVJm/mPnFJes6LVXe9QNBScZdLiblQpm/cUBxd3JX3BiR4uxEAW2wPLN2d5V6\nbxKhGv0PRHwCZoDoodckQarsUoUG7mkvbB7j9rJvhDki6EE0ZlmjsXzRbVF0\nuyHbTpcnbiRY6QMC6a+nUPPO/OPu6VXEQZuue9YIAvSOxBJG54xIcvfcOt/H\n019qZ72EPOu/H4tK/UAr6HVeLyOfw2NwfwMmYukrgjKvpITremzRhLOGMq9b\nmb1E\r\n=GElR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDqcag1nRzxUiK9NsVh6Wimm3ZyeTx3BerdvabznllvSQIhAMcBjrKxk1H8XML+Qxtonv2UTdzJW6Acg4oyQN1t/kq3"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.2e26e137.0_1609872569698_0.024802632771939948"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.9009f6c1.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.9009f6c1.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=10.0.0-canary.abdd10065.0","@material/line-ripple":"=10.0.0-canary.abdd10065.0","@material/mwc-base":"0.21.0-canary.9009f6c1.0","@material/mwc-floating-label":"0.21.0-canary.9009f6c1.0","@material/mwc-line-ripple":"0.21.0-canary.9009f6c1.0","@material/mwc-notched-outline":"0.21.0-canary.9009f6c1.0","@material/textfield":"=10.0.0-canary.abdd10065.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.9009f6c1.0","@material/notched-outline":"=10.0.0-canary.abdd10065.0","@material/ripple":"=10.0.0-canary.abdd10065.0","@material/shape":"=10.0.0-canary.abdd10065.0","@material/theme":"=10.0.0-canary.abdd10065.0"},"publishConfig":{"access":"public"},"gitHead":"d6f3ffc9298b3af3985946aa3bdd75c862b5d8c3","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d6f3ffc9298b3af3985946aa3bdd75c862b5d8c3/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d6f3ffc9298b3af3985946aa3bdd75c862b5d8c3/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d6f3ffc9298b3af3985946aa3bdd75c862b5d8c3/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d6f3ffc9298b3af3985946aa3bdd75c862b5d8c3/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d6f3ffc9298b3af3985946aa3bdd75c862b5d8c3/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d6f3ffc9298b3af3985946aa3bdd75c862b5d8c3/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d6f3ffc9298b3af3985946aa3bdd75c862b5d8c3/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d6f3ffc9298b3af3985946aa3bdd75c862b5d8c3/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.9009f6c1.0","_nodeVersion":"10.23.0","_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","dist":{"integrity":"sha512-2mcOgRYVMOIBsNalZFvriLTZmJGHJooz3edU3gSDOhQhe3noaXStg0COUDGA5FbYvMYt+AprmUhxKER+2A9nmg==","shasum":"89f6b3fb8b5c222c4cd5ceef57ecef311f89b39a","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.9009f6c1.0.tgz","fileCount":13,"unpackedSize":203310,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf+LhmCRA9TVsSAnZWagAA04IP+QA7d+K5dWdBiLgKSk0q\nGQQMY/0X9JSJ+oiEiy+3jQoqu8QIvNkbRT7Er1yT0NhMCd+9F7kFIpXq8EHx\nA+D86l/RoGq6kl7QYr9/lLYWigciXkuXGOh0r5vi0dl3aBmGdre9wdyILyZc\nCk7K5kRIRkZkA/Fottgz87dlyApfq1CairU2dbrY8+5L38cfDuZsuFUwFror\nXlHASWY3B2BRrAxoGnYhUOS0zeWUVYgEBts4xee3gd9p65BedFgqpPBZp6Uj\njzc3GMC2mkjOaj5RRxIFUTygYEpb1wPXERgi/ALgIgdhGnOOFm+z2PY84AuP\nOHzDIKblLkLYRpSyolwbIiaNAuC7zjY4lAxWyJqyyLg4fFXFYgxfhLqBwPUd\nwJbKtynJA/w1hY1xyiTbSoOQ/mpRZKujgLaiTFShGWhWJvEayspkGISDyAVo\n353GzwmsBPLiq/DULoif+0XA5AOWQ+GVrxhOriY3F5BaO7QL997VDPbuFGHT\n4CI8mSsrNZQZNkWF02XYX+c5tkShcZX0Y9RXlC+Z8/st5Eu5PIOnnbDOo3sX\nhHP7O2Q+/vVb2u+MHSr5KG7xEF3RL6iTxnsYcswnYyItD7fUo3mBaIUYHxx4\ngq2HHmtqgdeCuCdbCZusLjIhSDtngQjtsfNJnMBipmfYObhHCpu+IjadsJ/x\nlZp2\r\n=NasI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC/k/W9SigoW6gP9fpdG25vHSIC1BM0XQfqdQAVWCdgiQIgGG3Wkz0cDkGtXB2yQ8HO213AkMRktteiR08lDHzLv/s="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.9009f6c1.0_1610135654331_0.6634523425402024"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.ee99b646.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.ee99b646.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=10.0.0-canary.b8a1a58e4.0","@material/line-ripple":"=10.0.0-canary.b8a1a58e4.0","@material/mwc-base":"0.21.0-canary.ee99b646.0","@material/mwc-floating-label":"0.21.0-canary.ee99b646.0","@material/mwc-line-ripple":"0.21.0-canary.ee99b646.0","@material/mwc-notched-outline":"0.21.0-canary.ee99b646.0","@material/textfield":"=10.0.0-canary.b8a1a58e4.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.ee99b646.0","@material/notched-outline":"=10.0.0-canary.b8a1a58e4.0","@material/ripple":"=10.0.0-canary.b8a1a58e4.0","@material/shape":"=10.0.0-canary.b8a1a58e4.0","@material/theme":"=10.0.0-canary.b8a1a58e4.0"},"publishConfig":{"access":"public"},"gitHead":"e3bf8197782f6099f32f339bdbc9218093828cdf","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e3bf8197782f6099f32f339bdbc9218093828cdf/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e3bf8197782f6099f32f339bdbc9218093828cdf/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e3bf8197782f6099f32f339bdbc9218093828cdf/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e3bf8197782f6099f32f339bdbc9218093828cdf/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e3bf8197782f6099f32f339bdbc9218093828cdf/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e3bf8197782f6099f32f339bdbc9218093828cdf/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e3bf8197782f6099f32f339bdbc9218093828cdf/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e3bf8197782f6099f32f339bdbc9218093828cdf/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.ee99b646.0","_nodeVersion":"10.23.0","_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","dist":{"integrity":"sha512-toYy6leq2jY/h5YNhj3jAGJjwYFpbHFcyFCA6NGKIUZSXKQE3E12knR9ThzPYSoCSfpTXetzjt2hHL2W/qlaPA==","shasum":"1a79f120c96f7a750ebba009d09dabdbcf6afdf4","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.ee99b646.0.tgz","fileCount":13,"unpackedSize":203310,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/NpVCRA9TVsSAnZWagAA1bUQAJy8aCkIDBnhrpHZoGVU\ntqb1lYNsgG8aJz+DcnXr6cBW4UxjLmAMWYGlKP++9fVysgP3klvDihrKOGO7\n8C+Vq/7QUH6DudI9TlkL3uSTIRkvKSgTmG6Lwv+HG+aSehqix8faIC15e7nL\nnZ4byRnONjvBTjhYf86DmsofYkSzjxvubYif+9IoH4b4cV19S3oYMOF6pbdU\nmL/awNMY3kgbKBF2VtV17SvluUGuys+nscz5ZyZlkzKeITcQ/Ki5J+Dh1G9G\no9wO0Xlueh+lss4Pz2CvVkBZKC1RfmX4TicJJF+AFfogrvRH+go+FCeDfGIq\n+ZW1o4w/uJU3LFfIquTo50L6erNzQc1YUsAJRrKjGg6OuIAPXzFlpm5eA0BI\nI2bb4aas+fc/2DeN50+TK2ma7Tci6lEBmRM8EaTjOIK/6CZs2GLE2+XcxXqi\n/poO8r+7szNXQBlhawxft5r7B2m9XmysiljecsHOgH6x4aNMw77x1JMpmhdo\nySTPk2y0T0gV/84S55YfVBKUGrAMqJYohptWE5HDSuknKR4bADo3E3tDmgIZ\noSk0uDoCsREB1vAVoUjrV0hDHgZGgeuJ2BT8FOuOGx62lo/qMr65cU0HtDrC\nFAQz9qq1lPjizTqJqNT/qR9gvPKr5dmnbqRKjCPrtbKajfiftxDvn/BaCtu4\nGfP4\r\n=WQP7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC0ozJ3Qqjn5MfGdIJNDBfgzpn/UGIz9fAA2UEu8WoRKAIgUgnZIn8jO3lq9YjlGmK2u+I6JDMJckX1BU42TACfCQ0="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.ee99b646.0_1610406485198_0.8362954320160771"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.740ed33b.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.740ed33b.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=10.0.0-canary.7584267ff.0","@material/line-ripple":"=10.0.0-canary.7584267ff.0","@material/mwc-base":"0.21.0-canary.740ed33b.0","@material/mwc-floating-label":"0.21.0-canary.740ed33b.0","@material/mwc-line-ripple":"0.21.0-canary.740ed33b.0","@material/mwc-notched-outline":"0.21.0-canary.740ed33b.0","@material/textfield":"=10.0.0-canary.7584267ff.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.740ed33b.0","@material/notched-outline":"=10.0.0-canary.7584267ff.0","@material/ripple":"=10.0.0-canary.7584267ff.0","@material/shape":"=10.0.0-canary.7584267ff.0","@material/theme":"=10.0.0-canary.7584267ff.0"},"publishConfig":{"access":"public"},"gitHead":"fabdf055e5efb9cfb69ee02c46f968eb33e417e2","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/fabdf055e5efb9cfb69ee02c46f968eb33e417e2/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/fabdf055e5efb9cfb69ee02c46f968eb33e417e2/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/fabdf055e5efb9cfb69ee02c46f968eb33e417e2/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/fabdf055e5efb9cfb69ee02c46f968eb33e417e2/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/fabdf055e5efb9cfb69ee02c46f968eb33e417e2/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/fabdf055e5efb9cfb69ee02c46f968eb33e417e2/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/fabdf055e5efb9cfb69ee02c46f968eb33e417e2/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/fabdf055e5efb9cfb69ee02c46f968eb33e417e2/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.740ed33b.0","_nodeVersion":"10.23.0","_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","dist":{"integrity":"sha512-HWzr30qHwqjiG3ynMKjI1f2s+omtiWKsoAXXi+mcZ5Jq62ZIs1hXmaA7KVy+OiAiw6EXkx+9siN4lqcMjrYteA==","shasum":"263d4ce7a5ef913d64e090b7c1c991f337f186e3","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.740ed33b.0.tgz","fileCount":13,"unpackedSize":203310,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/eSSCRA9TVsSAnZWagAAIwcQAILJv38dJDtb8TCaSt3u\nUk+HHQ1FPrqFHlCnp1JUe8cLye0f0fif1vKp3L826Puy+k2V1I/HnyA+UJMS\nJmVdsrjdcY4JwkseBi1Q8i0Yuwak+Cm+tUmM342gXXdIP3mD+N1ujyrcwVFO\nxtoSZbtpVYNpX92fbuH1qCIwq/d3mJFIBGBVTpu+ckhq0xeuCcVjA6jDd9aQ\nVpyWRIFwn0JN0ppTtQhj3jJJkRBr4GGoyaDvZ86s353DdZDtXsRx7bt7oifO\nfNRGhagCiD6ZcWXqqvFYSaJOIWVMsZDFwXRNdYXILKey3y6jAYsw16BXJBd2\npao9lJOrnBweAFuucR/rueU8Cc7ZiVJoj5RXvYDMIJTl3eqZCriGeC9XGnRk\nS+Q06J8dcHQ1m40eFJCJIfvu/LTAmN6U24XQvE6RdAahc72TH5Kx2YRMlL8Z\nW48PED4ACUpZgBQrpbZ+U978l882/Aovsc919SwMrWqedNY8HKP2PSds4ZlA\ndoh3wBFGyF9m5SMSWUUYpUwGplEQWp54FXhMsTeCqQwIJFujkAR4+kZ34WH8\nnjOvhqkhBk8x5kmqcD4swFZ3qRWbXnO1Be/dWXgvMmarlAhosWE16VyiQWLL\nHMhsHELs921kHeyM1CF1QwaqsmXMxaBDiNEw1E9ATC4oa6AlBTaKMKeTKxNp\n5eD8\r\n=kEA+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAlo1iQuRrN5iv5PsQvvIOAU2MW42uHkDq2wzxeMSHTTAiBH3hYGUQB8VKIQ5W+LHmNrlYwnoins3ORMFrP0vFis+g=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.740ed33b.0_1610474642188_0.6840501570049016"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.c5c541b1.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.c5c541b1.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=10.0.0-canary.7584267ff.0","@material/line-ripple":"=10.0.0-canary.7584267ff.0","@material/mwc-base":"0.21.0-canary.c5c541b1.0","@material/mwc-floating-label":"0.21.0-canary.c5c541b1.0","@material/mwc-line-ripple":"0.21.0-canary.c5c541b1.0","@material/mwc-notched-outline":"0.21.0-canary.c5c541b1.0","@material/textfield":"=10.0.0-canary.7584267ff.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.c5c541b1.0","@material/notched-outline":"=10.0.0-canary.7584267ff.0","@material/ripple":"=10.0.0-canary.7584267ff.0","@material/shape":"=10.0.0-canary.7584267ff.0","@material/theme":"=10.0.0-canary.7584267ff.0"},"publishConfig":{"access":"public"},"gitHead":"2845f0e85b6a37bbfaf5110a5f16284cc8fda6ef","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2845f0e85b6a37bbfaf5110a5f16284cc8fda6ef/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2845f0e85b6a37bbfaf5110a5f16284cc8fda6ef/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2845f0e85b6a37bbfaf5110a5f16284cc8fda6ef/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2845f0e85b6a37bbfaf5110a5f16284cc8fda6ef/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2845f0e85b6a37bbfaf5110a5f16284cc8fda6ef/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2845f0e85b6a37bbfaf5110a5f16284cc8fda6ef/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2845f0e85b6a37bbfaf5110a5f16284cc8fda6ef/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2845f0e85b6a37bbfaf5110a5f16284cc8fda6ef/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.c5c541b1.0","_nodeVersion":"10.23.0","_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","dist":{"integrity":"sha512-3UxTmO86YIepJoFJQH9uBUr9yXGKFzn1F476V+SBU3Ig9+EA4gU5H9obI8h829paF6rI+clFkhthcQT3G+Qt8w==","shasum":"a46b4b4917fec82b718f7c7754f871aee9408d58","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.c5c541b1.0.tgz","fileCount":13,"unpackedSize":203310,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/e5GCRA9TVsSAnZWagAAWz0QAIkIPBL8wzCoxSGJZAf4\nPqZs7cegezenwJ8/3k/j1Pc0HUEhbldcD+QdCM81Ud9Wv1NPCF+nvJitvRDj\ny4E5Wx8Hpi/LoShZwhU8ClFcRpuwXTFrOkcvWqe1yiXDqkPIHM6lgYwA5OGa\nAsUUc7S3or6Qm04OlCZRXur3dZMIX8z1KCf/9Z3imvHCmFQfwLPJ9x8KxPjc\nUR6Jol2b4jGm2rsVp1lzu13QwMDqIwXj78ZB8ZVuOfKrn9uBcay7y2tePkI3\nXNyX4s3sWBMBI2y9hPjTRiEIH0U8XxbUHLW7eLmQccYPHPzxzy6ZL+B0p++x\nIjWAYFebDL7+2f9V1L6T+OmX6jdZBjKdxyqqjmgxP4Ig+EIvqGUKgFW0cMNk\nHEJa26Rnb6C6QWyt1oz8JQKOHs9bR64m08r4MqYuB7iZpiJwXn34uvjDJYdX\ngDleTpMXqn3IokaTycZUId/RSPTKyT2A1fTWgrrYKcXCQ4iSFWLvDAjf6zmj\nmY1wAEgaYK+TpCrO1NL3MBJD+tQKVPKajo0o+4hHeZxfGiQJ3c1LmwpBoFKh\nuRacOimlzX4aY/GtdPNInfPAqceDDb8sHdaz+A68O0f+EyXTfTt8AgGG90pg\nCXOtNom3oFEkcXFZWxUoz26A0VUIAaKKgLwjrZ+vGpNfb1WvMyiTU+BwHXiy\neTiW\r\n=Lc97\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCKwuHIAoEPJB6BkojZpDTX8qwV11INHJguU2x024j4LQIgeGBcmn9jxq7LJVOuSeydS6q85D5BxjMd6Q9O46DkHiA="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.c5c541b1.0_1610477126002_0.4275527938761414"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.06fe9d90.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.06fe9d90.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=10.0.0-canary.7584267ff.0","@material/line-ripple":"=10.0.0-canary.7584267ff.0","@material/mwc-base":"0.21.0-canary.06fe9d90.0","@material/mwc-floating-label":"0.21.0-canary.06fe9d90.0","@material/mwc-line-ripple":"0.21.0-canary.06fe9d90.0","@material/mwc-notched-outline":"0.21.0-canary.06fe9d90.0","@material/textfield":"=10.0.0-canary.7584267ff.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.06fe9d90.0","@material/notched-outline":"=10.0.0-canary.7584267ff.0","@material/ripple":"=10.0.0-canary.7584267ff.0","@material/shape":"=10.0.0-canary.7584267ff.0","@material/theme":"=10.0.0-canary.7584267ff.0"},"publishConfig":{"access":"public"},"gitHead":"99a3aeb2c1659185c9597a59e5dc7599bbfd52bd","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/99a3aeb2c1659185c9597a59e5dc7599bbfd52bd/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/99a3aeb2c1659185c9597a59e5dc7599bbfd52bd/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/99a3aeb2c1659185c9597a59e5dc7599bbfd52bd/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/99a3aeb2c1659185c9597a59e5dc7599bbfd52bd/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/99a3aeb2c1659185c9597a59e5dc7599bbfd52bd/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/99a3aeb2c1659185c9597a59e5dc7599bbfd52bd/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/99a3aeb2c1659185c9597a59e5dc7599bbfd52bd/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/99a3aeb2c1659185c9597a59e5dc7599bbfd52bd/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.06fe9d90.0","_nodeVersion":"10.23.0","_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","dist":{"integrity":"sha512-llLPITzL8W4dkpS9S1hzoBwZDGKRlZwQK3s23HFysl8iaI9Xz9erTbJvDHmCeJGn+VHMqA5s8yb+sab1XLwaXQ==","shasum":"7ecad384532ce7e68ce3895c964307824df5716e","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.06fe9d90.0.tgz","fileCount":13,"unpackedSize":203310,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/gygCRA9TVsSAnZWagAAqXsP/3yNvO5n5QwcUuFar74j\nuRaLYQAQQXSTZYvaA+5er3O8rHVz4jR65Frs3nzpEbZZfqNatstN8Brc1R7n\nOM7vOrssTQCZMhHOB+eIX3wttvzk7UecRU7bc5x+tt0VKJJKaNDpSzGePPKI\nMSUfEgenaJMbrWUEXtI1Sdzowh3/gcuNYkwW/Pc2lPB+taCYtEHJDJs/0AfZ\n7wTOvRkPtwDLz6jHfrcZUUbCn+4MYPrrHa0051oO2diTmipqtluQ3LMwBtme\n1L8Irwc9oHmxurrw7rBTJ6mFiBB5KmIDrUbGV65SI09SHwG34x9v0iQENFaI\nFIODLBiJaIhfWdHvcDN8N6gDQ9orWA8pA+XgFccldDaM8iER5DE6wqIALFFs\nxYEFbuVHOtkfi3M0VukWcPFfJXMM9z4dqNwYiDOGV1eHZfqdKxMnkZ2G1W0u\n0hbBzok2iV0rHJNLCFYEywJ0HwUMIH8SAgtnCz+WvR7Fku9pyNdNczSfmIfZ\nf0pZ2JtFwsxxTEB+r0BVvbPac78fu7tJOEThO9uYO5WeKBEF1ZjukCoWYnIO\nDAfMIwhbi6Hjn763m5DEAXcrA3ytH308hc8CgZ5aNf1G1QsJHYnJdBGPTLJ+\ngtlX7RsUBfTxu2O/f3QMRT5ev624TdtCUJNrhDb0EK7LUtANP0Tn7k8bxmZg\ntef6\r\n=50aB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCeiBN7p2KIgRJG7sReyKvmam0wDofJgunYiG4c6ucq9gIgCkYD4OTMuYLDZOZ4pAalP0hBpfufqV9iqtPlE3/ASt0="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.06fe9d90.0_1610484895920_0.22956918175321883"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.269eed01.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.269eed01.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=10.0.0-canary.7584267ff.0","@material/line-ripple":"=10.0.0-canary.7584267ff.0","@material/mwc-base":"0.21.0-canary.269eed01.0","@material/mwc-floating-label":"0.21.0-canary.269eed01.0","@material/mwc-line-ripple":"0.21.0-canary.269eed01.0","@material/mwc-notched-outline":"0.21.0-canary.269eed01.0","@material/textfield":"=10.0.0-canary.7584267ff.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.269eed01.0","@material/notched-outline":"=10.0.0-canary.7584267ff.0","@material/ripple":"=10.0.0-canary.7584267ff.0","@material/shape":"=10.0.0-canary.7584267ff.0","@material/theme":"=10.0.0-canary.7584267ff.0"},"publishConfig":{"access":"public"},"gitHead":"537a9df54fcb929f413d5ba5af0dacf0e2654c82","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/537a9df54fcb929f413d5ba5af0dacf0e2654c82/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/537a9df54fcb929f413d5ba5af0dacf0e2654c82/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/537a9df54fcb929f413d5ba5af0dacf0e2654c82/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/537a9df54fcb929f413d5ba5af0dacf0e2654c82/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/537a9df54fcb929f413d5ba5af0dacf0e2654c82/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/537a9df54fcb929f413d5ba5af0dacf0e2654c82/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/537a9df54fcb929f413d5ba5af0dacf0e2654c82/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/537a9df54fcb929f413d5ba5af0dacf0e2654c82/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.269eed01.0","_nodeVersion":"10.23.0","_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","dist":{"integrity":"sha512-2uEoVZlyOZWau0ldjMGJbPynUp8CTUOYB8No2Bg43RYVtMmv0sfh+l2T1OLykXDEGmMFHKFuJdM+Iu70W0oCWQ==","shasum":"dce16ec715431c332d2d7066ee9a09521636cdc1","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.269eed01.0.tgz","fileCount":13,"unpackedSize":203310,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/2nkCRA9TVsSAnZWagAAYeoQAKRLuxMOo4KSaY907iUZ\n++EbBGZzBGTaEbM+e/vev2nnVK65YtnKYoSCZMHWsmC8UYmUl6chfLr1K+5T\nwlPy1HR21Cic7VhomIofLrNRfebVNJYDy45B+LkQRaIA6ACywG+buy3Jpcil\nyhDAyyVofOsjIGFb5Y9Uk3Jv9cpUlhqDauzHQoS70Y9/E2gibCpcslepT5th\npSiu0Z14XLCazjZkK7+XLsNQli5SmvMunPuqbwPfgJQbgGbDk+rdIwp+LhbJ\n0XxSr/TqiAhpKgWPViypYkLPVBeU0Yqufeug7ylHa/ooWufMhHRPmA7aNW+G\nksmWfWAn4Hy/Yh7eHMtvz9zu6znjjcshkQnK/UZFjZNBL4tdypgbPcdc6Eqr\nO+oYUEVoIOTvcxET+LYrk45oabFRcQiezaeg4LUoUm2WfjXX/9gS99773oF8\nQ4iA452JlLfFoWTj2LSFaZl7p3MvGQMYTq8K1IXtqkJ8berqclmI1lab9EGI\nZq8sxK+T8QonpcJegF0ti9ASY5dcuu3Y+c6I0Wusm2ztOH/MFqoFeb9bq5T/\ni5QlOpmoi3xhT8n7hXpbJGpIC+t7To5oUwPQzAqo6s2fb+iqN1rh5JjInhUB\nBQT69Dl5koHb3MN3ZW8X7WMK7JqMYmeolbEJk/NK9ncpNcnD3se7zh7ljaNb\n2bdK\r\n=vcej\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC9loUgoukmVIWVSMv2oTeTlebb2MXXLt8AMJO22ow9AQIhAOKs45V4va2SCBnQIW77LFqprYHN7iw9kHc3WxcZoWpo"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.269eed01.0_1610574308333_0.6000662952676425"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.8c075f35.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.8c075f35.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=10.0.0-canary.7584267ff.0","@material/line-ripple":"=10.0.0-canary.7584267ff.0","@material/mwc-base":"0.21.0-canary.8c075f35.0","@material/mwc-floating-label":"0.21.0-canary.8c075f35.0","@material/mwc-line-ripple":"0.21.0-canary.8c075f35.0","@material/mwc-notched-outline":"0.21.0-canary.8c075f35.0","@material/textfield":"=10.0.0-canary.7584267ff.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.8c075f35.0","@material/notched-outline":"=10.0.0-canary.7584267ff.0","@material/ripple":"=10.0.0-canary.7584267ff.0","@material/shape":"=10.0.0-canary.7584267ff.0","@material/theme":"=10.0.0-canary.7584267ff.0"},"publishConfig":{"access":"public"},"gitHead":"8757321e04ca4329877d8b8c9924f78bd58ccaab","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8757321e04ca4329877d8b8c9924f78bd58ccaab/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8757321e04ca4329877d8b8c9924f78bd58ccaab/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8757321e04ca4329877d8b8c9924f78bd58ccaab/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8757321e04ca4329877d8b8c9924f78bd58ccaab/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8757321e04ca4329877d8b8c9924f78bd58ccaab/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8757321e04ca4329877d8b8c9924f78bd58ccaab/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8757321e04ca4329877d8b8c9924f78bd58ccaab/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8757321e04ca4329877d8b8c9924f78bd58ccaab/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.8c075f35.0","_nodeVersion":"10.23.0","_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","dist":{"integrity":"sha512-jfnw3kdUI2xq3uuXZ82sQrj0gA3ArFQ9U23ofJKxscTj2kJt+Z/IeSUyUcGeivMW3v28+Bk1akpSN0+hBtVBdg==","shasum":"c247b779d68efadd74b0abb60440fd5464ef2c27","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.8c075f35.0.tgz","fileCount":13,"unpackedSize":203310,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/30OCRA9TVsSAnZWagAAYM4QAIsSFTg3qmOV+aEGNDkN\nl3ueZXe7MsIQ3M5Xf4K+C0+GD4eNBS47mLNDTCH7hejvXfbz+NqdTXtZVBPv\nd7vDTPqtKz5mSzJJXOqgqUob2D4OojSRw5n+EB1kX1ukr/Ig0MGm2BGE5/YL\ndvEHuSXhUzJ1XQBsmIZ/pVcDDUbUpeZlzAwBbt8xe0IOcd5xqEdwFugBQumZ\nc5SKheTNr8THwzh8pF2aKQ6Xfht/CfR0hpRYUqUWWNfu5D1/k6EE1A+bRbGL\nnxfg62ilRxr66hQwMgnkfZNy+rIF1Oor0bnWClYVkqsMofS97tyjU8Vjmi7o\npDO3mXKSLBFH2b2KYWjkBdUE82umVGGPuy2fWPvwRMHQxLv/pmFzOZF6NhIh\n9P0KTB8lhLFH/AMsf3TrDpjHzdph5+YHWQOH6J8kQrWazsgdxPk7RTI9GFDg\n8lfqGtInJ7TQPf3GDWFGo6okhHXkUcwYbeNgX6laz8xrLGONip8qnf/48ar9\nneOMCxGRPR44l3fSbkhpBaeZkAlGcxXEzX91tGrSjkEwV4iO0B8ofTZuCrBo\nJ8UfLoGdj7lvvLDxItVYtFfUl73eVwBiaYpkV5ivq+4ZMiXxpxwQr/McB99n\nyNVfUEnphJo6CEZBubWVzHrlIyw+xw5I5v0A+f+mym+ZrWDEPK1yMA3sih7F\nRGMV\r\n=urt2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGWHM0yqIvyd/Zfy5CNqhHv6cy6+MrpzszF/UmnZd3KcAiAr1BcsKl8bwJGslnhiOcpSqMZXtd1Qh6nKIcqyC1O2ag=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.8c075f35.0_1610579213981_0.5602366546052837"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.3cda381b.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.3cda381b.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=10.0.0-canary.7584267ff.0","@material/line-ripple":"=10.0.0-canary.7584267ff.0","@material/mwc-base":"0.21.0-canary.3cda381b.0","@material/mwc-floating-label":"0.21.0-canary.3cda381b.0","@material/mwc-line-ripple":"0.21.0-canary.3cda381b.0","@material/mwc-notched-outline":"0.21.0-canary.3cda381b.0","@material/textfield":"=10.0.0-canary.7584267ff.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.3cda381b.0","@material/notched-outline":"=10.0.0-canary.7584267ff.0","@material/ripple":"=10.0.0-canary.7584267ff.0","@material/shape":"=10.0.0-canary.7584267ff.0","@material/theme":"=10.0.0-canary.7584267ff.0"},"publishConfig":{"access":"public"},"gitHead":"d660dc72de8b9d23247ab075b6f4f44053c9cb70","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d660dc72de8b9d23247ab075b6f4f44053c9cb70/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d660dc72de8b9d23247ab075b6f4f44053c9cb70/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d660dc72de8b9d23247ab075b6f4f44053c9cb70/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d660dc72de8b9d23247ab075b6f4f44053c9cb70/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d660dc72de8b9d23247ab075b6f4f44053c9cb70/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d660dc72de8b9d23247ab075b6f4f44053c9cb70/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d660dc72de8b9d23247ab075b6f4f44053c9cb70/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d660dc72de8b9d23247ab075b6f4f44053c9cb70/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.3cda381b.0","_nodeVersion":"10.23.0","_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","dist":{"integrity":"sha512-FcPVHPAtgBs2thS6WcCpXQL+suf0fFTGOQe9J5oMZU6rQwXKChbJdCGVGdfQuCRs6c6JFGdCWwqEh5qKQpBrhg==","shasum":"3b0a9ed013736469699f05e40261c7a5e49f2a0d","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.3cda381b.0.tgz","fileCount":13,"unpackedSize":203310,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/4qNCRA9TVsSAnZWagAAuzQP/35iQwhdMRfc8Oc+4mhu\nvpCeBM+CBPg25W3FG/WP7ko9i95T13M9yEH/tmr2pv4gv/ngjE6hyEMebBHy\nMR4NL+8zZBN7sstlArgRnDRSHJys7VXsDBorvCNtTf6lN/FxoMAvKSAFCqa1\nKqlSdoNGrYo/lLb7Ch3pk9uJM+lTwINh2Lw4o8RU1QGPPZkzrWvemZKTWDVn\nKrPUcD6kxowtsJ7L1Hf5ciY0Irk+hIG0bh0x3UeKalSA+xvALFa28fqwabiK\nfhCvmDvoMgKWeNLtCkRdyt4Ihm2OlIVAI5poRZcCUr/ciOogghP/44YFiNso\n03ZkZaeUQOxS/9bq9tecqRp1ZN/OkNQPHfTOJ3e9kpSkz/YcYvNsEyotbmeL\nx91I29bJ+YfpkVbpoopprTr/D+tCeYrq6kbpTGMPn5hLLWSfPDgDJLkIQjJw\nqTqr5r7C8vXYSrwGtW9a/ARKPtiacCmX2ad9QXkTS8ub3XBw04jLxLocjD+/\ncrlzGJjIG6V4+GfcJh6oahHJ/PsHTu8S8IwGZ1BIYtX/eAcDTHlkH6tO/I/H\n5G4GKS/eOG1YlkMPYSXk24ahw5uN2VZjwU0FO07zYu1Uyg14D5B18FLxOAnZ\nCG8PDwMHz1jcqiwwGB2ukxUscCilKz/xYJ9ncILaNV+ihhfiNHcNa9Ty7hfW\n/jF5\r\n=/DLf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDOAQDhWqIoDmAMMfMaEQI7rKLweEbGjOI1NzzBdji6JAiBw9bd3qTAorz87mVzpl23eomf6kob10XWbX8aNLIRKoQ=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.3cda381b.0_1610582669331_0.623314888072052"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.bc113605.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.bc113605.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=10.0.0-canary.772cc1068.0","@material/line-ripple":"=10.0.0-canary.772cc1068.0","@material/mwc-base":"0.21.0-canary.bc113605.0","@material/mwc-floating-label":"0.21.0-canary.bc113605.0","@material/mwc-line-ripple":"0.21.0-canary.bc113605.0","@material/mwc-notched-outline":"0.21.0-canary.bc113605.0","@material/textfield":"=10.0.0-canary.772cc1068.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.bc113605.0","@material/notched-outline":"=10.0.0-canary.772cc1068.0","@material/ripple":"=10.0.0-canary.772cc1068.0","@material/shape":"=10.0.0-canary.772cc1068.0","@material/theme":"=10.0.0-canary.772cc1068.0"},"publishConfig":{"access":"public"},"gitHead":"ec7a00c7b7cf2145c971f64e88b375c09a5409af","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ec7a00c7b7cf2145c971f64e88b375c09a5409af/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ec7a00c7b7cf2145c971f64e88b375c09a5409af/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ec7a00c7b7cf2145c971f64e88b375c09a5409af/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ec7a00c7b7cf2145c971f64e88b375c09a5409af/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ec7a00c7b7cf2145c971f64e88b375c09a5409af/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ec7a00c7b7cf2145c971f64e88b375c09a5409af/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ec7a00c7b7cf2145c971f64e88b375c09a5409af/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ec7a00c7b7cf2145c971f64e88b375c09a5409af/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.bc113605.0","_nodeVersion":"10.23.0","_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","dist":{"integrity":"sha512-Cys/oaxjTWUn04jJSeGcgtaJNEzYyt8MPZOETd6Qz+A8fNM/dSSffULrREnplwIdq3yiMxika/j4K7m+lfuYfg==","shasum":"20693e5dcfd57466990da3028dcc66f8f5b5b140","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.bc113605.0.tgz","fileCount":13,"unpackedSize":203310,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/5QyCRA9TVsSAnZWagAAIFcP/0mYPM50AU++9SJYIBtG\nagVgvEu/Izhh2MJHtgV+Q8wFrNilbIiCfd7CLC4NsdiMAqNCRI679pBa4p6F\nN8wNRqYwZgVI3jehs0bk8OnTGy3Um+k+U9q3M7TYFjyMqo0OZ9oiWobMFBC0\na3JaEhXCeNub68B5h2kUyfcM37Zmv3b1WWaG5KLIFDo4Tj3yahsNSowR0D/p\ndGKCBnDvabCxv3Yxtlll/5Um84Ic+3pp5CVX/ZDimlEH38p8aamRC5DGY+OO\n2EddVgqoZJ8oSgFt3ZVkIF77K+7/thME1MyOhDulxIF9Bd8Egx4c4XD6exqN\nhjbRVCd93XXJv0EUDJJK+DGpiVidhWyJb3+quVypySOd8igsgVIBRhSruCBE\nNRUWGssI8R8BJb18A91G33MLvGNOb6RtgsCTPbipwewhMp+HojnOlIP7s0Hh\nu6moxA+FBwXYFWEbRv49XyoRupg2+Emxng4t8E9ddygtErzsXd3tFqc1cdFN\nNk2qjr0VU3ZZO8UpMO6GqmTRJfXLaWxtJgcllz8MbMQkwmTP/DvTmsauiYzc\nW2FUtOkiGI7RM312NiAE3gKD7Hb593V5YUhzE9R5UmQVX/LlronhP7jYIULW\niPdbkUwj16PbtzhwtQno/Kpsv7DFavUU6TtQBesKC83MNgbnGFdS2Ki+Ayhy\nvkym\r\n=yGWn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICiS0t7MrzMhrgVsRwTFSxQ/Jn66QgIWQkyiuQtQaBGpAiEA+Zg3bqXEE3vbAL9E+4MKb+8ojyfUIeS3ttaPd02t884="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.bc113605.0_1610585138080_0.8825451118160497"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.0c1d6ff9.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.0c1d6ff9.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=10.0.0-canary.772cc1068.0","@material/line-ripple":"=10.0.0-canary.772cc1068.0","@material/mwc-base":"0.21.0-canary.0c1d6ff9.0","@material/mwc-floating-label":"0.21.0-canary.0c1d6ff9.0","@material/mwc-line-ripple":"0.21.0-canary.0c1d6ff9.0","@material/mwc-notched-outline":"0.21.0-canary.0c1d6ff9.0","@material/textfield":"=10.0.0-canary.772cc1068.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.0c1d6ff9.0","@material/notched-outline":"=10.0.0-canary.772cc1068.0","@material/ripple":"=10.0.0-canary.772cc1068.0","@material/shape":"=10.0.0-canary.772cc1068.0","@material/theme":"=10.0.0-canary.772cc1068.0"},"publishConfig":{"access":"public"},"gitHead":"5c7f60619e642de2f6951662670ef490a6e46e70","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5c7f60619e642de2f6951662670ef490a6e46e70/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5c7f60619e642de2f6951662670ef490a6e46e70/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5c7f60619e642de2f6951662670ef490a6e46e70/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5c7f60619e642de2f6951662670ef490a6e46e70/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5c7f60619e642de2f6951662670ef490a6e46e70/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5c7f60619e642de2f6951662670ef490a6e46e70/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5c7f60619e642de2f6951662670ef490a6e46e70/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5c7f60619e642de2f6951662670ef490a6e46e70/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.0c1d6ff9.0","_nodeVersion":"10.23.1","_npmVersion":"lerna/3.20.2/node@v10.23.1+x64 (linux)","dist":{"integrity":"sha512-hB2B1UBvbGEUQT5WamOeAk/4CMBCbNVIMzr6seR4mh+qZ3EJneD6y/6XLSUraA5/qm6+y7AAKw/vF47E1rlB+w==","shasum":"9594cdcac7015020a3d8e139042b0c366c606592","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.0c1d6ff9.0.tgz","fileCount":13,"unpackedSize":203310,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgAfZnCRA9TVsSAnZWagAA2voP/2OIcBHGyiniezgCKKYe\nk4EgzrDNrqFYRC83XbrEe+tqYnoQ1fKSGEZfXpVEDfDth/XmiKZSnZ+vqALZ\nAARt2I9b30KquwJfSIjr31SSqScQ9XHApqSCMkKe/TbpVI4EpPvPt43JrDKP\ntMMvcLWIYtZ38QpVioGB6DhAk6GffLM4OTZXvb6EChPNtImPmb+oLCtNukrh\nAfhmQYU0yl7IXiK421rec1Sz7jNFHpFShR+9FewOZmVrCWA//6MVBIEiaf4G\nT15QuW9z2PTgQ+PEFVq+fd5PxSI8jR1AnA9d+NHtAmsWOTR6dktCOsKOa18X\nKqqmxpjbeNlPX2AYr+HyF1qRzlCBloPAIvxg5jTjgAtrdMNMeR5WNJBixRYO\n/NBSgrLMK256UlV68YZYAcqV0MbzbXViM5v1g8KVQpzn/GZdA+hGBtD0atsH\n2svilI5uxrx+YsrUlfaU/K6QBah1q0nKhCTkQ6iDCEhtwSHjddjmEbhLKClE\nRXR5YGFt+/i0fubFg88Txl6fsx3ntjuse7A1k/z15yXmhfmFPM4qGzB86Oo7\n3FLHerGiZ/NWDF4LPvT+Hu7MivNHH4xJHGsXcOjGzwq5aNXl++EtpZkRrdCd\ncIVKEWmKGekqSthTYhc0qqtZSRdroHE8FdhMoxVwb96cvh26700mOR+jYs1S\nHJf+\r\n=Y9ir\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD7zKITfGhBjmQIq37seXFLfVmWLbjqmilY1dDa/Pl/HQIgdwrRENplelWj+x9GGuF56hYQJfbI6/IMLumgN+DFlUk="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.0c1d6ff9.0_1610741350910_0.11509842445335194"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.b4332e00.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.b4332e00.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=10.0.0-canary.c7c5da28f.0","@material/line-ripple":"=10.0.0-canary.c7c5da28f.0","@material/mwc-base":"0.21.0-canary.b4332e00.0","@material/mwc-floating-label":"0.21.0-canary.b4332e00.0","@material/mwc-line-ripple":"0.21.0-canary.b4332e00.0","@material/mwc-notched-outline":"0.21.0-canary.b4332e00.0","@material/textfield":"=10.0.0-canary.c7c5da28f.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.b4332e00.0","@material/notched-outline":"=10.0.0-canary.c7c5da28f.0","@material/ripple":"=10.0.0-canary.c7c5da28f.0","@material/shape":"=10.0.0-canary.c7c5da28f.0","@material/theme":"=10.0.0-canary.c7c5da28f.0"},"publishConfig":{"access":"public"},"gitHead":"823027b19badea63e32aa35bfece324daba62e19","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/823027b19badea63e32aa35bfece324daba62e19/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/823027b19badea63e32aa35bfece324daba62e19/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/823027b19badea63e32aa35bfece324daba62e19/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/823027b19badea63e32aa35bfece324daba62e19/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/823027b19badea63e32aa35bfece324daba62e19/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/823027b19badea63e32aa35bfece324daba62e19/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/823027b19badea63e32aa35bfece324daba62e19/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/823027b19badea63e32aa35bfece324daba62e19/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.b4332e00.0","_nodeVersion":"10.23.1","_npmVersion":"lerna/3.20.2/node@v10.23.1+x64 (linux)","dist":{"integrity":"sha512-N8A4Xh7Qm8a7sUa4/BZHyVMDzktf1KuNGbdYSznTIJ2SXULX9/yothTRD4ZlsU6M0KRyhipCGhF3e7KSdfr+RA==","shasum":"e0cf9813c97333c783358a4c0f7c882c71b78175","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.b4332e00.0.tgz","fileCount":13,"unpackedSize":203310,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgAhIcCRA9TVsSAnZWagAAD0UP/38hZYRJiZSa3wfVC/jv\nKOmI0sGTurgnYiqyOU850a7uN4J0NWX7bxJNZTJsJulw9DmqVYfMTCsgT7tA\nJLJUIGcJQjLvjVnnX7P20bLwRnq7HbxfVet48/nLh0vQJMsDKXKEz8/T1Dss\nMLZEG+wuR6SccXZ7YIamNnCzEZhf2JXA3qhrjpc5wpC6g+PJHJS1Z0QwMKLb\niYEnnhTnnBoLcOL7Z5R38h86qHiqKA3Gc7rgklbGexexHywIOoaCGP3Ldn1n\nc4zZtWvEUMNv7xuSzmelFIsWnEfqJebxWnYb/3+5x0n8OeFPtlX2Sm4EjNxm\nsNo0lafyatQkJZ6VU+C/RE5Mxm9pJrK12b8hxmj7aLi/+a+TctgBpEOrXfVv\n7dunOcBPYEUoT8kkOXCg9+S5CBrC6U9JgtQgNcmJD4VQL7RAonn+j+24zBLH\n6ZNITrJIpM2tJCk+5b09T8ywOhRmvcaQGX0rTDuHDmpgz+2W6R2y8YzHzSN0\nfQB3AUGoaN5Rpo+wS+DxowqLYdHimcF89KR5IGuZ519Ed+YB+mrH79whkqYF\nC/M0k6R/9jbxVQiFAQtQgqC/8xlOD8FzHMi5rUQsMoAsq/0IpftHMri7FcpY\nnJQ3PkfQN/ZXvUWckT3+HZHNolhj+qie7nFxyLlNydsF56iqdCVi3fJht1q5\n3h80\r\n=Cvov\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFgGxGuR3SLGNqyLVgjiG6a56fhcaEP7O1n8qcN5TyWbAiEA0Ia+6CIDUnvxo/IsiEP3dQNgntViLnM15wvUWiwbpQA="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.b4332e00.0_1610748443879_0.7927089889495551"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.2899691d.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.2899691d.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=10.0.0-canary.c7c5da28f.0","@material/line-ripple":"=10.0.0-canary.c7c5da28f.0","@material/mwc-base":"0.21.0-canary.2899691d.0","@material/mwc-floating-label":"0.21.0-canary.2899691d.0","@material/mwc-line-ripple":"0.21.0-canary.2899691d.0","@material/mwc-notched-outline":"0.21.0-canary.2899691d.0","@material/textfield":"=10.0.0-canary.c7c5da28f.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.2899691d.0","@material/notched-outline":"=10.0.0-canary.c7c5da28f.0","@material/ripple":"=10.0.0-canary.c7c5da28f.0","@material/shape":"=10.0.0-canary.c7c5da28f.0","@material/theme":"=10.0.0-canary.c7c5da28f.0"},"publishConfig":{"access":"public"},"gitHead":"ad2d9fc5a5b47298a72fb5fe6e82b8c7c9ab8e44","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ad2d9fc5a5b47298a72fb5fe6e82b8c7c9ab8e44/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ad2d9fc5a5b47298a72fb5fe6e82b8c7c9ab8e44/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ad2d9fc5a5b47298a72fb5fe6e82b8c7c9ab8e44/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ad2d9fc5a5b47298a72fb5fe6e82b8c7c9ab8e44/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ad2d9fc5a5b47298a72fb5fe6e82b8c7c9ab8e44/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ad2d9fc5a5b47298a72fb5fe6e82b8c7c9ab8e44/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ad2d9fc5a5b47298a72fb5fe6e82b8c7c9ab8e44/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ad2d9fc5a5b47298a72fb5fe6e82b8c7c9ab8e44/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.2899691d.0","_nodeVersion":"10.23.1","_npmVersion":"lerna/3.20.2/node@v10.23.1+x64 (linux)","dist":{"integrity":"sha512-y6vYUOORZDFUsH4sIFyJLoGrHkJYCBRHNn6m2zlb9zc3yGutsI2uawlRCv1P+2ldMQ5NrObT2xAPxL1ENnFYng==","shasum":"423d25e2559c9e40ecd7ae5d72389e0400337d69","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.2899691d.0.tgz","fileCount":13,"unpackedSize":203310,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgAkT8CRA9TVsSAnZWagAA5TcQAKFF/Ot+Z2WydOGTFYJO\nZtuQWK8Rwcob8mKOnDiMSH9f4z/+ZuFOnOeASxMWi2CKWqsKd9yJqbm2tVEg\nO5AMeI8Cwq/TrKbuKnbS4i9k1qvWl7BhBUqq+vw2qnLRM/83b+bXqyCLe7u0\nVGLh7q7GVrNyjbN6sTIpck5qkru0mhdA0ZtBZ6cAVlBJsYXxxhH5n5iCt6tt\nQMxPp0NUU7TwXCwAJZqbSmHl4tVAlPxl5vz9N2brSbOy9jAp6jFMu8SP23Rn\n3ffmT8ffP+dmRVbRkPMG/bTxvvK9y6S1NkZDLPeHzR7ztcLXwpzmOGcF5rbq\nFAYTkmMr18+q/w5FnY3AbvEDSion6FJahdvBoltv3cXHlrpLHfCtZvJJPJwI\nYnS1oVYeasOvQINHFW8FFEEtfn5Q226eI75carbuBjqj8bwEb4yE3VmUnES0\nZm4f9biTZXudulCiQvEQx9kqEKDFtMwVuwCSqMjhtX+pJDdOhXn5vStt+wWF\naue8MnxZa2cdiBKHjh68kAQ+swbXyUpcTTD7G0wrvByLemdzjdIfUO0LuoCz\nZtDs46cdCPPO3hvNRnYcZJ4tbw8how+Qi8o0Dj/egN0iiWTO5r0kiseFgI10\npavLCm13hWswtdbyd7b5o2IS6HXxZqZz3ez58qh3ypl21sqfEWLV1PjsPbp5\ns3QL\r\n=WARi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAkNTqbqAS/BVodH9IBSppVqo+KyzockuhpchkmpyMpnAiEAizL6X9HiD2BYgBKfwPg+9MDxJrm80qb/W3YDzD2vyfg="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.2899691d.0_1610761468482_0.4023644469163423"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.fe73953b.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.fe73953b.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=10.0.0-canary.c7c5da28f.0","@material/line-ripple":"=10.0.0-canary.c7c5da28f.0","@material/mwc-base":"0.21.0-canary.fe73953b.0","@material/mwc-floating-label":"0.21.0-canary.fe73953b.0","@material/mwc-line-ripple":"0.21.0-canary.fe73953b.0","@material/mwc-notched-outline":"0.21.0-canary.fe73953b.0","@material/textfield":"=10.0.0-canary.c7c5da28f.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.fe73953b.0","@material/notched-outline":"=10.0.0-canary.c7c5da28f.0","@material/ripple":"=10.0.0-canary.c7c5da28f.0","@material/shape":"=10.0.0-canary.c7c5da28f.0","@material/theme":"=10.0.0-canary.c7c5da28f.0"},"publishConfig":{"access":"public"},"gitHead":"2464e59ad6a1d74aed7f8ca3477c1f8d244eb8b9","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2464e59ad6a1d74aed7f8ca3477c1f8d244eb8b9/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2464e59ad6a1d74aed7f8ca3477c1f8d244eb8b9/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2464e59ad6a1d74aed7f8ca3477c1f8d244eb8b9/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2464e59ad6a1d74aed7f8ca3477c1f8d244eb8b9/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2464e59ad6a1d74aed7f8ca3477c1f8d244eb8b9/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2464e59ad6a1d74aed7f8ca3477c1f8d244eb8b9/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2464e59ad6a1d74aed7f8ca3477c1f8d244eb8b9/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2464e59ad6a1d74aed7f8ca3477c1f8d244eb8b9/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.fe73953b.0","_nodeVersion":"10.23.1","_npmVersion":"lerna/3.20.2/node@v10.23.1+x64 (linux)","dist":{"integrity":"sha512-Z2dgUs9+difYvHhaGtp0Bi5Fk/BrCmbsUDQbWsRIDADPEhfL5QrRFKUU7oKYWpfpmp7fy1ZyyAeh6IbkZD6llQ==","shasum":"81f96e606a31851f548077c87726223872d2253f","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.fe73953b.0.tgz","fileCount":13,"unpackedSize":203310,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgBzEtCRA9TVsSAnZWagAA0XgP/RQOwUTtWgUfzetVkaVC\nZlLnPTRMoGMgELYNv2fr1B3kapA6722ZcxrXjlxG0vk9BLzkl2U/2Ok5RvQZ\nc4FcXoGUm4pwIkoBUrxQ9/lM1xJEJFou/u7k9abgNAUi7a6aYfBLRiaBpUMk\nejS0McSI+jr+Hw5xV/Jk3eKn4W/Fhv2MAHfXqRnufFwufFP0JY0YR6csoKrk\nPlH5rlTxPeiAVyvOJCwLBkYJuI5JXtp2OvU2e2pjDAPjwtksoCm/tz6C+hkK\ns2Nqook+jOQQ6P3FRkzC7pCAl4EU6lix8WGVhYexxwRxLA8fR8m1PrTj3X3n\n7ZW/0GL5ln2QSKK4RHMrREkbcMwakFB79cTIZq2NS5bmC4/V4jGbMcQZpMD1\nbFiGcBsmYGCk09NHSU2rMR9AOfMosQPSEJm/u8qhp0vWVt1OnV2Ve9Lm2lPs\n5vxkXQtd9upaY/oASNCJS9pWOhVFneN148cD0cdMqfLICf1wKNneONpcxHFv\n/onIyiX2d/uhefnylQBeXxBBeR90TE4iJB9BUbWUXV7gP2dM88U658q5JpLz\nuJUQk+9f84BMxwFrf9bPKDXjkTJwJJ3S/S5cx+ARKWKeo+5k+velETdSYnPq\nm924O4kRMd8BEgcC/z6U9cubClhRv6Hisr5T7LFgCuKPZWhm6ScVxVuaqQ7m\nJjeq\r\n=V/3h\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBFTFtaRfT3uY1GvuKrtHTdXUdIX9QhDQnxPL1lrxJg3AiEAmiaxbFULmw2BfygFiRm64DD9YaHVLQg4+6XxAiBeNt0="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.fe73953b.0_1611084076623_0.9704109518914421"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.d3a16455.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.d3a16455.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=10.0.0-canary.c7c5da28f.0","@material/line-ripple":"=10.0.0-canary.c7c5da28f.0","@material/mwc-base":"0.21.0-canary.d3a16455.0","@material/mwc-floating-label":"0.21.0-canary.d3a16455.0","@material/mwc-line-ripple":"0.21.0-canary.d3a16455.0","@material/mwc-notched-outline":"0.21.0-canary.d3a16455.0","@material/textfield":"=10.0.0-canary.c7c5da28f.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.d3a16455.0","@material/notched-outline":"=10.0.0-canary.c7c5da28f.0","@material/ripple":"=10.0.0-canary.c7c5da28f.0","@material/shape":"=10.0.0-canary.c7c5da28f.0","@material/theme":"=10.0.0-canary.c7c5da28f.0"},"publishConfig":{"access":"public"},"gitHead":"cc074ab80b57efe95502e551eb4d0ce6a153094c","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cc074ab80b57efe95502e551eb4d0ce6a153094c/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cc074ab80b57efe95502e551eb4d0ce6a153094c/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cc074ab80b57efe95502e551eb4d0ce6a153094c/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cc074ab80b57efe95502e551eb4d0ce6a153094c/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cc074ab80b57efe95502e551eb4d0ce6a153094c/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cc074ab80b57efe95502e551eb4d0ce6a153094c/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cc074ab80b57efe95502e551eb4d0ce6a153094c/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cc074ab80b57efe95502e551eb4d0ce6a153094c/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.d3a16455.0","_nodeVersion":"10.23.1","_npmVersion":"lerna/3.20.2/node@v10.23.1+x64 (linux)","dist":{"integrity":"sha512-PTXxV6LiLgqex65J8GjBOTr54Ue3ITMzu5y9zNUE/Fq6p5Q4neoruPLKoTwiBm39DBPHphZHbJhEAGwwVY6HQQ==","shasum":"ee6a617eebec82b3dab64c2495eefbc5864fd0bb","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.d3a16455.0.tgz","fileCount":13,"unpackedSize":203310,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgBzhvCRA9TVsSAnZWagAAcP4P/38M7x5iiaAfDmVN+Qk8\n34+UurZd+Vf7nLk6F+eMvL5BIHIC5Bo9Hf3xKujM18dy9YxW3q2eFzKrzEO+\nM7cKoopvZU5JNIwDULvBtX9XpEH/G9JT5dGVVfSRBNdc+dhci4Xf1pzj0NvP\nuAKic1POefQLtVoGGvuxGmAW1eoY5Up8+lzo1M9GgHiAmyO1+3V2CiWIUXqW\ndbUVKF6+jiW4mHcCjUpJety9w4N9QNVhTc+8kepiMZqAZgE9hwhHb7jEamlz\n4/wlTa3p2QO4NEQogsmoZ1N90J0i4p1hh8eYKXmu0V14MvH08vs55QhBNVU5\nLlAn45ZF5uo6KonFGTfrVAuQBrvVUPJWPiiM9e+3dTbAMEKtTZ9iKDxconsR\n4e94Xs3tSk7tfVcz238gIJjj7O7ipI33RWWkY85rktiVv73+tYs/e8GIid3K\npRG+6i71CMK44a5dlxQPVxIKdLtHNVTIi+IsXOQT1nVSpPD2F+gIMxYklNt5\nk8wOS8jeIH0W/9E7p4Vw5M2rb1h29tnDlviVGK0L4N86rCTqBnDCWuJ/HIv3\nN6pAS8DUl1URIfrIQUWWMjwQZ7d/ASz52IBa5Za841yMb+cHeCwj2xgnmfIV\n/sujDz+9Re1dcrqsCvu2VH/uJps3yPy/soEDEtxo4LV+RrPJo5/W6/q0HM+6\nLibX\r\n=dEca\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDiEMlHW8VqwI1lft5r+dnKhEi3LIU2xG4ENWsJqfahwwIgJ/1HBQQAOELO5mLTBvLPOCcwl6pGDyg43GQSHi20r8g="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.d3a16455.0_1611085934828_0.435847133076837"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.597ca1b6.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.597ca1b6.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=10.0.0-canary.b2faa116a.0","@material/line-ripple":"=10.0.0-canary.b2faa116a.0","@material/mwc-base":"0.21.0-canary.597ca1b6.0","@material/mwc-floating-label":"0.21.0-canary.597ca1b6.0","@material/mwc-line-ripple":"0.21.0-canary.597ca1b6.0","@material/mwc-notched-outline":"0.21.0-canary.597ca1b6.0","@material/textfield":"=10.0.0-canary.b2faa116a.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.597ca1b6.0","@material/notched-outline":"=10.0.0-canary.b2faa116a.0","@material/ripple":"=10.0.0-canary.b2faa116a.0","@material/shape":"=10.0.0-canary.b2faa116a.0","@material/theme":"=10.0.0-canary.b2faa116a.0"},"publishConfig":{"access":"public"},"gitHead":"2dea4d182145f148cba1edfd7b358ed05bc6c8ea","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2dea4d182145f148cba1edfd7b358ed05bc6c8ea/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2dea4d182145f148cba1edfd7b358ed05bc6c8ea/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2dea4d182145f148cba1edfd7b358ed05bc6c8ea/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2dea4d182145f148cba1edfd7b358ed05bc6c8ea/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2dea4d182145f148cba1edfd7b358ed05bc6c8ea/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2dea4d182145f148cba1edfd7b358ed05bc6c8ea/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2dea4d182145f148cba1edfd7b358ed05bc6c8ea/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2dea4d182145f148cba1edfd7b358ed05bc6c8ea/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.597ca1b6.0","_nodeVersion":"10.23.1","_npmVersion":"lerna/3.20.2/node@v10.23.1+x64 (linux)","dist":{"integrity":"sha512-WItWlhf8/0kaDViKFHTo1TjBhu+hfEw/u73s4OTQzxZQyXosjUhn22VLbr9htzkCM3N3uXmyB2xIlWwGqyXnyg==","shasum":"044a4d1af046983e7905db08a9183dc7722cfbb3","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.597ca1b6.0.tgz","fileCount":13,"unpackedSize":203310,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgB4CZCRA9TVsSAnZWagAAO/gP/jt3f2h2yOHaIWU/2QDO\nsvtkhyki4UMcKiyFqBQ7gXkUJXObe7cNzTj7wtclJmNab7Bkjg5F7//5/1tc\n+NlGW/MI2eGEa5M8mHL2pumbgstRht0TYX2ic8xrK+gPWE6E2x2lxhnklLE2\n9YoyBeeyTip5mOEXXXFpENgIcZ8vs2fJuVYhA2jh/iplnKT0ldLEAuwd2U4o\nTtAd/Ue6PC2mKwCMApeZtmGYwZhxw+Yz6X2YqvAyH/b0zqT3WoU4Tv91wTbw\nSuyCGITZVA5L1Gi3Tw+1gquJh7sbpPBu2sJvYEKJ2FyQOKr+SDbQxE78zehx\nMPi6D9uwu2YXJoKFyoy+a95y02dmi66YV9VsKdu3VGHHdacRLMjuGq7fsFPh\n0GuU3X7zOdyBvlF8xLZv05OtYZ+4WPDCcWBS8NFKjaWHYmYUTeP/4vv5oKtb\n6d6orR46uATLSt4YEjkEz6CigZKIrpxxKaoFDwi4KkYmkQhJBaIOok6Y9RYv\nceiv/lUL9hxHd//syfHX5JbxVVPtxbjsgyIHp3lXjOGlb0BopIW1NHrEv6G9\nBcOaqBjuwpgJ4HcD7SWR3CNeH3QXY51kSWKH7dbGPFfB5DgHo92q+kpG5aDH\nQ8V5SybQSbJ2MZhA5scxvPdYDpMpm72TJw+cfLFDlHgB+ZkOYryMf8IAJ6kZ\n2R2k\r\n=Y97s\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC96u07C7i/tRVthgO9iteS1QyDHhOYmokvj8ZeuDohygIhAMdPU0Vj6jdK5Ge1FkDPzEGnOCW51VXWKd6mtOXL9UnZ"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.597ca1b6.0_1611104409088_0.2141520523173197"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.3c195efe.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.3c195efe.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=10.0.0-canary.b2faa116a.0","@material/line-ripple":"=10.0.0-canary.b2faa116a.0","@material/mwc-base":"0.21.0-canary.3c195efe.0","@material/mwc-floating-label":"0.21.0-canary.3c195efe.0","@material/mwc-line-ripple":"0.21.0-canary.3c195efe.0","@material/mwc-notched-outline":"0.21.0-canary.3c195efe.0","@material/textfield":"=10.0.0-canary.b2faa116a.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.3c195efe.0","@material/notched-outline":"=10.0.0-canary.b2faa116a.0","@material/ripple":"=10.0.0-canary.b2faa116a.0","@material/shape":"=10.0.0-canary.b2faa116a.0","@material/theme":"=10.0.0-canary.b2faa116a.0"},"publishConfig":{"access":"public"},"gitHead":"5832b828afcaa6412dff007228c15a665862a145","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5832b828afcaa6412dff007228c15a665862a145/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5832b828afcaa6412dff007228c15a665862a145/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5832b828afcaa6412dff007228c15a665862a145/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5832b828afcaa6412dff007228c15a665862a145/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5832b828afcaa6412dff007228c15a665862a145/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5832b828afcaa6412dff007228c15a665862a145/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5832b828afcaa6412dff007228c15a665862a145/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5832b828afcaa6412dff007228c15a665862a145/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.3c195efe.0","_nodeVersion":"10.23.1","_npmVersion":"lerna/3.20.2/node@v10.23.1+x64 (linux)","dist":{"integrity":"sha512-44OQjzkl6Axa3l5rsIDnMLH4hRpKwvgODh9pYS18Bg/m63QsZe37SOhiE9XQRCh+5f6HFOsp1s5mVkLLAQdXWw==","shasum":"e09223d199a7ba2c7b45e9d72eda7b36c9b868ce","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.3c195efe.0.tgz","fileCount":13,"unpackedSize":203310,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgB47zCRA9TVsSAnZWagAAWLwP/10uJ5ZApdrk6VZDoL3c\neuUd0qJfVDe0mbUAFZYzLwUhMCATuwEaC5uUG6UjhwjM20+cpltuODQcLZSi\naIemZK8P7VuNH5U44jPWrvhC1D2cF6Wl2XWNdHj3OwP5LBla3iRqNAzRTgGj\nKS9z1mLkFlyITeWaRObNvEKfkt3QlV8CTjF3Pu6N5+mTCo7IVd7pnrbvVUjK\nouE8bXD0JTjNZpp/uMRfiR74YIN5OliDvBa+aCB0+OOdazSw7MTj0RpEnuFq\nGQ8zHUi2G0KxkHRSkidUCyXNs7sSKfjfz+YAFcYFiAN9PiGXeb9DXq2M9klJ\nbUVljp3hMpPDt5J3HROxKxLhWB2Y7SE3xhsv9nEenqzFfuIIuP3WHoOrnTU8\nWY4VZDtIZHDE1Qw46tBHTUBm0YLHxY2Enaid6PxcnKW08JQdxQKsW2mvFJcq\nQ2EEOtD9zSn+JGm9Sqqd2u/Eq+UL+HMrjKfATlu/GFShvdaMd0Uu9LQBuKpk\nL4IPO4fpX9fjAe3owEik3Q+dR1owHAO3ImtdlufeOoK7SobdC66p7Z86QAdi\n63QJeyB6bgZzfPn9S5amd1EhyUFQGIIlJTJNShgiSbegEjBX8CU9RKJxzgXA\nb1NYcTOXpvS8/cN5u8y5z3eTTOQ2DjzDqd5N+cMi0rY8yfJdnSL9vp2Bu1Eo\nz3AD\r\n=iSsK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCSr0zrmsbzV2pINm/hS+OalyhO/VC6zXmAQ9x1nbGh9wIgQCU6sJrOItNU+8Gredd6pF4XO5UZ/ttAZQLT6Wju2g4="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.3c195efe.0_1611108082951_0.6407952583542604"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.f7b8755f.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.f7b8755f.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=10.0.0-canary.0c95c9f7b.0","@material/line-ripple":"=10.0.0-canary.0c95c9f7b.0","@material/mwc-base":"0.21.0-canary.f7b8755f.0","@material/mwc-floating-label":"0.21.0-canary.f7b8755f.0","@material/mwc-line-ripple":"0.21.0-canary.f7b8755f.0","@material/mwc-notched-outline":"0.21.0-canary.f7b8755f.0","@material/textfield":"=10.0.0-canary.0c95c9f7b.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.f7b8755f.0","@material/notched-outline":"=10.0.0-canary.0c95c9f7b.0","@material/ripple":"=10.0.0-canary.0c95c9f7b.0","@material/shape":"=10.0.0-canary.0c95c9f7b.0","@material/theme":"=10.0.0-canary.0c95c9f7b.0"},"publishConfig":{"access":"public"},"gitHead":"189595c9eb20e25a71796a5720374331d50a7f72","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/189595c9eb20e25a71796a5720374331d50a7f72/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/189595c9eb20e25a71796a5720374331d50a7f72/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/189595c9eb20e25a71796a5720374331d50a7f72/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/189595c9eb20e25a71796a5720374331d50a7f72/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/189595c9eb20e25a71796a5720374331d50a7f72/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/189595c9eb20e25a71796a5720374331d50a7f72/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/189595c9eb20e25a71796a5720374331d50a7f72/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/189595c9eb20e25a71796a5720374331d50a7f72/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.f7b8755f.0","_nodeVersion":"10.23.0","_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","dist":{"integrity":"sha512-c25SUHAjCt9aNpaQdCHwV0973g3YDxuu9JGjigREuxF6czZlivF/OOUr09R5mk4ZYxMvUx8YdGLeYA0CnNchfA==","shasum":"0f1da433ad575c9ac934bd2cacaa34b45355fce1","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.f7b8755f.0.tgz","fileCount":13,"unpackedSize":203310,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgCJSPCRA9TVsSAnZWagAA6pcQAKBytZOwparG4H46OiJm\n5SHzKa7FRJHNHPII7fiL2eWPLHvuA8JjzvjWsNvDuH9371GQ2HGGnGMvlELD\nmS90d9xwmBLo8B8V/2wk7zUWmEAD9pcfTUXy8wGzopAN6mQ76KKt2MNO29Tw\ngI4gliQUYfRXS/y8STv1DAQt7kUwd/DTjiCZq389C9nEKrpzgNW+j5+rwZfd\nZFNEMPhypslOtcdZCIh57qMtMKnPcCralQbbDUeFJwCILgENWqXdPQT+lJhZ\nTeuKbuZit0+V8KP2zlOOmeh33kW/1I7kWckD/n94CWa79ykTUJDQ/14jX6BE\nrlsyCTURVl0kygX2F0dhektPIp0Xs2gEnHzrLof4EYZbSztAKN/4kS+4hCE+\n+BqLAEFEYaF22PBQ2YLIMWtbNiZlR/bx1uXkLg8nGal3Bi0gc5zEi5UMC9Xq\nC6YrF4EZxj2r2+OyXvBET8YgxV/JM0g99yBPGO3rgVEKfB+ggETnBIc9WEGW\nFXd/I+yUlw/oAWLBFkmphR+hAl+1/I9on8Ap9XUvt6PUCfl1XNsSZPXTTZrA\n/y/YGlIULE1BaHdkxiW4fwCkSBPyOaIbfdZOthosZA9sJesFmTzoAr5yGjq9\nxdm1zAviP8ywbLyNURq35o5zOjr6b/0/isrDZKoiKeWRYMC7S4V2Opr5gngf\npRlL\r\n=MQ7C\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC2gwZxNApe7/E2S5EUE3EQa1oOhIB4mVOdIx+h7BJhuAIhAJk5MdF0FDPV7C8n2oKQqd8ReQivt7+xcvlk5wMBkl1U"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.f7b8755f.0_1611175055313_0.6042227895464765"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.f60de7df.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.f60de7df.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=10.0.0-canary.2ed2d829b.0","@material/line-ripple":"=10.0.0-canary.2ed2d829b.0","@material/mwc-base":"0.21.0-canary.f60de7df.0","@material/mwc-floating-label":"0.21.0-canary.f60de7df.0","@material/mwc-line-ripple":"0.21.0-canary.f60de7df.0","@material/mwc-notched-outline":"0.21.0-canary.f60de7df.0","@material/textfield":"=10.0.0-canary.2ed2d829b.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.f60de7df.0","@material/notched-outline":"=10.0.0-canary.2ed2d829b.0","@material/ripple":"=10.0.0-canary.2ed2d829b.0","@material/shape":"=10.0.0-canary.2ed2d829b.0","@material/theme":"=10.0.0-canary.2ed2d829b.0"},"publishConfig":{"access":"public"},"gitHead":"ada07a353340882b0d087ddf967d399be3009123","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ada07a353340882b0d087ddf967d399be3009123/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ada07a353340882b0d087ddf967d399be3009123/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ada07a353340882b0d087ddf967d399be3009123/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ada07a353340882b0d087ddf967d399be3009123/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ada07a353340882b0d087ddf967d399be3009123/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ada07a353340882b0d087ddf967d399be3009123/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ada07a353340882b0d087ddf967d399be3009123/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ada07a353340882b0d087ddf967d399be3009123/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.f60de7df.0","_nodeVersion":"10.23.0","_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","dist":{"integrity":"sha512-sib5ay8K1AcMiwaiQ0XUbAsdlmC1Rg+gCe3h+uUfd6CKpC8zrX/bLNJierMr07gKyKWIflT425VcwFOaUsbdzA==","shasum":"3a35a70f8723e7411f8940d95b472af21d45a2b4","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.f60de7df.0.tgz","fileCount":13,"unpackedSize":203310,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgCL6DCRA9TVsSAnZWagAAo5sP/REkZicyibLfKYx68LC7\nZSuT6rXlS2fjy3h578qFzmToDMB50ipWzbIVus030o9FHK1kRTnUqN91Y6x8\nfeRtelVlfVMDc6AHWltzkxApD+A4D95LdxUl71z7aj7UfFpn0HRMEb7tEqI6\npHuuTHKcdLysGfV7cVmvPKzHYRZf7NMuZIizcfeO0DjB5LQ2A4eB9BFzwGUt\nJ5f4g+gKJ/lfOBQN0ps+wrxTMo5EMiP9iTFDomxPLfZEGraZu1p/offz/DG+\nPBAb8tZhkaNIReiGEbCPukXJek9xC53wV29lpsC7Wa7h3R9+qf7/W0gSVWVy\naowpHwLFipDsvgHxsK2B7SsYxMi6jnuyIAagnO6E/krREe1B0bT85t0XOuv9\nRwCgM4PmELFib0Eereg1jDoOrMHbyJ/M2eT8U4BhpeHGe6Z6pJQEY/20ALuY\n2/2ufcYJc2oXMKCe0WSnFmry8VvhxMPXmm2SXKg9zdd1QyMqKrCPrAX/7Rd/\nwE849oZNHsBLyfBVtfWTTG6n7XImOpjAyrSg2zS6AzyG95zt6rqT4E0cRuBQ\nwZ3IrqnWm51SKAnEd1HFOxfxaFk3Bwd4AZawX1iIH193AU/nUPus7Z50CJzH\nJ+dgCmZ+JjBHqujFJE9f6/24GYB0HfnRwlyeQ99giefYDnjmTtYwChhSnwNa\nSrrP\r\n=qaWr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHmjCrgXWOtPfghlDc2A+y/978VUYDovXmVR2AaPhu3vAiAV96jy07KHRwh7TnwIQ6GcIl/Ecb8cuIQiRmOQsI3sPQ=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.f60de7df.0_1611185794965_0.3260669043876532"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.664a2927.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.664a2927.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=10.0.0-canary.2ed2d829b.0","@material/line-ripple":"=10.0.0-canary.2ed2d829b.0","@material/mwc-base":"0.21.0-canary.664a2927.0","@material/mwc-floating-label":"0.21.0-canary.664a2927.0","@material/mwc-line-ripple":"0.21.0-canary.664a2927.0","@material/mwc-notched-outline":"0.21.0-canary.664a2927.0","@material/textfield":"=10.0.0-canary.2ed2d829b.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.664a2927.0","@material/notched-outline":"=10.0.0-canary.2ed2d829b.0","@material/ripple":"=10.0.0-canary.2ed2d829b.0","@material/shape":"=10.0.0-canary.2ed2d829b.0","@material/theme":"=10.0.0-canary.2ed2d829b.0"},"publishConfig":{"access":"public"},"gitHead":"af2f8cdb8d2e4132b15e0b5a79f060d43a3431d9","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/af2f8cdb8d2e4132b15e0b5a79f060d43a3431d9/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/af2f8cdb8d2e4132b15e0b5a79f060d43a3431d9/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/af2f8cdb8d2e4132b15e0b5a79f060d43a3431d9/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/af2f8cdb8d2e4132b15e0b5a79f060d43a3431d9/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/af2f8cdb8d2e4132b15e0b5a79f060d43a3431d9/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/af2f8cdb8d2e4132b15e0b5a79f060d43a3431d9/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/af2f8cdb8d2e4132b15e0b5a79f060d43a3431d9/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/af2f8cdb8d2e4132b15e0b5a79f060d43a3431d9/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.664a2927.0","_nodeVersion":"10.23.0","_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","dist":{"integrity":"sha512-k+qedCZ+Iy9KCVqG4/TZVWve+W0v8gNPnvaEJowk56Uub/G+77XLOMd8baqtDgXJV9nXb7+2yHGNTszosDJdjQ==","shasum":"3dd91a44ecda8e7a5861d313c60995f67d82058b","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.664a2927.0.tgz","fileCount":13,"unpackedSize":204219,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgCdOHCRA9TVsSAnZWagAAPdIP/0H7oZta42oc1Vk6BZvn\n9jtX7uv0M4nmW9r/E9/lAMLpzSA3CxSKRR12Q2BX/oejVETIOByDyOd0Xeqh\ntDlHtkala1s412WqATTykWG9Z7svEcGGlI8TS8uYKJWvP8KnGSacy/n5MfGo\nQH7ify7GTQCpEfCwsXL0Sr1XP/wrxuE94nBPHLK0PeBI30Bn32b+2+nvE63i\nAZ6gA6xrm9/HJectbPM2/uW2QIb0ZVkZT+CkCUUUuPYdWbw0sEc68BUNS4Lq\nvZG7S0sfnbNNc3DrGwguyvEsz9VqGYKLVsZyDbs5C13ofSdKr5orUUkYoPqf\no42xOs8BSJvwS0aumaG/dc/FRylMjzupdql9SosUUYixtl9JZUKZC0z78B20\nBFyIQAp0QQkwxfEEZ6q7eBfKDvvk21mr2wr4/DWyynTRsPTml2Wa8F6hsLQU\nV8vypbC2MRYGKk5YHrUORoSXj9anMfX3LIhqhwJbNUjxqIx626kK8iW+/wZ2\ny1+pZfS20x4KjDbh2sK3unnScRBQXo0D1c2XKSAUqkn9Z/3kiXmWb+cpyIIc\nsGJD+WOToJ4cn80TfmFmmAT6+zU1WUKtcQKxNF8XypQo0GfcdYncRUl9bWJs\n6CZkD592jKVCTPCdn+liRYphPZqJ9VkwN7Sf06JKYIiJqqxwgEhPIDGyjrdo\nlh8f\r\n=7EBA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFMWGJBbJf1Yl2/Rn7CoTXNZk+lFW/ZxDfnonChvLExRAiEAvw7yRbQEl+iW8U90x8TTMJ7QTwdxbcz7uT5bozOXrNU="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.664a2927.0_1611256710922_0.41149865977652245"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.a6d312e5.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.a6d312e5.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=10.0.0-canary.fd61b0476.0","@material/line-ripple":"=10.0.0-canary.fd61b0476.0","@material/mwc-base":"0.21.0-canary.a6d312e5.0","@material/mwc-floating-label":"0.21.0-canary.a6d312e5.0","@material/mwc-line-ripple":"0.21.0-canary.a6d312e5.0","@material/mwc-notched-outline":"0.21.0-canary.a6d312e5.0","@material/textfield":"=10.0.0-canary.fd61b0476.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.a6d312e5.0","@material/notched-outline":"=10.0.0-canary.fd61b0476.0","@material/ripple":"=10.0.0-canary.fd61b0476.0","@material/shape":"=10.0.0-canary.fd61b0476.0","@material/theme":"=10.0.0-canary.fd61b0476.0"},"publishConfig":{"access":"public"},"gitHead":"c9a270f0f64518469d960de40537a07c4cbaf812","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c9a270f0f64518469d960de40537a07c4cbaf812/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c9a270f0f64518469d960de40537a07c4cbaf812/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c9a270f0f64518469d960de40537a07c4cbaf812/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c9a270f0f64518469d960de40537a07c4cbaf812/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c9a270f0f64518469d960de40537a07c4cbaf812/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c9a270f0f64518469d960de40537a07c4cbaf812/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c9a270f0f64518469d960de40537a07c4cbaf812/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c9a270f0f64518469d960de40537a07c4cbaf812/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.a6d312e5.0","_nodeVersion":"10.23.0","_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","dist":{"integrity":"sha512-mr9veaHU8UMDyG0GnyjKTaVCExjyL1fxpqf8+zV2PGtg3cm1gCuCNCGfI//z5mJFinfrXb0d4kKuc/7BPQxBlQ==","shasum":"7cd161f4531c11a6693ec9da0fed679a834d5c3f","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.a6d312e5.0.tgz","fileCount":13,"unpackedSize":204219,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgCfZwCRA9TVsSAnZWagAAFfIP+wQwC+Ah+f0Gv9nKwdUd\n2/qeFtsaOB2GSlo1/XHtbzGt+Y/XBbZ6exPISPvVcna1pH2BOyAwgI5XU6Fz\nQ/wTqV1hUq2ujP6zalRktl3qB8zu+Tv/K0MdcXvcqgzknSY2KZHm7meYO1LU\naCXtRLJeBpcy+ftHIbqhYHBAFzX1BrIaaBcG/70MJsaVXX0MoZ7yT4Qidfeq\n2BAqzzEtXpVscy81Q0P3Y0TN+UavFTTkzMQ5zx1UaOOHaxtbBs0ON+9NXSa5\nd8fU9kpz+kCYxqjR3tu9gCBPeNC7A3X5sczjfZ6dKSG/hMvZQ58eMjjJXVV4\nB7p4ze9xdi+V8QS5KNwn0hx+FMr9NWP7oqfOeePg06je/8oCIuybr0tM3sY2\n4YqWmp0/9HwRn0LWj7yC2RJ0g9joPlCapFxUUh8oXDHmkNcFC40SCuvaPqC4\nBapOfm4dGwZ7C6K942Rg7xetWFQhqDgCftFnCBEphERpV2OUmtokMHDJqZ5p\nfn/T8InpLZay1cjtX04IHwjknia1GkVP4x1DCl2Pjp1Iz8o/+/oBQzaYFDTj\nFpNzQqGiTOe9KwBRrEqI6OmTV1FhwA8P2QhxGI3hCUJiSoPGqJKmlZHPFyYb\n3hkNe6y07WVUjcWL9LC24Dy7hE46ZhhRcacKg+1ibFAHKQCdOcomvqvPiUgZ\nWb3d\r\n=7eo+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFk0zZoAdopHYrWMd4mzF9SF+h1dzD2WKrj6foJDHQ7YAiA0xn/W0IEQwkRBLwYY6wMmTcUMbdT86/D6SXQyAGAmuQ=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.a6d312e5.0_1611265648386_0.7614623580959456"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.027365eb.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.027365eb.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=10.0.0-canary.07deaec27.0","@material/line-ripple":"=10.0.0-canary.07deaec27.0","@material/mwc-base":"0.21.0-canary.027365eb.0","@material/mwc-floating-label":"0.21.0-canary.027365eb.0","@material/mwc-line-ripple":"0.21.0-canary.027365eb.0","@material/mwc-notched-outline":"0.21.0-canary.027365eb.0","@material/textfield":"=10.0.0-canary.07deaec27.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.027365eb.0","@material/notched-outline":"=10.0.0-canary.07deaec27.0","@material/ripple":"=10.0.0-canary.07deaec27.0","@material/shape":"=10.0.0-canary.07deaec27.0","@material/theme":"=10.0.0-canary.07deaec27.0"},"publishConfig":{"access":"public"},"gitHead":"85e9fc6866aaf5bc83721e8c823275ba9232a536","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/85e9fc6866aaf5bc83721e8c823275ba9232a536/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/85e9fc6866aaf5bc83721e8c823275ba9232a536/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/85e9fc6866aaf5bc83721e8c823275ba9232a536/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/85e9fc6866aaf5bc83721e8c823275ba9232a536/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/85e9fc6866aaf5bc83721e8c823275ba9232a536/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/85e9fc6866aaf5bc83721e8c823275ba9232a536/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/85e9fc6866aaf5bc83721e8c823275ba9232a536/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/85e9fc6866aaf5bc83721e8c823275ba9232a536/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.027365eb.0","_nodeVersion":"10.23.0","_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","dist":{"integrity":"sha512-7FcEAL/PvN0W7ovgyAo5PweiCeYy47XzLWJqKqKfNj+7ChYS7EDxRQWssl+viBoTivd1B9lm9v23qYS8/7QKIA==","shasum":"d6a55f66779d267faee030b53d91c721d337f6ee","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.027365eb.0.tgz","fileCount":13,"unpackedSize":204219,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgCz6MCRA9TVsSAnZWagAAoO8P/0R7kktvo+TGYt04b9AF\nSsHCG6LPo9ydxTU3gBUNicM/on5SKfRYsQR1rllltkvUoFVRJ2MUV6fQt02b\nmX0cdqQNcYHTqr6GegupH0ILxI7TS2pxlG5fp9iKqfIPpI/7Wl2lCEasG0BZ\nCif4JqON5ocRA0zHZOSY5F9LF4fSFQjph73XVD4uIdwzM1mL65TJS+quXJcn\nkIE2Td4kX3tNUi3/7xv28tu6ievqZtXQ4VzWo808bUin0a2uyvCt13rBUbBo\nrBC9oeERHkY6yRSsE0lpugUJzFGGXtTmYkx27vGXAess8lUNQtqy2bLovf67\nYDCBZloWDyEG1UGL5avEHVQtn9AyI0VrDgkoxnK0p41EidDP7EK3Y8HcmWv6\nefAio7HfkZKQa61xZdYtl++H959SBTLMjqnMI52JCLCaXfG6G26TTbjVgARl\nFsVy7ZoUBgV6+FYRM0oE26BqTVlh0cCWEMLb0WfdaB3Mo88CW6YvdiEN9fff\nGyXVVh4dDhxgYysYmqIct9OCF3IQNF3hFxRzyeQ2CTSgV2lpzhfvYF24EaVu\njJnhGJW8lEAWMymqffx4kkdo+lL7tDkOamzAOscHK0b1hsPmgdfM1lEOEG11\nEqYvDmMvhAviT3V0n4aq4fnAbXICUE905NGuQn8L+JdPOUEDOMrZ+KK9UPJ1\n1Yd5\r\n=iU9O\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC1E2LqUx3k7cpO7HtnHaeixcO+Dlh4ZVp8SYi20qGVNAiEA9dgztgAQbyIuerkZ8urTGmzfu/8x+1AU3hYmfkyuRso="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.027365eb.0_1611349643667_0.8294076432639463"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.7e72b66d.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.7e72b66d.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=10.0.0-canary.07deaec27.0","@material/line-ripple":"=10.0.0-canary.07deaec27.0","@material/mwc-base":"0.21.0-canary.7e72b66d.0","@material/mwc-floating-label":"0.21.0-canary.7e72b66d.0","@material/mwc-line-ripple":"0.21.0-canary.7e72b66d.0","@material/mwc-notched-outline":"0.21.0-canary.7e72b66d.0","@material/textfield":"=10.0.0-canary.07deaec27.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.7e72b66d.0","@material/notched-outline":"=10.0.0-canary.07deaec27.0","@material/ripple":"=10.0.0-canary.07deaec27.0","@material/shape":"=10.0.0-canary.07deaec27.0","@material/theme":"=10.0.0-canary.07deaec27.0"},"publishConfig":{"access":"public"},"gitHead":"000cf6108aa08030d7569d4ad30c798e7ebe9da3","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/000cf6108aa08030d7569d4ad30c798e7ebe9da3/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/000cf6108aa08030d7569d4ad30c798e7ebe9da3/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/000cf6108aa08030d7569d4ad30c798e7ebe9da3/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/000cf6108aa08030d7569d4ad30c798e7ebe9da3/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/000cf6108aa08030d7569d4ad30c798e7ebe9da3/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/000cf6108aa08030d7569d4ad30c798e7ebe9da3/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/000cf6108aa08030d7569d4ad30c798e7ebe9da3/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/000cf6108aa08030d7569d4ad30c798e7ebe9da3/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.7e72b66d.0","_nodeVersion":"10.23.0","_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","dist":{"integrity":"sha512-x+t9lebQPbGWQ8wOKo/kiXeYOungefBfqhdzGNpvCmad+Jji2MuOMlboXA9YT/lfa83496uKOidKdnbqVqPAIw==","shasum":"812284afa9cbd5cc8df5acae5ab49ce1ea13c24b","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.7e72b66d.0.tgz","fileCount":13,"unpackedSize":204088,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgC184CRA9TVsSAnZWagAA6jkQAJ5UCSv/cN6R4JbFOy+U\nRIerMFyvC5kOozFqMoItpWTA7Bddlw2Dcam3CZ9MrHDW3maIwInVZznlRBtw\n2hAYgFPRKgqMiHRWclgvnj88Ieko/vIwdfVXCq9DOxqd2o+/dyFofYjlYMUe\nrGn0dFx85dgoBNTObxQlZrfofyiPkn+im4kSS1+D3q2AbIOpoq5nPFE00PAZ\nRuFsaC4oxZGh5q7qN248ghjv8yu8GLNyr+5yc1PxfAuKfRAOvjeoBxu8WglX\ngxulGMJqMXjSM+53YkFn4Gr3V6FaliX1vuVCj1EB0fTFwvj9q80iMoxWI9Sn\nW5zk9/Hwbtwzaj7kHD8xsl8A2PbwcQmEfLJOPjuTSnAvd++W4wexanB2Ghez\n6EmKDW/0VFxneIcHXbY+60yr/YYqd2VAuqVeoCKLZoZQ80wT92kYCta4DFOq\nLXkPvlwgrHstSaS06YJHjgNVml2QtgffMXPLWscMxR8++cTXYnQUhON+hV7z\n29NQ1akLf7HIcasxEQWdAQO3w8nckZB4L9jYtGd33Fb8AqAr+T0vPBOUEtbZ\n+i6jydB0/+q+V2ITmWRayPPeXU3Fx/wG4MZj+s7Uf8O3QUuJ/qCO3v5qc2PX\nBXceDFAsL3bpZUNSKjjGVoQ0EEcgQEy6TPHcFx6ULpJ/Ja3QErfEGTsbFmkR\nICwm\r\n=dj1n\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFVmWdtNj+XuwCSmoCEYkzwtfrFm89zHqnJcWfS10D9EAiA0inuV90MyWZAR0QNbUfuJPL6F07pFNyI/8sE9uDcDjw=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.7e72b66d.0_1611358008036_0.88301047647829"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.a6d6a1e7.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.a6d6a1e7.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=10.0.0-canary.07deaec27.0","@material/line-ripple":"=10.0.0-canary.07deaec27.0","@material/mwc-base":"0.21.0-canary.a6d6a1e7.0","@material/mwc-floating-label":"0.21.0-canary.a6d6a1e7.0","@material/mwc-line-ripple":"0.21.0-canary.a6d6a1e7.0","@material/mwc-notched-outline":"0.21.0-canary.a6d6a1e7.0","@material/textfield":"=10.0.0-canary.07deaec27.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.a6d6a1e7.0","@material/notched-outline":"=10.0.0-canary.07deaec27.0","@material/ripple":"=10.0.0-canary.07deaec27.0","@material/shape":"=10.0.0-canary.07deaec27.0","@material/theme":"=10.0.0-canary.07deaec27.0"},"publishConfig":{"access":"public"},"gitHead":"24a3d6e567ad7ea6c29b40c2088121baec3a5fc3","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/24a3d6e567ad7ea6c29b40c2088121baec3a5fc3/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/24a3d6e567ad7ea6c29b40c2088121baec3a5fc3/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/24a3d6e567ad7ea6c29b40c2088121baec3a5fc3/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/24a3d6e567ad7ea6c29b40c2088121baec3a5fc3/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/24a3d6e567ad7ea6c29b40c2088121baec3a5fc3/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/24a3d6e567ad7ea6c29b40c2088121baec3a5fc3/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/24a3d6e567ad7ea6c29b40c2088121baec3a5fc3/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/24a3d6e567ad7ea6c29b40c2088121baec3a5fc3/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.a6d6a1e7.0","_nodeVersion":"10.23.0","_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","dist":{"integrity":"sha512-TmPVovAAHrcs0tj+18/5RRtcFpiamOwfki5A1kxrx6rEiIMNZNIdwfexQMj96adU/liGgw34D31b3vpnlAKowA==","shasum":"261ae215da80f69b850515eb908c7566c424a4bd","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.a6d6a1e7.0.tgz","fileCount":13,"unpackedSize":204088,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgC2CeCRA9TVsSAnZWagAAB9IQAIlLONlw1ozitcMz60m0\nAIC5B8UZ7KJng7yAgPDdAgAsa/pM7L2TwcCkazg+eZm41ylsQoxHKkdvB6Me\nUOo/lCxZqYWBbLkEoHifpCg/gIEtxtpVrbgXS/w5Qtpfo++YejxNM/mPpEA5\nqc+1CEaAhIkN+ww2L951jrMVWSCIOCRqufA1mbiE8Imaq9CxUrpxuY7O5c7B\nJvA885eqmQkiPbY6pCIKdzNfTAZyEk4DSwRkYeIEsnFxlQxhG+wJzbMfYVPB\nekwN601pWAREGYIxrb98uxsh0tJDaen6SUi1yIiat0GgH1sz6D8Osot9e0SI\n+fRqO2Zn8WEAzWvXd9eT80UPKxo3Umy8UvfUJUCBIjDaYEbiGTnUK3kF+G/H\n1oNvdKUZGrANARhhdvmTXurbm+9Dl5adH05GrAOmP1jUM/eAMzbbvgzxPSWs\nsyH4m+jkrT/YrkLKIJeXTvjq2+U97T0JTXAS5xgm6fFKTYq/P76W0h/EUQWn\nXtNUvj069j61iLCC0iXw4bKCyDgrW+tWdj4WclEr7rulqcfHVKDCXtE85Ay5\nQHUhARRczsKQeLCuMwCajxx30a4jbJWppsa67Y0Q1WjZV6bv3ypM6c/wgFmC\nfyKhX+7+kPpFeULGBnue6UCb3D5zhIB1nXykjr5Bts49vRZmtFeg/qU68f23\nB+ED\r\n=kjTx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCvwS8YIfPV0jj0JgCKUwTlUdvrGQSiGIYM/coAi1VZ3AIgANbG/TYqhNfpsddB+FAV1c0lToB+V3Ov7+L5pVCFGsw="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.a6d6a1e7.0_1611358365638_0.7922737716151427"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.b95fe100.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.b95fe100.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=10.0.0-canary.07deaec27.0","@material/line-ripple":"=10.0.0-canary.07deaec27.0","@material/mwc-base":"0.21.0-canary.b95fe100.0","@material/mwc-floating-label":"0.21.0-canary.b95fe100.0","@material/mwc-line-ripple":"0.21.0-canary.b95fe100.0","@material/mwc-notched-outline":"0.21.0-canary.b95fe100.0","@material/textfield":"=10.0.0-canary.07deaec27.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.b95fe100.0","@material/notched-outline":"=10.0.0-canary.07deaec27.0","@material/ripple":"=10.0.0-canary.07deaec27.0","@material/shape":"=10.0.0-canary.07deaec27.0","@material/theme":"=10.0.0-canary.07deaec27.0"},"publishConfig":{"access":"public"},"gitHead":"229d3b172620cbdd5deae4cb60852f0ad2d4671e","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/229d3b172620cbdd5deae4cb60852f0ad2d4671e/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/229d3b172620cbdd5deae4cb60852f0ad2d4671e/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/229d3b172620cbdd5deae4cb60852f0ad2d4671e/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/229d3b172620cbdd5deae4cb60852f0ad2d4671e/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/229d3b172620cbdd5deae4cb60852f0ad2d4671e/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/229d3b172620cbdd5deae4cb60852f0ad2d4671e/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/229d3b172620cbdd5deae4cb60852f0ad2d4671e/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/229d3b172620cbdd5deae4cb60852f0ad2d4671e/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.b95fe100.0","_nodeVersion":"10.23.0","_npmVersion":"lerna/3.22.1/node@v10.23.0+x64 (linux)","dist":{"integrity":"sha512-Jj9BdFXcMR4Gr65wmS5F5sY8ry7GJJYKK2OlSCjwGJEDT0mszVOl/CEsZNdCUTb36pCGBvevaDayhyyuxZyMXg==","shasum":"588bf4ea6cfe29d6967a29d76c862dff440f8de8","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.b95fe100.0.tgz","fileCount":13,"unpackedSize":204088,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgC2UVCRA9TVsSAnZWagAAIO8P/1gdB/cwy9NbPEnfgi2e\nWFoYYjdhNkwx11VqS+wl42ywyTHjPGFb06Q8sHGWuO0ZhhA8llJEgUnV8Qzq\n1i5DrFvvOtp/LCIZkR7l7BDaCRp4ACqwTD2kPpoMfST3U8vjmJuEBrE2N4y8\nx6osnxwna7K4n641rsPS7IOSTvWj8D1z6PSkvDSwP0jTU6It2eBDn9ikl73j\n1+uq5xUhNKTQYrBEbNiqvssNuLkexagCb6TMWaqYdhYY/scj57tJC5sWX1vc\nGP8wdADplcuTQoeeX+PS38ZGvwhBLOUZ/7wD66h+0FDzyPHJpMg2S0mozY3u\nLBurDvNp58dFZy/Ul+loMSwnZVZvj5tiXyKOapXzT0FqIzqfbywH2zbqj/ih\noGs2eV+m3Cg7DvDsSSDEBklpG2NdXATOrwqoj79LKtANUu6jb9FNVcfo/xxS\nMs3Ohu0y5W6AypZYxXWKD019PUAZYf7wse8xZXixc4Lyj0Fixnml0vScQUaW\n61g/ahHWF0WYuYztJWxaPQErMiluLK62PI7NMd9VLdZJB3W68ypVrbRKaRNU\nHRdak4/2ydHY0bto5FLcvwdLafEKVHfiTjj2tyt/JVr1/ZF3yzbHKcw+J/vl\n77x2nCkJlyxWHZGxpMGwzX5RBNZNmtQ9I9250GgYlvc2GNO1mAmLpY9v3xhA\nWB0K\r\n=witq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDpNpNdku4txesrCznba481uGg4VKjQKkE4++ZhsGvtMAIgMZozgxy9EuGJ9ENb+QUsdQNLo/Cvt6gDy91FYKrokWc="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.b95fe100.0_1611359509054_0.6120375877034214"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.c8797192.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.c8797192.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=10.0.0-canary.b9adb7a0f.0","@material/line-ripple":"=10.0.0-canary.b9adb7a0f.0","@material/mwc-base":"0.21.0-canary.c8797192.0","@material/mwc-floating-label":"0.21.0-canary.c8797192.0","@material/mwc-line-ripple":"0.21.0-canary.c8797192.0","@material/mwc-notched-outline":"0.21.0-canary.c8797192.0","@material/textfield":"=10.0.0-canary.b9adb7a0f.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.c8797192.0","@material/notched-outline":"=10.0.0-canary.b9adb7a0f.0","@material/ripple":"=10.0.0-canary.b9adb7a0f.0","@material/shape":"=10.0.0-canary.b9adb7a0f.0","@material/theme":"=10.0.0-canary.b9adb7a0f.0"},"publishConfig":{"access":"public"},"gitHead":"42b37fcb3c5c8e4488b44daf72e5e374bf0e2e75","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/42b37fcb3c5c8e4488b44daf72e5e374bf0e2e75/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/42b37fcb3c5c8e4488b44daf72e5e374bf0e2e75/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/42b37fcb3c5c8e4488b44daf72e5e374bf0e2e75/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/42b37fcb3c5c8e4488b44daf72e5e374bf0e2e75/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/42b37fcb3c5c8e4488b44daf72e5e374bf0e2e75/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/42b37fcb3c5c8e4488b44daf72e5e374bf0e2e75/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/42b37fcb3c5c8e4488b44daf72e5e374bf0e2e75/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/42b37fcb3c5c8e4488b44daf72e5e374bf0e2e75/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.c8797192.0","_nodeVersion":"10.23.0","_npmVersion":"lerna/3.22.1/node@v10.23.0+x64 (linux)","dist":{"integrity":"sha512-aFT9yas89aivP/KeVJ9Q/3eR9xJY2jiwix0PcdqRo6NVGgJPnrqI8DsBsCI+/UQrzlEjPzEjW7u+vR8PGvqZbw==","shasum":"7a17e8f758fa34d0f3dfc98cdf7515a31f6daa9d","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.c8797192.0.tgz","fileCount":13,"unpackedSize":204088,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgC2iwCRA9TVsSAnZWagAAx64QAJP65Z/snYy9sncVXYtu\n4+x9JJ4gKiuXGTF0RCspjlihxg48T2gOVZKJ7mEU/MKnXdwGO1Vpbk++FYY8\nFO8CIYl/eqJ14VDkHbHlECm2I94uK5yEb1Lprbo1TIWgXq+76eq/Ii5AhLMy\niU5oAx7PWlX2zL8THfVrGQXg2A9Ccb3AgYCl4JpXuK9QnT86BmYpO2Zp1qxl\nDeDPxQqs3p4eX8Y6B4Ues47f/T0FE3NiVg56Fl0atV94lMOK63aNB/m5OCS4\ng+J8ChqjJpRmYu9VDKlZHdAANzEOyFM1Y+FsejWWFOoAofFGSLjICe13xhTH\npzluIojZQdJtIyMtcClSNwacuRZs49QghkvpcoS1kcJOTk6tdy8bQa+pUyKm\noi2NRS801IpRLq4N5VUzcPPw1SeJMRB2HIyZ6Lp8d59fxCCX7faKulYnPZ64\nE8i4uPm8FyI/RG5hywS4PJ0fwkiCsUPHl8L+vHKXFZaBuiUKIHHKyXicZ7WX\nM4FDKb40QgNb4SqzBX2z0tD3Zg6r2iKOZr2YzT/reKcbKaWsVLV/q+W1+qOU\nbs8j1fXSVHsVps0hOnz+UuuRIsCva9uSHXrbouTNtWZzrYnzGXak0yHfN8ER\nskEkiSNRRZZwf3Tp9ZZCB535+1PT9ClilLw3URlgXOu4xwfDcEFEgxm1G/Vw\nldDI\r\n=rD6v\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCyOsfDRT5NpuK6nqoLVUGIfaRR2OyOH/kuXW3xL+kowAIgFg10u93KhrSjNviTIQZHFPPHTE8bO95rJxPOdvV0Qno="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.c8797192.0_1611360431766_0.8735578279097445"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.946f5563.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.946f5563.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=10.0.0-canary.b9adb7a0f.0","@material/line-ripple":"=10.0.0-canary.b9adb7a0f.0","@material/mwc-base":"0.21.0-canary.946f5563.0","@material/mwc-floating-label":"0.21.0-canary.946f5563.0","@material/mwc-line-ripple":"0.21.0-canary.946f5563.0","@material/mwc-notched-outline":"0.21.0-canary.946f5563.0","@material/textfield":"=10.0.0-canary.b9adb7a0f.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.946f5563.0","@material/notched-outline":"=10.0.0-canary.b9adb7a0f.0","@material/ripple":"=10.0.0-canary.b9adb7a0f.0","@material/shape":"=10.0.0-canary.b9adb7a0f.0","@material/theme":"=10.0.0-canary.b9adb7a0f.0"},"publishConfig":{"access":"public"},"gitHead":"56b8a23ccbe326cdce0b3b9f5d1fd5c5f5f68f91","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/56b8a23ccbe326cdce0b3b9f5d1fd5c5f5f68f91/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/56b8a23ccbe326cdce0b3b9f5d1fd5c5f5f68f91/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/56b8a23ccbe326cdce0b3b9f5d1fd5c5f5f68f91/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/56b8a23ccbe326cdce0b3b9f5d1fd5c5f5f68f91/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/56b8a23ccbe326cdce0b3b9f5d1fd5c5f5f68f91/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/56b8a23ccbe326cdce0b3b9f5d1fd5c5f5f68f91/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/56b8a23ccbe326cdce0b3b9f5d1fd5c5f5f68f91/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/56b8a23ccbe326cdce0b3b9f5d1fd5c5f5f68f91/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.946f5563.0","_nodeVersion":"10.23.0","_npmVersion":"lerna/3.22.1/node@v10.23.0+x64 (linux)","dist":{"integrity":"sha512-arNKlgBfVMySv2hQD1u++HXUQfr64cZ91gzUYr7+eMklsGZY9m7WWDwyQCMslBb//vv9ZdBYe+YVyJ2glugRTw==","shasum":"0ed97d1326f96e5f2b27ffdddf6294214e238287","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.946f5563.0.tgz","fileCount":13,"unpackedSize":204453,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgC3EvCRA9TVsSAnZWagAARSsP/RU8b2kc9VKrbne7gwOW\nuS13WN/HRkjHQowuEx0IXUurDhwHFl3caZYse82c5uFBddKyU2Zx9kdC3h6N\nOe3MdoSqIK09O4c7nM2x9xwqnQaAlhlP5s16tsd3jVwUqiQKwZqoyOHuX0NO\n0pR/FU7zIkml+bit3d8cDWsX9lfVcpOczQDaX68xhxj/12UMtUCVA2aUshNi\nX7uRb8dQX3pfqJudcOmQp3vAULJoCBWniHNPc91VadwhKb17nDpjKvyLDMB4\nopszpXwZCsnDIODCEDIRbkS8lo621pCMvdYeyqX6lj2wAyK3vdC0mrvQd0mK\n1nZGZMVafJOzhTGqAyhRqulu+sKsqZYDUePT1x5UnR2hvPiQV1pJNGzB11si\n941XcY4Z/6XoTnHHQLA88/1bzzYhc0hiUISClhO95JoFVI66IvTpLKEa4Alm\nJVRV44M3kEB0tBaCxTFUwUFx+ocNa6v3BRAwhANw2EqQDkRSE7SgS3O86W2S\nAC3AIWTjluEXFMtH0jMnnr8T7xyReHhDguGB2FqV/Z/eBAdQIr0qnFiiJZ4S\n4XPitCdwMycaAmzGDy+CwLOMQ+x/xvejKRg+YN+KdDqKCaiL/Y7kiSzfdXsh\nOIe1TV96ew8gUqFkHjPoWyJmwXJXi9fURu4mgiuRXOuMDm3F9nNBJJC1jGDq\nWbum\r\n=Wh5K\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAbtjWxP9PIXOO+1SUrzairrzRFlZNKzocHa3vHktsoCAiEAxHqpb/Agh3TDdKpz6ITf/6+a3zb9+lLaqTodMJCSVmQ="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.946f5563.0_1611362607513_0.7270645551995405"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.43664f0e.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.43664f0e.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=10.0.0-canary.b9adb7a0f.0","@material/line-ripple":"=10.0.0-canary.b9adb7a0f.0","@material/mwc-base":"0.21.0-canary.43664f0e.0","@material/mwc-floating-label":"0.21.0-canary.43664f0e.0","@material/mwc-line-ripple":"0.21.0-canary.43664f0e.0","@material/mwc-notched-outline":"0.21.0-canary.43664f0e.0","@material/textfield":"=10.0.0-canary.b9adb7a0f.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.43664f0e.0","@material/notched-outline":"=10.0.0-canary.b9adb7a0f.0","@material/ripple":"=10.0.0-canary.b9adb7a0f.0","@material/shape":"=10.0.0-canary.b9adb7a0f.0","@material/theme":"=10.0.0-canary.b9adb7a0f.0"},"publishConfig":{"access":"public"},"gitHead":"62b7e6f595b2e13e2e57bd8f8f56ec11405ee0f5","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/62b7e6f595b2e13e2e57bd8f8f56ec11405ee0f5/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/62b7e6f595b2e13e2e57bd8f8f56ec11405ee0f5/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/62b7e6f595b2e13e2e57bd8f8f56ec11405ee0f5/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/62b7e6f595b2e13e2e57bd8f8f56ec11405ee0f5/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/62b7e6f595b2e13e2e57bd8f8f56ec11405ee0f5/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/62b7e6f595b2e13e2e57bd8f8f56ec11405ee0f5/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/62b7e6f595b2e13e2e57bd8f8f56ec11405ee0f5/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/62b7e6f595b2e13e2e57bd8f8f56ec11405ee0f5/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.43664f0e.0","_nodeVersion":"10.23.0","_npmVersion":"lerna/3.22.1/node@v10.23.0+x64 (linux)","dist":{"integrity":"sha512-AetCy6oLEsA9KArbX3NAdq79s9r1S8DMBvWqFHIBiNyLQaboLNVaBtCEOAxe0EL7uMLfaFOsEBxvWliw64uRqQ==","shasum":"e121fff5afc224b6c4e5075511a6411892509bfc","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.43664f0e.0.tgz","fileCount":13,"unpackedSize":204453,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgD0jACRA9TVsSAnZWagAAaMMP/1FfRyZQuCpVZWeWgbf8\nqz1jiVJ+BkANguDRwT3QQ5x3RYu3zHxXGclHtDdMMDlDPQxrIWgldD8znCDn\nIEPiiEGq6/7GsftnGhD2iTWe2g9nO228SMRnNlLdfigH+XKsnjeNChjojvtD\ntkH7S9Rg/kJm0khvuZEUXBqXgfbnd5lJI4ZWNI1g40WKhH2RVASNslG3XbBC\nn+vD8Tv7J6IZJ1lZmeWiQ+5NDcnzMoycMlwO2DEYF9myPv57ZP1f570Of7CM\nkFrLzmDatJJ4+nZ9GivABjSHgiEkG8kol9v0XVGn1j2OR8FMkDovdwyrsbo+\nFXLeZMKmQQf7bCTVkOHRftZAmSC2clNJkWPXN+zLTizAAHJN7SlwX/xXOM+C\nUUur2/003STAvSRXRmM6pPfp2uNOD/XbZwR1jqZIcLO9wkLUyFwAZY0XCLyJ\nAnziAMXQQnPcenlUZnnfBbH4EAKPMjuqbAMBIzjVf+X7b07fDZngBivGUBnD\nVT70eoILvzTezOAGMNgpXtWIIFpGvWlatUxUE/XfrPzNz+Bw9LAhEKpL09bO\nw5XPAaFdPZmgBJs6jmC0yW9rqRrwtFxifOl+8ZWE7RIWydN8H53g7hKYUoMz\nKXqy2fwy80eDw1Nb6arvdIqqfJ2AVQ0Xb8+E2AnJ5CDkkUnO+i+mhaRSdqzs\nPhTs\r\n=WlDh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDNmR5VIN+3qo/PQ/VXO0ZAuo1D7SXL+Ng1kOQNRiZUKQIgDMjIUkjTTxiu547ZS89pax9zUuQqJA6sQ07DrMwcA0g="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.43664f0e.0_1611614400490_0.7767807563617026"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.2e769e3c.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.2e769e3c.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=10.0.0-canary.b9adb7a0f.0","@material/line-ripple":"=10.0.0-canary.b9adb7a0f.0","@material/mwc-base":"0.21.0-canary.2e769e3c.0","@material/mwc-floating-label":"0.21.0-canary.2e769e3c.0","@material/mwc-line-ripple":"0.21.0-canary.2e769e3c.0","@material/mwc-notched-outline":"0.21.0-canary.2e769e3c.0","@material/textfield":"=10.0.0-canary.b9adb7a0f.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.2e769e3c.0","@material/notched-outline":"=10.0.0-canary.b9adb7a0f.0","@material/ripple":"=10.0.0-canary.b9adb7a0f.0","@material/shape":"=10.0.0-canary.b9adb7a0f.0","@material/theme":"=10.0.0-canary.b9adb7a0f.0"},"publishConfig":{"access":"public"},"gitHead":"e3a3fae1109be58444840f6099c0f87c3966367d","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e3a3fae1109be58444840f6099c0f87c3966367d/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e3a3fae1109be58444840f6099c0f87c3966367d/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e3a3fae1109be58444840f6099c0f87c3966367d/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e3a3fae1109be58444840f6099c0f87c3966367d/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e3a3fae1109be58444840f6099c0f87c3966367d/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e3a3fae1109be58444840f6099c0f87c3966367d/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e3a3fae1109be58444840f6099c0f87c3966367d/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e3a3fae1109be58444840f6099c0f87c3966367d/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.2e769e3c.0","_nodeVersion":"10.23.0","_npmVersion":"lerna/3.22.1/node@v10.23.0+x64 (linux)","dist":{"integrity":"sha512-Q9sCjJz+2xbgA+HZSMeN5+tQ5vas3bZk3G6lnfkcb58p8rWw6vxkMyI9lu7bdme14Oa1CoBqX/vgUNMMe4irwg==","shasum":"b467e66e1911cc33b7876d34c6268b0f29e0b7d1","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.2e769e3c.0.tgz","fileCount":13,"unpackedSize":204457,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgD1z1CRA9TVsSAnZWagAA1FYP/3hHB6LaSET3wnzQx4Yf\nfFBeSbOqerRgs06ixsNIgTZyFP2vgxGIqv0SwL7gXDTiXvwS8sva0KxUpY6/\nDkwj+sbNYonr6Fbqh9zGM6QwgGy+i+wTMj5wrAZ5C5LoouJ+jd9fKtUPzSv5\nQGkSyg2Cpk+tsAHqvLpEIzxVyVy0v/kgs5XOiVQ4UEdMwUkZ1hKWzH3kyccs\nQ+NOZ5QbvdHaWMeCsBZzA59FD6BOv0M+AvnL1rUpbVg+izhHGt5Mmi280+ZA\nxh6MA2jiJpDFKz8a+rosEbVfOcCzrBaX/yw7TbjfbwciuLvdjDAurq/+IGPh\npjKNTDViDU1KekHh1qONSoJQHQGzpqUvz2AOz9TdtQNZgLiXt8ul+FHyGUXs\nX2mweHp8jQX6zI3DpWIgLBzqZl0R+Xv62PRs+HnhrIa6cd8Me/bskFKHJdEd\noFa7nQvwVk1L4Zvx+ISreJrZAuRPB/pQTZma/ACKUtIcOhbyz758lXUwpYSs\nRt9IMVNR6/ZfO4m1XFy+64rDHrbffcRChy9wtJnWl1hELDHDunrpxpT9ylvf\n158YdrDqyPZhfZ3JVjHyfIni9DVIsOn/60jtTozEiGzfZtIIHGvTmMGKI+4b\nUvkJlJaUNv28IAQZMW39XZ0I+p1m4lKNBOZsMbu6AKAqaHxCiA0OdgDJjmCZ\n+Ii/\r\n=h/t6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCv7ORe9KkwkOMQNnH7/9x9q4Q0+kn5wbIN2XcVNefXDgIgK/Ag6DC6CjHc6CqEbumwk9lPgG/DJrqoZn20/9bB6uQ="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.2e769e3c.0_1611619572868_0.7883126277123553"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.14e01610.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.14e01610.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=10.0.0-canary.96878e1d0.0","@material/line-ripple":"=10.0.0-canary.96878e1d0.0","@material/mwc-base":"0.21.0-canary.14e01610.0","@material/mwc-floating-label":"0.21.0-canary.14e01610.0","@material/mwc-line-ripple":"0.21.0-canary.14e01610.0","@material/mwc-notched-outline":"0.21.0-canary.14e01610.0","@material/textfield":"=10.0.0-canary.96878e1d0.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.14e01610.0","@material/notched-outline":"=10.0.0-canary.96878e1d0.0","@material/ripple":"=10.0.0-canary.96878e1d0.0","@material/shape":"=10.0.0-canary.96878e1d0.0","@material/theme":"=10.0.0-canary.96878e1d0.0"},"publishConfig":{"access":"public"},"gitHead":"0794659aea627aa04b2ec37e3f0e8cd9d976ae8a","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0794659aea627aa04b2ec37e3f0e8cd9d976ae8a/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0794659aea627aa04b2ec37e3f0e8cd9d976ae8a/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0794659aea627aa04b2ec37e3f0e8cd9d976ae8a/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0794659aea627aa04b2ec37e3f0e8cd9d976ae8a/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0794659aea627aa04b2ec37e3f0e8cd9d976ae8a/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0794659aea627aa04b2ec37e3f0e8cd9d976ae8a/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0794659aea627aa04b2ec37e3f0e8cd9d976ae8a/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0794659aea627aa04b2ec37e3f0e8cd9d976ae8a/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.14e01610.0","_nodeVersion":"10.23.0","_npmVersion":"lerna/3.22.1/node@v10.23.0+x64 (linux)","dist":{"integrity":"sha512-BU/6tyaGuQigfjVDeHzJv5jyZgT0RzUlxBjsfOA76GUWppgML0IijhsRGVw1oZUnBOfhCHU0uGsxY2kfEWpEZg==","shasum":"77b700b4a7e596366297fc0f422d13633c5c9876","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.14e01610.0.tgz","fileCount":13,"unpackedSize":204457,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgEcQ9CRA9TVsSAnZWagAApb0QAIKuApVZmCEuu59GB0KL\nNRaQyePLZ71j7FvmRSqwnnVAu3Es4ggp4bbtyAWYtELOnTyNBUGrzJYu8xMr\nLSaO7ivcaiNEUPIFM4kxOUfcykE6Byqovf5bZU3yw1TFXOs54jc3wB6GIH4S\nA6no5cBYZsYLbDNHDH+eTo2nEhd6G1/8Fia8pu0w13TW4QwUHoCaIIqxrC7x\narXpZFsxTH7r1H3fN0mI2BED8jlm0QSLkfL4GK733YPzeAUaNRUoeRzAW/C7\nx7Enujoz87+/bZ4rsdtnLS3YrvkDDTbkOOznX6mUrERecg7zPZN6WKZp4t0+\nBCGuvd7+hvuPrWqI0zwJo0imQx8K/OriHKts+VNBlpLw88UfTfeTjjYstn0d\nCkTbI7tbVkViGW752ew+qNKok8xDeQ2iXTVuh2QN82GEb64xQHFw4H3dZSeo\nNgFFxM/gM3j5qmZjMkeQB/cK4qGiR9w3L9N4ns7ohZp1KfbxcxazqHfTElKH\njZ5YH3iw3Z9sJCXpyESkD6Mb2a0kd+567B4rPJNWXNJMkP22RWTjMWKtWxSV\ndVw2czcZ082FyMi1jbzuvzdj1sM+Mw9zbl1e3r9lmPY5Gu09zhHgXBUbbVhh\nGVGCj+Qa+LfJ1Fv2tfYU41mv/VUuTMV61APNRmN65cbjOM78eJI1TZyw6N0x\nlWF7\r\n=oHEV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCxa9Ae7fd1jCc8HXi+oWYaVqa794zEY50D55/RUu6shgIhAKrPxOIX5SraHoR5OLNVToyAb+pvGQzRRRq7f7SJw8xG"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.14e01610.0_1611777085057_0.8675686236050386"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.5de00c1b.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.5de00c1b.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=10.0.0-canary.96878e1d0.0","@material/line-ripple":"=10.0.0-canary.96878e1d0.0","@material/mwc-base":"0.21.0-canary.5de00c1b.0","@material/mwc-floating-label":"0.21.0-canary.5de00c1b.0","@material/mwc-line-ripple":"0.21.0-canary.5de00c1b.0","@material/mwc-notched-outline":"0.21.0-canary.5de00c1b.0","@material/textfield":"=10.0.0-canary.96878e1d0.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.5de00c1b.0","@material/notched-outline":"=10.0.0-canary.96878e1d0.0","@material/ripple":"=10.0.0-canary.96878e1d0.0","@material/shape":"=10.0.0-canary.96878e1d0.0","@material/theme":"=10.0.0-canary.96878e1d0.0"},"publishConfig":{"access":"public"},"gitHead":"65f40b8130ec795f2a349c0699be5b3038a9c32e","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/65f40b8130ec795f2a349c0699be5b3038a9c32e/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/65f40b8130ec795f2a349c0699be5b3038a9c32e/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/65f40b8130ec795f2a349c0699be5b3038a9c32e/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/65f40b8130ec795f2a349c0699be5b3038a9c32e/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/65f40b8130ec795f2a349c0699be5b3038a9c32e/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/65f40b8130ec795f2a349c0699be5b3038a9c32e/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/65f40b8130ec795f2a349c0699be5b3038a9c32e/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/65f40b8130ec795f2a349c0699be5b3038a9c32e/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.5de00c1b.0","_nodeVersion":"10.23.0","_npmVersion":"lerna/3.22.1/node@v10.23.0+x64 (linux)","dist":{"integrity":"sha512-vLRh/o2MFehizsWsLIeK3BNwpFpaNe8UZgWX5s9msB5qJj3GmpDWz5q7ijbUafwMGPoL5V0iqVbp5iXkIWexVQ==","shasum":"a528c3c423e51c19b65e1f04e76ef1c155c6a13a","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.5de00c1b.0.tgz","fileCount":13,"unpackedSize":204457,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgEcpBCRA9TVsSAnZWagAAg6IP+QCXO2cfRR9Ew0drVYBj\naUeSfhFsiIIu7r/kv12MriL8q3ikuFM/Tt9OyAGCtlPX4noO0WFvvNya4mar\nB1QkdTNO1j+uT+DW0Ns+/UTkUVJiKHX6ZwXbhuHEHXD1O+x1J5rJy1KqGt1A\nDG+CWSHqgUjLCnvTA+Mi6GaSIQJrzkxcAQF6QRcCRbTCkREgglvXeNbVYTSI\nLfjpAzxn788FSOT7R3dNjtwwsmG0k/f3+ElpOqaWT8Uw8XdWfTc9D/dJfCNt\nznQ5HwG/fOJm3SJ6P65FG3DGFdZnUVzuu4oNRDeD4Dkeh6xP+tcVIRx4V0MT\n8VoKZsvtxLyuI3HyfmTFiARs0OCK7cfdfR/es4e8/KHIJOwoPanSXjhwnJjs\nkQS58zsyAgHE3yKElfWTo+QpLBAYnQ06fEBsE6UsFTwIOgwsj32hgqBIxIyB\neO/6tM2JLlFqYafGinEMuXnvkERPc+iYu5Wp8+Gt4HLnZpAkZiEPEsAtsaE1\n6G+6mu7t8/LkY6lzWCfRLoqxC8Rmtyf9uXg6OAP5IMBUlxCvCDYnN9rF6LVV\nz74cGikoUr9C3C3sUmSsnWXcfqCqNXeJ4vlnaUOiiI1hFI10zWnXTHyc9bSK\nteSCZwbua7YI+XDGhWR782oe1TFz6nUIkutxH8S4nTZNuGS2278ShCIgNC1K\nEGfD\r\n=sEkf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD1CEy5IDproneClKQ8bjgzkqnSa/3xQ0dr9PRN/lhRSAIgcmjUjMhDu30onCqbqcIBEy0JgRWKUuHuGL4upfXv0m0="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.5de00c1b.0_1611778625098_0.30240121989326685"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.5a328336.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.5a328336.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=10.0.0-canary.96878e1d0.0","@material/line-ripple":"=10.0.0-canary.96878e1d0.0","@material/mwc-base":"0.21.0-canary.5a328336.0","@material/mwc-floating-label":"0.21.0-canary.5a328336.0","@material/mwc-line-ripple":"0.21.0-canary.5a328336.0","@material/mwc-notched-outline":"0.21.0-canary.5a328336.0","@material/textfield":"=10.0.0-canary.96878e1d0.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.5a328336.0","@material/notched-outline":"=10.0.0-canary.96878e1d0.0","@material/ripple":"=10.0.0-canary.96878e1d0.0","@material/shape":"=10.0.0-canary.96878e1d0.0","@material/theme":"=10.0.0-canary.96878e1d0.0"},"publishConfig":{"access":"public"},"gitHead":"d5547f58c69336881e54d7463a7f7d92a04b53c7","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d5547f58c69336881e54d7463a7f7d92a04b53c7/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d5547f58c69336881e54d7463a7f7d92a04b53c7/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d5547f58c69336881e54d7463a7f7d92a04b53c7/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d5547f58c69336881e54d7463a7f7d92a04b53c7/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d5547f58c69336881e54d7463a7f7d92a04b53c7/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d5547f58c69336881e54d7463a7f7d92a04b53c7/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d5547f58c69336881e54d7463a7f7d92a04b53c7/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d5547f58c69336881e54d7463a7f7d92a04b53c7/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.5a328336.0","_nodeVersion":"10.23.1","_npmVersion":"lerna/3.22.1/node@v10.23.1+x64 (linux)","dist":{"integrity":"sha512-z7Ujay2T4Yy70xuvwzQhGwX5O185fsh0eWPfkP8opMEsMJHB6rzMExke5KuXN40YLJ4ModsOsoXiUVAeC+ejvw==","shasum":"82b45a7b686b85df99fb449e4c08dccacffe0315","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.5a328336.0.tgz","fileCount":13,"unpackedSize":204639,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgExZ9CRA9TVsSAnZWagAArEgP/AriJFeFqrylIDRVRGTz\njC7MPh3xGoe/vndUl3TUCNRgyj5ZBd98eVrxBAUvfi9qQIo5XrN/R/12iZcm\nu0oUf67UhfsqqoADqKiSZReLdXUUJLJu7Pp/UdpWgBFLcqy/lLuwz6UjjTvt\nIH144+FbSdF+E4se0s64qVfM4JEzmGHqp+jPYThcwdP5q6hj+mxWbT58nita\nT4fX1tL5nvsZrtjgxDMNreqisqoolrwgNboiesdoWxFjEii6n02soLnhxjpZ\n4twzdEVGqO35nm+cwiNNtWUhSvxKalOeYdu2zHVJhRAiChtQNF7OlgBky+re\nERbpNN5wK8RLwvfrjYZ32+wPATczacLTS3h9i9HvPbjQTsMKE2WitYwVLdmg\nAnvdaFPbC+TSS0Nz3wFTLHhygbXjfRZdgKhzf6KOOu2K41qyaRrmVI5u8IVv\nHwpZCoMLwcF7O92d1Oiwzo+b4+ep06oazB2JioTg+Tw//caCNlwUlKAgnHKs\nr60/XfbgaybCcDFvvq1gVCRTRZbnA5DbnAr0xvQWppLnPULcevbnCvdxeawW\naYREoXQud2oqfxS/GXj6UKa1cWN8fbHZRu9ziR7dutnqpI9LF8SOLPjjBbvF\n3tbDq7ZsohGXhFoiFvAfqCQOiTLpKV2hFPQDS32GdMPOeagrEzoNByuloJUE\nHch7\r\n=SaTd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCm2pCodXXtiwsdjS0YS6bQ413HUBIXvj2y6q76ff82pQIhANLBvso9KidzYXrLFrrg14FNA3nX46wyGByemkeq0vIR"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.5a328336.0_1611863676689_0.8645949718025363"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.533b1251.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.533b1251.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=10.0.0-canary.96878e1d0.0","@material/line-ripple":"=10.0.0-canary.96878e1d0.0","@material/mwc-base":"0.21.0-canary.533b1251.0","@material/mwc-floating-label":"0.21.0-canary.533b1251.0","@material/mwc-line-ripple":"0.21.0-canary.533b1251.0","@material/mwc-notched-outline":"0.21.0-canary.533b1251.0","@material/textfield":"=10.0.0-canary.96878e1d0.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.533b1251.0","@material/notched-outline":"=10.0.0-canary.96878e1d0.0","@material/ripple":"=10.0.0-canary.96878e1d0.0","@material/shape":"=10.0.0-canary.96878e1d0.0","@material/theme":"=10.0.0-canary.96878e1d0.0"},"publishConfig":{"access":"public"},"gitHead":"b88cf0e2eded50fb9a839a426059ff1f8242a490","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b88cf0e2eded50fb9a839a426059ff1f8242a490/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b88cf0e2eded50fb9a839a426059ff1f8242a490/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b88cf0e2eded50fb9a839a426059ff1f8242a490/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b88cf0e2eded50fb9a839a426059ff1f8242a490/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b88cf0e2eded50fb9a839a426059ff1f8242a490/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b88cf0e2eded50fb9a839a426059ff1f8242a490/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b88cf0e2eded50fb9a839a426059ff1f8242a490/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b88cf0e2eded50fb9a839a426059ff1f8242a490/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.533b1251.0","_nodeVersion":"10.23.1","_npmVersion":"lerna/3.22.1/node@v10.23.1+x64 (linux)","dist":{"integrity":"sha512-EJVhaToOJK4niiqbItaRNi/tnqOhosHI32OrSBGMp3xFj6NGT9aQR1fN7Oey85stY0haOsf704q7+3Yg3kTB4w==","shasum":"1034396946730717f6f0c9c4a579bdc5805bc33b","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.533b1251.0.tgz","fileCount":13,"unpackedSize":204639,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgFCWpCRA9TVsSAnZWagAABaQQAI7sXF410kSWfDp47fqL\nvgEwKgNzCilagmJzdUQEBk4KvgbmCP6hZ6l4fCs/dOqB++VGwZNeFj+dzmZL\nyZE+hgq2lA3hFhbXBTvUf269eHeTSwDb7ojb1gAfHjIy5AQId3b9CUL37jo4\nE9LkbX0U0WN2HvpfQcCec2bPlC3x0G5Nf8Nbn/NXrIaqhkaVFkK4+No9D0fP\nGZ+kafQGLy92k3Rqy5CdUP2t/l/gvO0yw6y5iGXQPJ1wFdsNQTTJvMIhAqBg\n4c60JPg9YOkrDXlr8F/NwEE1H5HcrRhfk7odWqwohTT+wKhAS7dWflNSwAyq\nBB8hX7I05uwRmeJ2UO187TalE3uFnJnLsdFfEUxkEYlm6oESrd2V/CuuBYn7\nXiyJDK8DpqN/L7PoxJVXoiynn55HF//+ykCa72xxKWVnif1K4Zn+IlDaufBg\n9EvVdXalwnfLqXH5UqjOB/MQKUUs3ElPAoS3XxMLTRPrg+z+AgDghSfki9Zl\nasjWvGmWG7nIMBiLxgGCpiFoEhppiY7u0HdCH5LoZcp3gncRcwWAAjhmmPk+\nliYNnLz7kT4NjOfTGAq5tKrY8COvb5yxeeavbF9/FQ81nlVMRn735lRka+j2\nN+nyZlrRXlEhBLHteM606DIaOFNp6SQaCwCFdbKnN9qwBKiCDjWgdJctlKCv\nN5QY\r\n=mSSR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGi2BdJ55RxkMNC0MVfh1UclBYRQ8pwOrREmcbc3lyrUAiAYR7LvxJIhOR4Q0YQUKReb+h6P41/aAeiVIrGi7sJmpQ=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.533b1251.0_1611933096560_0.3825318079778248"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.ab5c0a10.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.ab5c0a10.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=10.0.0-canary.96878e1d0.0","@material/line-ripple":"=10.0.0-canary.96878e1d0.0","@material/mwc-base":"0.21.0-canary.ab5c0a10.0","@material/mwc-floating-label":"0.21.0-canary.ab5c0a10.0","@material/mwc-line-ripple":"0.21.0-canary.ab5c0a10.0","@material/mwc-notched-outline":"0.21.0-canary.ab5c0a10.0","@material/textfield":"=10.0.0-canary.96878e1d0.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.ab5c0a10.0","@material/notched-outline":"=10.0.0-canary.96878e1d0.0","@material/ripple":"=10.0.0-canary.96878e1d0.0","@material/shape":"=10.0.0-canary.96878e1d0.0","@material/theme":"=10.0.0-canary.96878e1d0.0"},"publishConfig":{"access":"public"},"gitHead":"2809af58a44d479ea0c8000c34c546f525921004","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2809af58a44d479ea0c8000c34c546f525921004/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2809af58a44d479ea0c8000c34c546f525921004/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2809af58a44d479ea0c8000c34c546f525921004/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2809af58a44d479ea0c8000c34c546f525921004/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2809af58a44d479ea0c8000c34c546f525921004/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2809af58a44d479ea0c8000c34c546f525921004/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2809af58a44d479ea0c8000c34c546f525921004/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2809af58a44d479ea0c8000c34c546f525921004/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.ab5c0a10.0","_nodeVersion":"10.23.1","_npmVersion":"lerna/3.22.1/node@v10.23.1+x64 (linux)","dist":{"integrity":"sha512-hi9HmNNFUBKqEHnHpZr+vUeOxQMnFQWlgdHpb1yrE2tml2iqU1EoSuKqjJ/itFBwM1Dxz+B1WehJ+TpHl0xDEQ==","shasum":"6bcce86034fa4da5aa0b7b27e9cabd77d2bc8bbf","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.ab5c0a10.0.tgz","fileCount":13,"unpackedSize":204639,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGbNUCRA9TVsSAnZWagAACQYP/jaef2Dvfhhq2KL7vHXP\nQTLqN+zUtDb9Gdep57QZViJRtG2et+gxL0pcMeBgUoTfGnhp3lyK/WBosK6l\n3uWLsda5RNrBmXfYsi8Ux3DqgQOpUgygYMK2QhzFuH7H1JdRVrhK3YNiTLum\n0Kun09P8IVlMlb6NYjxg4q12DpF2fFrmqPsooCiKOIg7FzEYEXyYyYu0P8fP\nf1QedjE8tJcL7KKVqaWefqx0RhDbaHDfRSTwOmLv+DrQE9fiq42HBVbFBkrs\nE+zuV51gP4A1KKpA8YG2hC9Rgb69PuKcnQjhxT3ULhWMYLD+yVCCC9kBHbWr\nIToMSdNy7hTi3OIxgHFJu9JAF3VgP8Faa5YcsmyOnU+18HBF1VBXuBOtjYq1\nxbIRUyhUqnOUCu1sRmYXj8++KoZTc5+/MJkOcgTYyj8mre+lXi3MlJpx7cx1\nHxHHs8qFneE4gXR9shVl+5AAOfioPpzcvrukpol2Nh5IpiMUi6DC99sWrFSl\nDIrTCbIQ/HA+kQND2IPD+yobSd7IfOkJUyL8A5e6Ek74t1buR2nzM4pD6cRX\nYybA2BuWPxco7QSay8VaHxdfLI0lWH8t4dkCNNCkPEhWBMxZF7pzY2GAwxpF\nSuXfQJHN2kEt2KdE7ZmI/MKOXZ6tiAnXM9q27mSvQa14OTSDAVLizHml9ER4\nahmM\r\n=8Eh1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDoBXB0a3/OF0vVnNwckufd/loMpu4emLu53dRyMcu/bwIhAJYIFZoyrnOKlJClq2zVxS4UfEdBPpOpVGqwnx/Zv+Ml"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.ab5c0a10.0_1612297043906_0.41667277459695784"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.b7a40b27.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.b7a40b27.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=10.0.0-canary.96878e1d0.0","@material/line-ripple":"=10.0.0-canary.96878e1d0.0","@material/mwc-base":"0.21.0-canary.b7a40b27.0","@material/mwc-floating-label":"0.21.0-canary.b7a40b27.0","@material/mwc-line-ripple":"0.21.0-canary.b7a40b27.0","@material/mwc-notched-outline":"0.21.0-canary.b7a40b27.0","@material/textfield":"=10.0.0-canary.96878e1d0.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.b7a40b27.0","@material/notched-outline":"=10.0.0-canary.96878e1d0.0","@material/ripple":"=10.0.0-canary.96878e1d0.0","@material/shape":"=10.0.0-canary.96878e1d0.0","@material/theme":"=10.0.0-canary.96878e1d0.0"},"publishConfig":{"access":"public"},"gitHead":"c1cdf08e57947b9dd8b35ef8599a58c0ab3c09e7","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c1cdf08e57947b9dd8b35ef8599a58c0ab3c09e7/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c1cdf08e57947b9dd8b35ef8599a58c0ab3c09e7/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c1cdf08e57947b9dd8b35ef8599a58c0ab3c09e7/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c1cdf08e57947b9dd8b35ef8599a58c0ab3c09e7/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c1cdf08e57947b9dd8b35ef8599a58c0ab3c09e7/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c1cdf08e57947b9dd8b35ef8599a58c0ab3c09e7/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c1cdf08e57947b9dd8b35ef8599a58c0ab3c09e7/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c1cdf08e57947b9dd8b35ef8599a58c0ab3c09e7/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.b7a40b27.0","_nodeVersion":"10.23.1","_npmVersion":"lerna/3.22.1/node@v10.23.1+x64 (linux)","dist":{"integrity":"sha512-ALoohaWDACnw7zlHFy7R3eDrvtMHLlQSAF4PnWbWXK9udJ5G2ofRqnL4L5H/lIayf5zYkzIytBKA3XP50s3xeQ==","shasum":"0ee9b1d58ff4bd146f987f288dfb63a812218d8c","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.b7a40b27.0.tgz","fileCount":13,"unpackedSize":204639,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGrtOCRA9TVsSAnZWagAALzUP+QDxDe4xiMlLGEi0REwQ\nG50pZ+kYYAaMlXNKM1wqpUm0eGaaa25xcdcAabyNsnMZ9c+kJwrop+BV/FXB\navtGhLvgesdMyB6HcQEVWE7GD/aHPJ9dQtS1Sqo3MVgM1mAZ+1OvDbo5ZV0G\n7wvnsiXUk0d7OcTJMD76aNPw2TlLSYN0VM6FyAGsXjtKsELPYpZjBGzAHu5j\nMdB2cw9D9nFolwt7rq3m7oRNAvwxrDF3KTf9uEFeku7fcxDZnFqQ9GacUH9a\nHh0bJ8sSUhoIpyA3GHedlvhWR8eA0lLZKiWBmRkGyupVu8HA56g6uMjq8fcz\n7YpGkUTCcktpfrOyf8lPeKae7P+jXJojeYTPlzVlAJAD/bPoV/e5hROFq2x1\n8OJ44wP1c3Nn+4s9k9BSeEIwWsY3ISty4wYadDlSRLLrOKkya9oDCk0RIep4\nNhI7vUyze7YTg9gmcmLs0opTvtv+1CLWOTiV6eQMd/ybTCI9HFe0eZW8Jh3n\nrnhjQ0spuTdepfPGf4JQfk+tlxnMGhep2bcoKqkc5D/9IyPtZpkVnGaEg14a\nwuBHqdHX4NhkjSEpTxkHNTSVos3nitPnp/v03yS06i+AbcU9Ndx6eh8Hn0Kq\nWVPxsLYPmvqM3154i/BbGxLV1wMpf6PLRBEtSNy3nVmFcUH+zlgk5jfeeSno\ncJ8E\r\n=wyu9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDGqYhFc7n7sz1PigAb5jUYQIuV3VGOZQjKUudBbwCz6QIhAKrmx919A550dAz7SeVbdnI8BC2S+UGUibIM6UFqOX3s"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.b7a40b27.0_1612364622112_0.7602169351475483"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.0fdee204.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.0fdee204.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=10.0.0-canary.8e66dbfee.0","@material/line-ripple":"=10.0.0-canary.8e66dbfee.0","@material/mwc-base":"0.21.0-canary.0fdee204.0","@material/mwc-floating-label":"0.21.0-canary.0fdee204.0","@material/mwc-line-ripple":"0.21.0-canary.0fdee204.0","@material/mwc-notched-outline":"0.21.0-canary.0fdee204.0","@material/textfield":"=10.0.0-canary.8e66dbfee.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.0fdee204.0","@material/notched-outline":"=10.0.0-canary.8e66dbfee.0","@material/ripple":"=10.0.0-canary.8e66dbfee.0","@material/shape":"=10.0.0-canary.8e66dbfee.0","@material/theme":"=10.0.0-canary.8e66dbfee.0"},"publishConfig":{"access":"public"},"gitHead":"f072f9738076b381b1be472e9a6d239553e4d7c5","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f072f9738076b381b1be472e9a6d239553e4d7c5/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f072f9738076b381b1be472e9a6d239553e4d7c5/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f072f9738076b381b1be472e9a6d239553e4d7c5/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f072f9738076b381b1be472e9a6d239553e4d7c5/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f072f9738076b381b1be472e9a6d239553e4d7c5/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f072f9738076b381b1be472e9a6d239553e4d7c5/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f072f9738076b381b1be472e9a6d239553e4d7c5/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f072f9738076b381b1be472e9a6d239553e4d7c5/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.0fdee204.0","_nodeVersion":"10.23.1","_npmVersion":"lerna/3.22.1/node@v10.23.1+x64 (linux)","dist":{"integrity":"sha512-lRXoxLm0qiN8ziyv8BOBEDjirfwXRIzFsO39OdfHNftucLwU/bYnLnctLbKDClImR5V2WoSii++rFkZgDSBWjA==","shasum":"8c8aec4dc598a7fcc5d3d40f11efb30e416689b4","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.0fdee204.0.tgz","fileCount":13,"unpackedSize":204639,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGuyaCRA9TVsSAnZWagAAUCgP/i81EwGjljiheKaIpANV\ngmY/XyiRgM2XS0hwWRi0/5U5dbS2Qxa/N3+gm8x2UIeL64tUGNcrV3UAgnJE\nlO7hd/aY3TwcppvWj0VP2xuJLFCZaTspol7yCTDC7To+X01/glz5Yr0HM54R\nVV/mScmeyZngCG53OVXRd7szitzOMdR3FlnuKEcNTak8Q0RcpUb+ZNLQgY7B\nGCoP9Xs8OGItS0wyIdPoAQFwDNcUiYMHWbC4Ip/xKuKYcCCiEdzn8uPMtzDw\nsIpDvt6O2f2RhSqMD0mWtgQ35BDcBRDmEdTnUCn+2zekrLtHfnJoR3+ctg50\ndS4ckgYOy00PFcx2/w69pT2qqCJ2nNk+oBNGQ4VBpe1eCNgbjdTY+Jx+pkaK\nbCiLvzm/q+dxNKDrjWNqcassz6HAxwSDkhTPtMZORKJ/6tZDaJcQUw/enHFM\n4tSjCav6upt8uPcNTANKVXp+BvBbX/Lm4RMuk0QYFHi8rUlu5zYWk61f/O8B\nrIGuowBSFgxJRynG25WfDE0xc8TmuZ0Nz7nLPcLJPbeuW9ts8IDAZD1HD22y\nwySOvs+XjWpidDu56Z4OkMJ8qOMzgmeZkOCiLtfUPqoKkOa1KluS/dAOrRKq\nmr6QNA6ZkRb7FO26onJ6JOLve0PC4PlCYJqqrMdY0XTVEL+TiMhKTw/Iz4Y/\nz85n\r\n=PN74\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDMGZoa8VsjQ8CBxD8KzQrPZv2tHyJyoRgsdzmBc1QgsAIhAJaNdjv+Xz1tbPUz2XIP4J770PgimMHC8QfxdY4GMz23"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.0fdee204.0_1612377242161_0.9914015824333542"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.5160e548.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.5160e548.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=11.0.0-canary.b5227247d.0","@material/line-ripple":"=11.0.0-canary.b5227247d.0","@material/mwc-base":"0.21.0-canary.5160e548.0","@material/mwc-floating-label":"0.21.0-canary.5160e548.0","@material/mwc-line-ripple":"0.21.0-canary.5160e548.0","@material/mwc-notched-outline":"0.21.0-canary.5160e548.0","@material/textfield":"=11.0.0-canary.b5227247d.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.5160e548.0","@material/notched-outline":"=11.0.0-canary.b5227247d.0","@material/ripple":"=11.0.0-canary.b5227247d.0","@material/shape":"=11.0.0-canary.b5227247d.0","@material/theme":"=11.0.0-canary.b5227247d.0"},"publishConfig":{"access":"public"},"gitHead":"37494b60e468d33d172953edbd3ca17d4aa342e5","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/37494b60e468d33d172953edbd3ca17d4aa342e5/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/37494b60e468d33d172953edbd3ca17d4aa342e5/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/37494b60e468d33d172953edbd3ca17d4aa342e5/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/37494b60e468d33d172953edbd3ca17d4aa342e5/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/37494b60e468d33d172953edbd3ca17d4aa342e5/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/37494b60e468d33d172953edbd3ca17d4aa342e5/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/37494b60e468d33d172953edbd3ca17d4aa342e5/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/37494b60e468d33d172953edbd3ca17d4aa342e5/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.5160e548.0","_nodeVersion":"10.23.2","_npmVersion":"lerna/3.22.1/node@v10.23.2+x64 (linux)","dist":{"integrity":"sha512-uPhtylHOhxwccdurnewMe4r/rEIx5aGwC+YqUKbMNeMjUj2Vt+HUOx8Ol3jGO7ydHMwepO5XVte5L9nK2lvqUQ==","shasum":"ba452e0a88f91f1508ba77e8e8efeffbca3cd333","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.5160e548.0.tgz","fileCount":13,"unpackedSize":204639,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgHdnzCRA9TVsSAnZWagAAppwQAICtQYU0yFgKq2j66MWc\nFsrM0pOfz3lAlv9KxI7SvzIpwDcuA0aUsocH2uc2m/V5p7pjwDKXbCzRVhwT\nTu8CbPvtS7HYEM9cLc105Oyc4Y/zXx3Xkg0lUDR8PMqV9MD+s4IWMBCbSfna\nQbHaPEz3pn2uDaf+GZy8QQUc9aUVpNbMeKcOKkXTlY6DIDgQFDyKi8PSDH6v\nHXFRp+l+QQuNUyJFTXxsgFC8Q0N4vTbzF88EpbRPdHWled7At+4+geklSU8r\n24afMM7x0W7m3nPX+i4KmwZHuuHSuzMBdhwujjiRZh1I/nIC08w1k0sgZ6Gv\nf4BdoQlwt1m7O23BWImR2ELFf+UuQCvUsQnSlZGiLFdiR1ZHlxUQbz2jbzxh\nrJGOXKJMxXETYH4aqlAQxdPSyExYIRd9l5wCg4+3MZCQ69/THJphSMDpSzgN\nNXmmyH7bg+SnseL5zfjt07ZG0YHtDrmrcjM9pjugEpl/QZeUL7D8GMnlz5IU\nU4Qv3XowlKnOazD9tmrQjjC4tXtuuZ1jj6tR/UV5ZplsrgJSnNvsbGoLGx6p\nwToSsyygOTb/FCMqdmEyJDGchRda/l7wP6zMItJNgpZPQW/6w9a85sPpIA2Z\nFYeSphzAmPqjnLx7RnuQBvrWEUyVeeyzgTuSFi+CxY7qnvuoDDcK6UXSWR84\nZuOk\r\n=nOSd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCeZwdsXgQ5ic+X5g9ZqXaFGvQ7nTiFz392q9lVA38fRAIhAPj1/TUvvjc4xWQXr4dsSbBKnCIeo9ikkHVT76xvN/bR"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.5160e548.0_1612569075383_0.29643525458232434"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.4fa2daec.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.4fa2daec.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=11.0.0-canary.aac8f5d9a.0","@material/line-ripple":"=11.0.0-canary.aac8f5d9a.0","@material/mwc-base":"0.21.0-canary.4fa2daec.0","@material/mwc-floating-label":"0.21.0-canary.4fa2daec.0","@material/mwc-line-ripple":"0.21.0-canary.4fa2daec.0","@material/mwc-notched-outline":"0.21.0-canary.4fa2daec.0","@material/textfield":"=11.0.0-canary.aac8f5d9a.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.4fa2daec.0","@material/notched-outline":"=11.0.0-canary.aac8f5d9a.0","@material/ripple":"=11.0.0-canary.aac8f5d9a.0","@material/shape":"=11.0.0-canary.aac8f5d9a.0","@material/theme":"=11.0.0-canary.aac8f5d9a.0"},"publishConfig":{"access":"public"},"gitHead":"49d5ec72e92627f861ab94dde045181b5eea9f00","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/49d5ec72e92627f861ab94dde045181b5eea9f00/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/49d5ec72e92627f861ab94dde045181b5eea9f00/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/49d5ec72e92627f861ab94dde045181b5eea9f00/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/49d5ec72e92627f861ab94dde045181b5eea9f00/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/49d5ec72e92627f861ab94dde045181b5eea9f00/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/49d5ec72e92627f861ab94dde045181b5eea9f00/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/49d5ec72e92627f861ab94dde045181b5eea9f00/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/49d5ec72e92627f861ab94dde045181b5eea9f00/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.4fa2daec.0","_nodeVersion":"10.23.2","_npmVersion":"lerna/3.22.1/node@v10.23.2+x64 (linux)","dist":{"integrity":"sha512-/jMBNTy5rQC5isrHmBfq9lShXLjFD2PEtaqvlBM8NLlZlZ0F6W2zDnbSwK8muRueSg3+TDbEc0cllFTcWKDafg==","shasum":"885ae4ed116f4b4cb6daa97c3abb938cefabad0a","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.4fa2daec.0.tgz","fileCount":13,"unpackedSize":204639,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIdTyCRA9TVsSAnZWagAAKyIP/1RUNTl3yfjlT6P0lz8/\nciDs+LK7tqJNvNixA3r8O7NRg8CmZx5IHuncqbpkk3lqH0erOJhsuQWl2isp\ntgVEEt219CGA4wuYpbdV/xnID1LZtZfwft9T4ZESupBEEg3TGKQfgqggy+bf\neTr1z5p6pwMsKZ8J9CUuVQ8gluBKO3CLxiIBxmkY+Yrw3AQIdbppMaz6Jx27\nRXK8UVKCvyqjDwEB6EZnBvsJK7blV3HqUKopYT6ygy5Om3B4q6v+9eM3DTvf\nkMkr84C1VDbEmH/mu97mLxb5zy+SlwuOk+i8g4DAi5++2RUVPW+19ucNhEWR\nESHWT8/DWR9K4tmELbu6uL4tOhi/73O+8lfjUpRdzLyxmMOkmFlcMpwPSc/j\ntW2bki5N72CbyxMsG4i88usZn4qRtidBrbQMCaWVRirXI7ONC/W40OaeOUB6\nCi7OskXsxPocYhWlSIOcAf6BCQz6RosrX9FIoNEYx1pwWjd3ELbDECtgFtua\nBYaU7AXzTf4gyNuZ/fSY0cfBXrVYjDr/WTWd6ZuTy1kxZgCTG4H1uybq+rql\nWLiPGBcAE089uA8dh0f0FEMcUl46VHEkRahboIyn5AILRRlnKHDeE6/RNRcN\nIDv9aou2jsPHMBUQPdS0HSf4ujRHvj6NSr2ABahzzm6qWWn38jRdzj9z0mi5\nRjBI\r\n=THcN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAdsTR+5EiVyNp3wNtHavDb89TKvJveHToczzFftytGRAiEArp9ZRmyeSrrMD/3n7dcgrRxVrtZd2hn+2J2yWmaDRgk="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.4fa2daec.0_1612829938081_0.4201801661756308"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.67f285fb.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.67f285fb.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=11.0.0-canary.750e18fc7.0","@material/line-ripple":"=11.0.0-canary.750e18fc7.0","@material/mwc-base":"0.21.0-canary.67f285fb.0","@material/mwc-floating-label":"0.21.0-canary.67f285fb.0","@material/mwc-line-ripple":"0.21.0-canary.67f285fb.0","@material/mwc-notched-outline":"0.21.0-canary.67f285fb.0","@material/textfield":"=11.0.0-canary.750e18fc7.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.67f285fb.0","@material/notched-outline":"=11.0.0-canary.750e18fc7.0","@material/ripple":"=11.0.0-canary.750e18fc7.0","@material/shape":"=11.0.0-canary.750e18fc7.0","@material/theme":"=11.0.0-canary.750e18fc7.0"},"publishConfig":{"access":"public"},"gitHead":"04f614de1b88fbd5e16a537f0b7e3f2f9b015a9c","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/04f614de1b88fbd5e16a537f0b7e3f2f9b015a9c/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/04f614de1b88fbd5e16a537f0b7e3f2f9b015a9c/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/04f614de1b88fbd5e16a537f0b7e3f2f9b015a9c/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/04f614de1b88fbd5e16a537f0b7e3f2f9b015a9c/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/04f614de1b88fbd5e16a537f0b7e3f2f9b015a9c/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/04f614de1b88fbd5e16a537f0b7e3f2f9b015a9c/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/04f614de1b88fbd5e16a537f0b7e3f2f9b015a9c/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/04f614de1b88fbd5e16a537f0b7e3f2f9b015a9c/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.67f285fb.0","_nodeVersion":"10.23.2","_npmVersion":"lerna/3.22.1/node@v10.23.2+x64 (linux)","dist":{"integrity":"sha512-72rmAHBzu0nfbyZxCVKoSWrzVy6XYEVDMxJiDzqM5TBbkbKm0G/FNIDuWZATq76TWWsfqIwd2LPiE7CtEWnhoQ==","shasum":"514b60e37aa3130d903a8ddf1b1db0369210f9ef","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.67f285fb.0.tgz","fileCount":13,"unpackedSize":204777,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIdx4CRA9TVsSAnZWagAAPskP/0Vaj9akVaMi7DudgRWl\np3Ld3fcP6YIQyKJQUMYXoJ7vFvX735TsZN6nMcukxJNOjwRub8KNHraOizNx\n0iXedb1mvptgKLCLZNzViRmtOUhdHcOFEkb5Ay7Wr4DDanbkMgDViP1CB9Uq\nkf4py9u7NqgrRQIYnaY6E1lGP4ycbBQAHVb6f7dzp5JiSDPt7woc+XWJX/Zc\niF5b23ZG1qZrcOSJBbyz/wdMGF61sezaOobnkRSggdLnklIcg/FTRJ4A1/63\nTPJjVL3eiXmdQxVTEl2wx9A0wteWSnTrdgzBCPKX2uwz23/tfiXw4D1BkgEF\nocAKN+OQJ0+Y5RMnLd5s5fDvjjglcxX/NNoRcm1d+ykUF9k9FUSn9zA8ca22\n1CFxMUAoAYbJ4VWSlbgzYupIOvWnbdh9Qw4iTZCtOuWzYXz7qRD+8d5sbtYP\nRB99Zr2RIkPfId6HYfWsHkK8e0NUmHJntXEFfvjwVBmVu6HDH0iLgcO5EwYs\n7C1J4m+cPQD4QaWCu8HWjWUODhROaA3Szk1Vs7d6V9XcpM4FfcKJBOBHU0oU\nBhCAb3NXbMQx+Jb3s14xUB5tEwZx3vb8f4KhykKLHrYPE7bgAbqzCHthAbKT\nDUb5VlTod1m77J/9c6hQCmDLbxuBrWLYiIVOaI7V2coWMWoa+lBXQrsOFaL6\nrjDT\r\n=xpL0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDSgSPd+0CSgvCjjabAJWIpPQZUsir1DilZi5QyhDXiLgIgBjq1Il8a8eLVK7pTKA/IrLkRtYfZq9+TiYMhiE9mEaU="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.67f285fb.0_1612831863618_0.6793913211265823"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.58cd5a70.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.58cd5a70.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=11.0.0-canary.b62b1266d.0","@material/line-ripple":"=11.0.0-canary.b62b1266d.0","@material/mwc-base":"0.21.0-canary.58cd5a70.0","@material/mwc-floating-label":"0.21.0-canary.58cd5a70.0","@material/mwc-line-ripple":"0.21.0-canary.58cd5a70.0","@material/mwc-notched-outline":"0.21.0-canary.58cd5a70.0","@material/textfield":"=11.0.0-canary.b62b1266d.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.58cd5a70.0","@material/notched-outline":"=11.0.0-canary.b62b1266d.0","@material/ripple":"=11.0.0-canary.b62b1266d.0","@material/shape":"=11.0.0-canary.b62b1266d.0","@material/theme":"=11.0.0-canary.b62b1266d.0"},"publishConfig":{"access":"public"},"gitHead":"bd3f430e2f5a541d9ff928f6eef5e0f06946dd6d","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bd3f430e2f5a541d9ff928f6eef5e0f06946dd6d/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bd3f430e2f5a541d9ff928f6eef5e0f06946dd6d/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bd3f430e2f5a541d9ff928f6eef5e0f06946dd6d/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bd3f430e2f5a541d9ff928f6eef5e0f06946dd6d/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bd3f430e2f5a541d9ff928f6eef5e0f06946dd6d/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bd3f430e2f5a541d9ff928f6eef5e0f06946dd6d/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bd3f430e2f5a541d9ff928f6eef5e0f06946dd6d/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bd3f430e2f5a541d9ff928f6eef5e0f06946dd6d/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.58cd5a70.0","_nodeVersion":"10.23.2","_npmVersion":"lerna/3.22.1/node@v10.23.2+x64 (linux)","dist":{"integrity":"sha512-kooQ4V/Q3FHTvdWfTfQGJUMVSkv9Gwpvr+xonD7G03o4IvIiOqsaEATizV3h9hEW56qraU7bmb2ceH6caKjBfg==","shasum":"6b7b114e2b835bcaff59b10b1e3df0827de1255f","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.58cd5a70.0.tgz","fileCount":13,"unpackedSize":204777,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJZc6CRA9TVsSAnZWagAAKpoP/AjyKYeAkVUE93jkujne\n28Ro2/ePBWAHoQxiI61AZcsfIA3Vr38hXNL2PQ80BWpG6fLlIDzv4rjmZ2j8\nYYl6XOe/RLq0le5o/RVtx1dCfVpMxz2mVUCTqCUHoKeRvFBRsOEDpkqbXFYq\n+F4uXdedKb33kieQzsd6TnISl+UgVhLwNYomzT+QXc6J35LDn+11nOX6Yvwv\noCzaLd7RvbZyZglnoIGzj0yMuLYsKADs1zmGoOdTrKiZgNx3SQ03T4zgH1ax\n7pGN7e1HYb29s2dm9c2oAGY6C0/jcO35QisTMnLsA7gKxEdIwV8AmKt1OeuA\nLuY1paR1BJyTWBMXZJDZQmzT1sDZPjw1w+zkDg3wQUhukKU1ry7OYrS/l7lY\n/x+Y/S26evCkVMZxixjHguNd/YgwSJC/PrM03LigS2XAvOMTr0PbF8gfVycY\nuIlTw/0tV13/uuWZzZRD24CNptFOJKbRGbImn5NZ6ICYbYt1NxV94gjQK02n\nMkENN4f0DfFA8Uqek7pLAAUjbJQt52B+kBcNQ1xnkF9j/keFvOQ5ktfAZocU\nK2WgMHH4ypOKElnOx20qc0nYV7m8cjkY6SBDBRBUCAictXL607Qhncrwgevk\nA2fK8Y/moF0OpIG/X5H00M+7vI6jeoAXNYHnGUJ3zuLQdL56foPl9JESMOij\naZTv\r\n=SYBs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDZlOxUnL8PdIP0IQqjIqlH8THSxsF2YyYtF9LNgmtGfQIgWVaPYOk9HKoVYA+wObHfaP81Bn6IwACMc20W93cpZhc="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.58cd5a70.0_1613076282218_0.3700947927365268"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.8107ca43.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.8107ca43.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=11.0.0-canary.a6b3101fb.0","@material/line-ripple":"=11.0.0-canary.a6b3101fb.0","@material/mwc-base":"0.21.0-canary.8107ca43.0","@material/mwc-floating-label":"0.21.0-canary.8107ca43.0","@material/mwc-line-ripple":"0.21.0-canary.8107ca43.0","@material/mwc-notched-outline":"0.21.0-canary.8107ca43.0","@material/textfield":"=11.0.0-canary.a6b3101fb.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.8107ca43.0","@material/notched-outline":"=11.0.0-canary.a6b3101fb.0","@material/ripple":"=11.0.0-canary.a6b3101fb.0","@material/shape":"=11.0.0-canary.a6b3101fb.0","@material/theme":"=11.0.0-canary.a6b3101fb.0"},"publishConfig":{"access":"public"},"gitHead":"579eae14a8b8a347a0e4b31bb6650c994d1df472","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/579eae14a8b8a347a0e4b31bb6650c994d1df472/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/579eae14a8b8a347a0e4b31bb6650c994d1df472/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/579eae14a8b8a347a0e4b31bb6650c994d1df472/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/579eae14a8b8a347a0e4b31bb6650c994d1df472/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/579eae14a8b8a347a0e4b31bb6650c994d1df472/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/579eae14a8b8a347a0e4b31bb6650c994d1df472/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/579eae14a8b8a347a0e4b31bb6650c994d1df472/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/579eae14a8b8a347a0e4b31bb6650c994d1df472/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.8107ca43.0","_nodeVersion":"10.23.2","_npmVersion":"lerna/3.22.1/node@v10.23.2+x64 (linux)","dist":{"integrity":"sha512-TswSfOf+VOvdkZr8nd826WbQ39GuPzZHTm2jI3LnCzgRDyP0XR6vxN7Oj4oKtZGDu/P3/omWwNUB433QIhTqCA==","shasum":"45baa63859c0b1bc0d880545acdcbcabcba60fe5","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.8107ca43.0.tgz","fileCount":13,"unpackedSize":204777,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJb22CRA9TVsSAnZWagAAErQP/0Mrz1GpOUm1IoQa9Plj\njzfnDMDxHGjngi3IwIfuHL1/bjpXkklvS9S/vXmeEHinBgaCvmIAFDcWWhiq\nfLNsuBqTFJNQF5TRwpe/VqxRGnV7vU4DBJV5LOQ5+Yc0G4Y5GP3nhIJJVsJG\niKGZ68W+nL4bz2qJ9TuLTAgcAvbQMSsuZJ7sZxMfWcjjY8m15D3HUcl1olnm\n+4EHVStQQvc/AoMlxJEdAyLOGvpl9PcR+rA7yLsikz2hCHu0qL3/aZK4UYpr\nppLrjj/FYP7C/rS0ob6pOFspU/KJ2GHhE3nd9uLriG4N495Mi5fiCDJbXXCU\n0eGtdCmxB40NxAGrvgmkUVzJuWwKe5bb0g+d7HHec9ex4QEtBFcO55UVOusH\nPlK1Tx1ygNgxp5+wIwVpHGJNC09vzURRoJApga1lYl4MANjkKjP2Ga6XT8PN\ndXCM8+aaC0Uwud8ctYTx6ej6xLVHvgYz53/WNOBB6dUBCrlzCTghPgoagQnE\n+deGPwIhwG1K6jOrVBWQ5swPiytShoGO9ZKEH8SMd+NBtufg8y6Hsc+xRRDI\nRIUQgRqZenv5VPqgrDAistO9MuSaK/MRfaSmaTrKP2RW7og/6lz8AYFc52F4\nyjpKu+Zaq/3qh/FWmwDmkeGR96QJ3owyUZhW5T6I04f/K1XruJBq0DQuLAq8\np4bT\r\n=rZtJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG/iMwDMI3eTMP5JGm6lxKdO02iSqfS2V7KSbmlcdNHTAiEA1fFMTopfLNp3qfHfP0T/pYj6g3sxDYKIibBNlqTH46s="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.8107ca43.0_1613086133905_0.30653444045058365"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.d35d64ef.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.d35d64ef.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=11.0.0-canary.a6b3101fb.0","@material/line-ripple":"=11.0.0-canary.a6b3101fb.0","@material/mwc-base":"0.21.0-canary.d35d64ef.0","@material/mwc-floating-label":"0.21.0-canary.d35d64ef.0","@material/mwc-line-ripple":"0.21.0-canary.d35d64ef.0","@material/mwc-notched-outline":"0.21.0-canary.d35d64ef.0","@material/textfield":"=11.0.0-canary.a6b3101fb.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.d35d64ef.0","@material/notched-outline":"=11.0.0-canary.a6b3101fb.0","@material/ripple":"=11.0.0-canary.a6b3101fb.0","@material/shape":"=11.0.0-canary.a6b3101fb.0","@material/theme":"=11.0.0-canary.a6b3101fb.0"},"publishConfig":{"access":"public"},"gitHead":"2fabd01c45fe7a18430cbb0070ae8b3f5d2a9dca","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2fabd01c45fe7a18430cbb0070ae8b3f5d2a9dca/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2fabd01c45fe7a18430cbb0070ae8b3f5d2a9dca/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2fabd01c45fe7a18430cbb0070ae8b3f5d2a9dca/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2fabd01c45fe7a18430cbb0070ae8b3f5d2a9dca/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2fabd01c45fe7a18430cbb0070ae8b3f5d2a9dca/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2fabd01c45fe7a18430cbb0070ae8b3f5d2a9dca/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2fabd01c45fe7a18430cbb0070ae8b3f5d2a9dca/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2fabd01c45fe7a18430cbb0070ae8b3f5d2a9dca/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.d35d64ef.0","_nodeVersion":"10.23.2","_npmVersion":"lerna/3.22.1/node@v10.23.2+x64 (linux)","dist":{"integrity":"sha512-V2o2su9irGyLmS8RUQxBgRCJ6IB0vk2EeInsPwsm4M/+KjyVsI/fiQ/rgQmAOIyqV5XKyYtxYUH4SO/bxj7Ehw==","shasum":"84486783e2f9f88c0eec8cab90f5dc5c4559eb48","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.d35d64ef.0.tgz","fileCount":13,"unpackedSize":204777,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJcEFCRA9TVsSAnZWagAAX8wQAJkjBWnKtkIpTVra5kcY\nHV11Pae1jGBdERJ3VCLTyfykd8BBEfbZfJvM61upF7e7KlZF/3ZMj15aYLIG\nUkIhbAIQ55UanaKdJHxr1okCo79OY4IXYE0Kes0Id7fgl9nWwhICr8s4fmBe\nMrN4qWrAhmzbtsh/0RJA3UXZ2M5uLjqNbb3CkQlpJ9NYq2wrXV48Kx5RxCgP\nnWmbQiOCdApJsB2z4jad3dzb+uF0Xq5TAZi7iNz52LOfUkmCYbqvS4gZphfD\nCn/QEB2XWiRD+WEgooDWMzkSBa+q33OvG6QG4OT5gSGarw4Siwa/LzHR4/Op\nJQyLspViNGwD95kaKhPyDf7Baz+oEc/575Jm6tt26jUWptVTNdyqCa/+jMLu\nj1YsXdS6OieNLpt5yZRhL/FR1gZjRfJj52K4tUYqeD0PxCcZYhZKbEd/hwi9\n/l3WOILPY55m7w985f8Gh5skOAHHAth/aKbilIoidNmd/rxJ8LvqSGwWi/zo\n4MEoMlF/dhYzHRX8CH5ZqBKSyjt9nFTNXzg7R0okIjLq3hUXMQYz/LMwgnvq\nu47pYwUCj7DIKfJ7YPTSSrCeCw/SKqrhYylhloaLj3b9Y3GB2lBQTKvvI6EB\n0FGrJA67f3aXvpYFH1XfKSciaRItfoL6MiWAHBW8rXw8cgZVwcExbvfASh+A\nzS4p\r\n=sf26\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQClCI4+U4/YDmVJ4Yrl2Xol5J3urzwDdZJaafe9qDsFWAIhAOI5GEqy2nOn3uQfhHofvEYpKz2+XSi2JmzfOMhh2Za2"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.d35d64ef.0_1613086981286_0.045154158392623156"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.78bcf058.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.78bcf058.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=11.0.0-canary.a6b3101fb.0","@material/line-ripple":"=11.0.0-canary.a6b3101fb.0","@material/mwc-base":"0.21.0-canary.78bcf058.0","@material/mwc-floating-label":"0.21.0-canary.78bcf058.0","@material/mwc-line-ripple":"0.21.0-canary.78bcf058.0","@material/mwc-notched-outline":"0.21.0-canary.78bcf058.0","@material/textfield":"=11.0.0-canary.a6b3101fb.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.78bcf058.0","@material/notched-outline":"=11.0.0-canary.a6b3101fb.0","@material/ripple":"=11.0.0-canary.a6b3101fb.0","@material/shape":"=11.0.0-canary.a6b3101fb.0","@material/theme":"=11.0.0-canary.a6b3101fb.0"},"publishConfig":{"access":"public"},"gitHead":"98a4001d56b1e200103e0862b83b661c87fac551","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/98a4001d56b1e200103e0862b83b661c87fac551/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/98a4001d56b1e200103e0862b83b661c87fac551/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/98a4001d56b1e200103e0862b83b661c87fac551/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/98a4001d56b1e200103e0862b83b661c87fac551/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/98a4001d56b1e200103e0862b83b661c87fac551/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/98a4001d56b1e200103e0862b83b661c87fac551/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/98a4001d56b1e200103e0862b83b661c87fac551/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/98a4001d56b1e200103e0862b83b661c87fac551/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.78bcf058.0","_nodeVersion":"10.23.2","_npmVersion":"lerna/3.22.1/node@v10.23.2+x64 (linux)","dist":{"integrity":"sha512-mLk7v1SWH9da6sL1xlH41ED5xowhwHMA6IYXgbwZ/r/RDI2Z0uez6N8pgOIO7Y+A0lDQC3VI5EB2t9VFEwr0Fw==","shasum":"f95b95d4c2ceaee0b8377024ea584e8def81d48f","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.78bcf058.0.tgz","fileCount":13,"unpackedSize":204777,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJdBVCRA9TVsSAnZWagAAP10P/RZplOqhiWz2eo0OFfgZ\nB2+AapPCPMwanmc0pEEeUuwT2HUU43wNAlQ3sZwH1qXVjcTRMKUCrVwsl5UA\nH/8+RgYBM1QGmpvlZqZc5WOpERDHzP1yhTHJ/OOskQUGByZv8dnMB3n5Yvo7\nn5rKGoSl//MOz/iY++AfO/wNBCOMxT9g9F3+84sZ9sgcYVMpYow9/ajhG73q\nhWbuscj5MSDl1dc4esh1HNqgMldiqMEPDio3GFjUwcD16UxA3oxohGO8L6Ky\nbCv8SLcPY3ZgxPOfDcdwT+IEUTJbneOy8IDTQAbJUSXo8dG3Ijk3Axd+Z6qb\nWbmv7jiOvV0vQS3sekYCHmnD8fNr7/Ph70rFbbg6mE8SDXuBj/RduA5TDx8j\nU5sit6qlYrasCZ9hCPd2ET+rUqKbCciE7sOEUC2SgaOMT4EFOvYKkRYRtwc1\nj7o/cT90qtEhvSOIjQOHMwqjl16m68Qw6s00xTO9U0t7P1F/QhEAONsWvlrZ\nvlmfjGVXq3z4DeV4a1c9BvQ52oV7UIQKv/dWsJaApNGA1XERUGiI9vnIdP6p\naepl6cjnyB6SbK6I2Xw9hIviJdG4L4LPpNV+5q+iosQSQb10RQZ5toRFBk98\nsCOWjnYFACn18dC6zXslCzMJgnMlRvATJ02ah2MCZnc1T3yLRzmOhZcX6NOR\nP+5A\r\n=jIEH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICuNrIABWxFeNqHoYXi9OpwzXCBfLzE/n5q9lTdcBPCyAiAW0gMo1YBVpmDr2xtZw9UVyJUtxsPULGYmdYg+goNITA=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.78bcf058.0_1613090900683_0.03440226769510213"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.0c6908fd.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.0c6908fd.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=11.0.0-canary.ed88df700.0","@material/line-ripple":"=11.0.0-canary.ed88df700.0","@material/mwc-base":"0.21.0-canary.0c6908fd.0","@material/mwc-floating-label":"0.21.0-canary.0c6908fd.0","@material/mwc-line-ripple":"0.21.0-canary.0c6908fd.0","@material/mwc-notched-outline":"0.21.0-canary.0c6908fd.0","@material/textfield":"=11.0.0-canary.ed88df700.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.0c6908fd.0","@material/notched-outline":"=11.0.0-canary.ed88df700.0","@material/ripple":"=11.0.0-canary.ed88df700.0","@material/shape":"=11.0.0-canary.ed88df700.0","@material/theme":"=11.0.0-canary.ed88df700.0"},"publishConfig":{"access":"public"},"gitHead":"f290af657508c2392a786548f206e90e8bc44124","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f290af657508c2392a786548f206e90e8bc44124/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f290af657508c2392a786548f206e90e8bc44124/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f290af657508c2392a786548f206e90e8bc44124/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f290af657508c2392a786548f206e90e8bc44124/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f290af657508c2392a786548f206e90e8bc44124/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f290af657508c2392a786548f206e90e8bc44124/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f290af657508c2392a786548f206e90e8bc44124/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f290af657508c2392a786548f206e90e8bc44124/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.0c6908fd.0","_nodeVersion":"10.23.2","_npmVersion":"lerna/3.22.1/node@v10.23.2+x64 (linux)","dist":{"integrity":"sha512-iGJTalyCORZ9WHnD36DqjgzQKiqHB1yCYKEcAABYFdRcXh9PnTXcZZBJ9WL/P65mz+sZpjZZ9TMo3RvATD19HQ==","shasum":"2ab6ccde54361ac3b44d1b92966d5283cfb63dff","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.0c6908fd.0.tgz","fileCount":13,"unpackedSize":204777,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJdjhCRA9TVsSAnZWagAAAmkQAI3Qy6KNrIg0zGwijQZ3\nEylw369/yla5l24GvpPvAvDUGKtzsbZDfzEwBiATCJMzCm8EUtN7DojuH+fJ\ng0+t7q8DvT9rRKsGcOiCaPaX5wv83LyLEX1Q0LaFl+Cmv2JWtX75vRXau6ib\nCbzt7GjiseJIhdEApjgGJJNuYyu+3Vi7BuF3pJhDj0RgzbJ6kgMSOhz0Z+rl\nL8Pv69DBtjKhduQCg/OziytI9SB6+QNgcu46SV2Tqt5/uMQEHReqOp1yghiV\nO2RSOz3sYHNssBE9o7n1yCl29v9abOE50dapHAlOvfEs2ng4aLPGr1mCaGFP\nfxHELHcum44k3PO8MSroM97cQAGdGIe8EJzCcTsF1Qa4auuGSFh7vUtu81M3\ncOoT8oDKVyZpkFNyjDpOjMo0smFjnafVJ0/Dj2IpDFsV2u2qhTE2Y3EF5cYk\nmcOe7VBBP+4DPMQI0ntFGyEfcl9kVqFe5caWNDOiIWr+cGY3tpyReM7x4kWq\nMSmrIEVVGjYzFPaZnzw7+Lt38GS/A9LZk0A5SeKPaRcxF3Hm3s9ihBX/+6uB\n5Dwy0S9uHi9tOjIK3vpPMR4aCMZQQRVWWW7e0PeyT9BJHbnLhMn6Ns2MnaaP\nLri5j88xm1Rr+XUHVYdX1eXFP1/ziV99hwqqliztm96XL0IxiIjL/rlbSxxW\nnnYA\r\n=cS3S\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCDdPgmjc4eSLBqdLSS7pcLIbo/nS+uA4UE+mWs9ixhhAIhAIJ59Vz0U7jxTwx2bPqlzZH0Sm6imGd7EVXN//gWRjvN"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.0c6908fd.0_1613093089316_0.5511687978672983"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.f1f34ee0.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.f1f34ee0.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=11.0.0-canary.71fe9a067.0","@material/line-ripple":"=11.0.0-canary.71fe9a067.0","@material/mwc-base":"0.21.0-canary.f1f34ee0.0","@material/mwc-floating-label":"0.21.0-canary.f1f34ee0.0","@material/mwc-line-ripple":"0.21.0-canary.f1f34ee0.0","@material/mwc-notched-outline":"0.21.0-canary.f1f34ee0.0","@material/textfield":"=11.0.0-canary.71fe9a067.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.f1f34ee0.0","@material/notched-outline":"=11.0.0-canary.71fe9a067.0","@material/ripple":"=11.0.0-canary.71fe9a067.0","@material/shape":"=11.0.0-canary.71fe9a067.0","@material/theme":"=11.0.0-canary.71fe9a067.0"},"publishConfig":{"access":"public"},"gitHead":"b16a616d2cecb5d8aa3c279c76b01b2f49ab6965","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b16a616d2cecb5d8aa3c279c76b01b2f49ab6965/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b16a616d2cecb5d8aa3c279c76b01b2f49ab6965/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b16a616d2cecb5d8aa3c279c76b01b2f49ab6965/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b16a616d2cecb5d8aa3c279c76b01b2f49ab6965/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b16a616d2cecb5d8aa3c279c76b01b2f49ab6965/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b16a616d2cecb5d8aa3c279c76b01b2f49ab6965/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b16a616d2cecb5d8aa3c279c76b01b2f49ab6965/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b16a616d2cecb5d8aa3c279c76b01b2f49ab6965/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.f1f34ee0.0","_nodeVersion":"10.23.2","_npmVersion":"lerna/3.22.1/node@v10.23.2+x64 (linux)","dist":{"integrity":"sha512-PNNuS0yBuVBT6Ne66R8DDNPUeC53SdqbshFc5nQ4C3Sl6NrYmuRQZXPSj3eb1TSmaBAT9hVhoxkAbtkBU554EQ==","shasum":"ee4106f299136f943369f87c2a3eb4f677ed0055","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.f1f34ee0.0.tgz","fileCount":13,"unpackedSize":204777,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJuJ5CRA9TVsSAnZWagAAgIcQAJx8WAXFLPh+L5dsUOAB\nohQnBNB15reURS4sCF+SClYdmYT8/VexwviICqWpLOBDEm2XYI2ffAcQI9EP\n47p2TS+PJFYcNke8A9jrdYnGvv8uanqJI1fptSg1uk6GrhNhqOzBaipydnJP\nGbNWyZb3qi9hSnWvEtLHbrYmzAPl9j3KlEOU9Hw2j2GEpD3mkLZgF2atX1cf\ncYRU3+Lbomf5pca+sxlSqH6VTchP0DZSHPRHcqqQPfMesz/o6P+5zXrszxHy\nLCIpWcIptTLFjT+5Zb+GHWM5xA2pfHRzqDZTDNYL9zdSjPDQ/ptNysf/Rc1/\nmIucsBWxfcg2HMaCrV5WlJmKHsfNDpq+3Vvh1WVPiF/t2KO0pMFKduQL/QbW\nbyd86ssOFDB5PkzLFXHranuILGbvqJ3rW6RUyqldHlVMfGoU8Co9su4FHOaI\n/cUxuvD3uhfeP3tLI+bhEwAynHf+YwpDsmLBSR3ToNbtxj+ddNBf8S8CSwZm\nnEHu7I8U7ENjxSSYq3+klsg9FP2UKK1kfkaELwHbK5Y9jJTIH9jXtIxaR7DZ\n/y97RgGhoBlWUJzNWem12LLKTSuGXbWvKvYSh3OBQKLGXueR1xNbZzyjnS0y\nWBEm3E06NoZFEaduFexefu8mri5PjkBAMB0Cn6v/V5Qr0XVUWlqVaEYqc+MW\nulYI\r\n=QAjh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDeCqn6xxGu3tQVRAqSj4ytxYgNLZPZIE2BnaWsGmCrpgIhANRyjq9oYNpVGXyKmGu/kTEa+oAaEc3RnNihTGTKXHNW"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.f1f34ee0.0_1613161081471_0.6368556336764684"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.d84df029.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.d84df029.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=11.0.0-canary.0fd56a86b.0","@material/line-ripple":"=11.0.0-canary.0fd56a86b.0","@material/mwc-base":"0.21.0-canary.d84df029.0","@material/mwc-floating-label":"0.21.0-canary.d84df029.0","@material/mwc-line-ripple":"0.21.0-canary.d84df029.0","@material/mwc-notched-outline":"0.21.0-canary.d84df029.0","@material/textfield":"=11.0.0-canary.0fd56a86b.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.d84df029.0","@material/notched-outline":"=11.0.0-canary.0fd56a86b.0","@material/ripple":"=11.0.0-canary.0fd56a86b.0","@material/shape":"=11.0.0-canary.0fd56a86b.0","@material/theme":"=11.0.0-canary.0fd56a86b.0"},"publishConfig":{"access":"public"},"gitHead":"af09ce2e1ef6f6b486ea977ab8890e81af842541","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/af09ce2e1ef6f6b486ea977ab8890e81af842541/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/af09ce2e1ef6f6b486ea977ab8890e81af842541/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/af09ce2e1ef6f6b486ea977ab8890e81af842541/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/af09ce2e1ef6f6b486ea977ab8890e81af842541/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/af09ce2e1ef6f6b486ea977ab8890e81af842541/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/af09ce2e1ef6f6b486ea977ab8890e81af842541/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/af09ce2e1ef6f6b486ea977ab8890e81af842541/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/af09ce2e1ef6f6b486ea977ab8890e81af842541/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.d84df029.0","_nodeVersion":"10.23.2","_npmVersion":"lerna/3.22.1/node@v10.23.2+x64 (linux)","dist":{"integrity":"sha512-RNsFB/O9jUCDbdwyHop38ZnO0irXPEoOhd0fIRZrjGnmR7XTnMuOqCUR6bOX493qdrCxxcWA6QhDsnTZyxkWcg==","shasum":"11ff54f533739855b536947e4d01a44577549533","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.d84df029.0.tgz","fileCount":13,"unpackedSize":204777,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgLBgrCRA9TVsSAnZWagAAWy4QAJwfQX9DMb7Fe7pZjjPP\nPxjE7P1sBTfLuzWZOHWdWW32El0NzEGOzZXfW8B7akAjHhuOa06wNN8seFU5\noE7ynl4a5BiNTLFZIKOkTR7d3Ftu79oDPrRVJxKfOZTpVJuoPGvPJ/c9SxQq\nziKLyG1HVdivt+1lLa4S3Iml9iHQUSlNBGMy8lGJnHBLIlUGac6JNC6sQR7J\nwWwsmw8Sw1121XD3RhFY/L/pdPYEpOc3rt5rJlJ2WLRIZErggYs4IP18FZWK\nXmKn1lvszO9PTjOnqFhbs/8kF59a5RfGHdtvicy5gb1+o3pvJyVfk2ka5Aoc\nLC02vVy/lZTdAX+1mSkGFx7T2lenC1UXBWjkQhKOwZKG/zIm3wyRITt2M9In\nXy+mz5MmhElzFF8lD8SQ8hoz4MLKn3B/59B52pfM3pKe2upmO7Y2cvI0XK69\nR7DaM5zk+NLG72/dbT/n+i/7VKZWS59JEpy4gldyh4FzfKNJvDrZeCwOlNtz\noJuEJwlVrylH19zG5FPKLhHMkFqUyRiiFig1V36MX2413jr9mLKMvskgbCuD\nQuWz3wELQ3OKVq+UA9AlTlbtzpQ4yGtC0APDZjkx4rH4j1h3xg35aw/wQc3J\nJLwY5pe0jFDd2BzwuCHBhL+mhnpDJ9YrwyCW7cuB10zca54yOYImM0gZyceP\nHgdd\r\n=eAoe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHesXTxiasdyYTiGVAYJQPKFzgxy6QjK+tpeIMifUnePAiEAtsdGaKHGcSvCdm8SPzJ8eW+PofJLI0dybRmDh6XMQu8="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.d84df029.0_1613502507097_0.24886522243193676"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.c525f471.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.c525f471.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=11.0.0-canary.f9cac96cc.0","@material/line-ripple":"=11.0.0-canary.f9cac96cc.0","@material/mwc-base":"0.21.0-canary.c525f471.0","@material/mwc-floating-label":"0.21.0-canary.c525f471.0","@material/mwc-line-ripple":"0.21.0-canary.c525f471.0","@material/mwc-notched-outline":"0.21.0-canary.c525f471.0","@material/textfield":"=11.0.0-canary.f9cac96cc.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.c525f471.0","@material/notched-outline":"=11.0.0-canary.f9cac96cc.0","@material/ripple":"=11.0.0-canary.f9cac96cc.0","@material/shape":"=11.0.0-canary.f9cac96cc.0","@material/theme":"=11.0.0-canary.f9cac96cc.0"},"publishConfig":{"access":"public"},"gitHead":"eb401daa998f20b7222c2787e22c669e642586fd","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/eb401daa998f20b7222c2787e22c669e642586fd/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/eb401daa998f20b7222c2787e22c669e642586fd/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/eb401daa998f20b7222c2787e22c669e642586fd/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/eb401daa998f20b7222c2787e22c669e642586fd/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/eb401daa998f20b7222c2787e22c669e642586fd/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/eb401daa998f20b7222c2787e22c669e642586fd/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/eb401daa998f20b7222c2787e22c669e642586fd/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/eb401daa998f20b7222c2787e22c669e642586fd/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.c525f471.0","_nodeVersion":"10.23.2","_npmVersion":"lerna/3.22.1/node@v10.23.2+x64 (linux)","dist":{"integrity":"sha512-2MPnU1CX001FtEAKkCwes8NZS+xm6wl+et91aaVDLdaZIprIRsM0X6IDwwpDTBdAJeUrSVIV6jJz5Ufg0P8Fsg==","shasum":"79bb31cc0ebe42d32984b9e6b178e664fb0afeb6","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.c525f471.0.tgz","fileCount":13,"unpackedSize":204777,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgLYJGCRA9TVsSAnZWagAAJsIQAJU9lKuJJk/OMWFBJZPI\nekTMD3dUcgQUapaQv/rEtabxWAswIIkuAIL1MdUYKp/xJS4uXRRJEgp32qgL\nW0ZZYmdwgNsFpaoLpSuYb4jLSDETBGCYP8BNObLuuKpD3dqw1uADQkh3KZaz\nyY809Eno3aIkRGcFJ4LsQUvUMJNtGJ/PyyfhDYOCdZAbTHn4R7fC5gbW3KYF\ncjTrOIfgkqQfR4+Bcx40HxE29WZuSLN5udWz/YYyMEzHDd3736ggFMi7t0X4\nu/tAPUylyGozxcmp2Wkl7UFICGuzcj0R2g2yLIvh4YKbjBZf7+Agnvqra4UQ\nYCTNY8lo7KmZcclZNrsi9Gx1/vDaE+PRcTWFVR8Ti/KQlvbUBHTxCu3desZ0\n4TE2E+CTRCNh1eFst3+wnuSKbuAZTmfvDgXUL8KqDkn3OceWVSpt5VKIbgka\nR03XNyCfaCIDhevJhVzpPJtWgYjZMDIUeyKzHYXzqyDDmJFICJb5gHLslm2S\ni5PO1ElOb5/8HondDpbgj/vHnnHocsaIbq1Z1eKiMyi2jUu8uZnJGd/PEZ2I\nOGwCZHntrJBEE0glDlyQVkt9lFB3Yd61BqcLuLQkUvBpsbMy0eg4CwlEDuCY\ndaoOGoTsi0zshTHlM/9g2CB0Y3T1FzmJVL3Of0VCPZzptma0pej15NTuK8ep\nyM20\r\n=DiKn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDXAEICexNXRFS6eatVKZWDpQyxtBdw2m7Pg92Pip7YoAiEAqKfJOEJfrLNYGaEMv1/AbioxDiL9JutDOOpHWCS02OQ="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.c525f471.0_1613595206398_0.30194125373141034"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.ba7a1b35.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.ba7a1b35.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=11.0.0-canary.f9cac96cc.0","@material/line-ripple":"=11.0.0-canary.f9cac96cc.0","@material/mwc-base":"0.21.0-canary.ba7a1b35.0","@material/mwc-floating-label":"0.21.0-canary.ba7a1b35.0","@material/mwc-line-ripple":"0.21.0-canary.ba7a1b35.0","@material/mwc-notched-outline":"0.21.0-canary.ba7a1b35.0","@material/textfield":"=11.0.0-canary.f9cac96cc.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.ba7a1b35.0","@material/notched-outline":"=11.0.0-canary.f9cac96cc.0","@material/ripple":"=11.0.0-canary.f9cac96cc.0","@material/shape":"=11.0.0-canary.f9cac96cc.0","@material/theme":"=11.0.0-canary.f9cac96cc.0"},"publishConfig":{"access":"public"},"gitHead":"5d1b1f5b6c909a9e26befcb63e69de98a9b6fba6","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5d1b1f5b6c909a9e26befcb63e69de98a9b6fba6/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5d1b1f5b6c909a9e26befcb63e69de98a9b6fba6/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5d1b1f5b6c909a9e26befcb63e69de98a9b6fba6/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5d1b1f5b6c909a9e26befcb63e69de98a9b6fba6/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5d1b1f5b6c909a9e26befcb63e69de98a9b6fba6/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5d1b1f5b6c909a9e26befcb63e69de98a9b6fba6/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5d1b1f5b6c909a9e26befcb63e69de98a9b6fba6/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5d1b1f5b6c909a9e26befcb63e69de98a9b6fba6/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.ba7a1b35.0","_nodeVersion":"10.23.3","_npmVersion":"lerna/3.22.1/node@v10.23.3+x64 (linux)","dist":{"integrity":"sha512-WPoSd+urKAorrRk27iWG82xTh3awWpzECRBBY5dlw/9AypI3LJkmGBmeubKK0oh3ad+IBWF9ULON+T9oWOcMpw==","shasum":"61daf899898b2cb4826ebc57cafaddec491f6520","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.ba7a1b35.0.tgz","fileCount":13,"unpackedSize":204777,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgLwLBCRA9TVsSAnZWagAA64gQAIRefugB2UJ/WYo5QBTK\nD+T5wfPQRO77/lVEKaKChBsrwF0Z/HgWqr9tCnF37g+8FGHxtL9Es4ALtxS7\ng67XH3WXpZypFLYv9zcLS9wnvIoaHuUnBtLG5r7SVuLwdltuOUoPf6QjVls2\nDBtN9JyVfCEv8Jhr+Iocfkk/9dSrWN2mTpwMUOfwLsYRvN5aCz6hDJCPhUpn\nspa8ZhofgkUH5LzXI3j6y/X+RZ6JQj6uJlz7xsQkzEhtVT1qMPwMxiH+KhMm\nc5mZWGZTr6ypopy8UMUm1mcNAe6zmmR1THpyYlEgtsV4x1gh4V4hhDwrTHQ6\nuxioDPnILmWT5YVZMxkr+WMNWPskVPJO4Oab1itziKeG4JTdnFK2Uovlt3ZB\nEhTwCFxwq6wbkHNgvpqaDlN9NkMfPdscHdHAEguYL4RRX20YuKLCIFiWegDK\neDxrX330MyarZpD7vXtbt+tmlt04g1mHhKdg9zmrtT17lPjqbLNZjWFQxqUX\nOhSgam6S5Ggz2l/G2tSqU+UjXUhdgEnX/kGvXCqknkeiK+x1KsTmTJdS0L/m\n9wr6yOMV/jhYcBmT5JB710AfL2ygn6/d4UG+5+iqGnNHpDAxhhMHmaGDhId0\nDRUvtuQI2iw1uUG9grN9WgBbWRi2Pf8Gv8YuVbs9zEU0M7sWwnk82at6DWMY\nhXkb\r\n=9Aur\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEfRxs5HCKxxKVdhc6AhAhWpBfpVvvrN11G+xY80oCIeAiEA6CPrR89lXoHTiR7G92dFWu95tRnf+dnlBXkIOVklCYA="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.ba7a1b35.0_1613693632738_0.5986349564125772"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.9a566dda.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.9a566dda.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=11.0.0-canary.0b4a4b2eb.0","@material/line-ripple":"=11.0.0-canary.0b4a4b2eb.0","@material/mwc-base":"0.21.0-canary.9a566dda.0","@material/mwc-floating-label":"0.21.0-canary.9a566dda.0","@material/mwc-line-ripple":"0.21.0-canary.9a566dda.0","@material/mwc-notched-outline":"0.21.0-canary.9a566dda.0","@material/textfield":"=11.0.0-canary.0b4a4b2eb.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.9a566dda.0","@material/notched-outline":"=11.0.0-canary.0b4a4b2eb.0","@material/ripple":"=11.0.0-canary.0b4a4b2eb.0","@material/shape":"=11.0.0-canary.0b4a4b2eb.0","@material/theme":"=11.0.0-canary.0b4a4b2eb.0"},"publishConfig":{"access":"public"},"gitHead":"5093d1f8984fe9f44acd6597512a2de2ef5fbbca","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5093d1f8984fe9f44acd6597512a2de2ef5fbbca/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5093d1f8984fe9f44acd6597512a2de2ef5fbbca/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5093d1f8984fe9f44acd6597512a2de2ef5fbbca/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5093d1f8984fe9f44acd6597512a2de2ef5fbbca/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5093d1f8984fe9f44acd6597512a2de2ef5fbbca/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5093d1f8984fe9f44acd6597512a2de2ef5fbbca/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5093d1f8984fe9f44acd6597512a2de2ef5fbbca/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5093d1f8984fe9f44acd6597512a2de2ef5fbbca/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.9a566dda.0","_nodeVersion":"10.23.3","_npmVersion":"lerna/3.22.1/node@v10.23.3+x64 (linux)","dist":{"integrity":"sha512-q2g9otmgVvXLakdDEv5oPNrlQGa0HGJzBE+Bp5EY0c99ScopVXyjaopxlu/KavnevR2Y2PlyTnhtzOsHAjpxRw==","shasum":"be01c41307d6e1b16a61216bdedecdd2f5f8f6d9","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.9a566dda.0.tgz","fileCount":13,"unpackedSize":204777,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgMAWJCRA9TVsSAnZWagAAMbcP/0071KtaHf/uIqSIJx2M\nE1j/l29Hy8xZiyW122mUf6H77t8VMqa6V8oG895Td45PHrTupV/KjCWXZZS1\n8fUmgnhb6CnNNWSyEKZn1q2C1ZDXjMQpfCdRESgSf5fB63KbnY9jikmKAhgT\nJ1MOBRJVHjjqqhfdwmBApDy3FosnEkfBOP6TMcoWgbjOfRX3SdsmGiD6f39w\nDV1XHP9QErXSHlsTJGm3b7HM5AYgvhXfEAPSDO7XAgxpWg4kNMJpTbOTqfPL\neGg/Mz0TBokMO/ovUS+YCx6vcHxnvpqXlTdA89pB2G2uwup/OI/LWOvZ2kro\nIem9kgr0HDmmGWt94HwIPoOygE1luqZAN8rRWdCzshEifi7QFGZ1xyG/PlRy\n7zJTHOBvPnwTrsVRCJbFfsnFTNsx0qB3edCGAKrrJv9tClnkpW2WKB5WeFNd\nLc/OITBV4hDU6xT4/yVcPoJQml5wx/hbWLW2TZc5xM4+NuFUJt+PM9NXCPIS\nHz5Mumd+rdpIivHQdcM11j9zBAG8J/oIP4CoKjRtkPppr3xHkn7K/pJQTuJG\n6Hil/v7eWH/p2co7EvqtswdkDf6xJbLhLZbbB6Xh3whlPmPGm0e4AHAJrFA4\nw9zQRolw9m8tBJNYLBiR2Tr5IDn854Cs6MKl5iHVQJCyXJTsm0tpnrtgk31N\nGF/3\r\n=ZdGG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEHQpui60dYj/WJMrMlppXFJhw8Exr/4izHZJ/xEsB/jAiEA1TFM1103wtpd3qH4witlzbFlJdScwSMJC3d+4XLCvCI="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.9a566dda.0_1613759881429_0.07762067647443693"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.55addb8c.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.55addb8c.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=11.0.0-canary.0b4a4b2eb.0","@material/line-ripple":"=11.0.0-canary.0b4a4b2eb.0","@material/mwc-base":"0.21.0-canary.55addb8c.0","@material/mwc-floating-label":"0.21.0-canary.55addb8c.0","@material/mwc-line-ripple":"0.21.0-canary.55addb8c.0","@material/mwc-notched-outline":"0.21.0-canary.55addb8c.0","@material/textfield":"=11.0.0-canary.0b4a4b2eb.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.55addb8c.0","@material/notched-outline":"=11.0.0-canary.0b4a4b2eb.0","@material/ripple":"=11.0.0-canary.0b4a4b2eb.0","@material/shape":"=11.0.0-canary.0b4a4b2eb.0","@material/theme":"=11.0.0-canary.0b4a4b2eb.0"},"publishConfig":{"access":"public"},"gitHead":"02634c071c90f7c1124ae44f34cb20a61bf49350","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/02634c071c90f7c1124ae44f34cb20a61bf49350/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/02634c071c90f7c1124ae44f34cb20a61bf49350/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/02634c071c90f7c1124ae44f34cb20a61bf49350/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/02634c071c90f7c1124ae44f34cb20a61bf49350/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/02634c071c90f7c1124ae44f34cb20a61bf49350/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/02634c071c90f7c1124ae44f34cb20a61bf49350/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/02634c071c90f7c1124ae44f34cb20a61bf49350/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/02634c071c90f7c1124ae44f34cb20a61bf49350/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.55addb8c.0","_nodeVersion":"10.23.3","_npmVersion":"lerna/3.22.1/node@v10.23.3+x64 (linux)","dist":{"integrity":"sha512-xyVJx61s80ld0VAiPjIbJTVSsIj55iYVQq9mQ96msbJOb5mQkC9Ab+uAj0wphJ2Ev+d6TdyZwIVWetOS8rY7Fw==","shasum":"1286b85412c64c7fbf614db60a95ccceee48552d","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.55addb8c.0.tgz","fileCount":13,"unpackedSize":204777,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgMDVnCRA9TVsSAnZWagAAjlkP/1doUQh6rJVRxcchu4qB\n5cWjwqn9QnBm18TYazMfI0XGrC70EO6g8VD4eorOL6TeMmLUIMQ7ZNblHJDs\nSjc/ku4CYdAOT8CiFoZ9RQq/U62Aq4G+HMMUOVg3ohI+E6V8RJqYHkfx+cCJ\ncQApz6+EaYEtlSnpLRSRFijhmYcih2hsNORpI1XRtR4ZIFQV/PiClOLidD9D\n1ahRxj1K0QbgelKLFwJEGQGHR/frPshJEn2Osj2wWlsF+mhYgBqAbmhQArOt\nXnvSBA0LKfXdEzv9coSk/iz2YBKkKK2Ojmunh0YUcXn4T29JNt3xelSi/LoR\nENrMCE9/qOf0hO4io1R6wIVBWcIbAYkdIYiTLjTW7KT18ksKNYv8zl74h1wL\njcssyljoX5WBA6d5ZEDtbIyD51nnWSomWq8ENbpMxCyaNZAF9jO+j9xo/0ZS\nIL0Y/L467PLekrtxlohE3aAIMcnuBHMoaqCbM6T+scshm3Zm28b3+gnau78e\nJ8ADEQP/6XUsvUIEoI7pSWfPjBPw6CINEta5tnEmE4Xt2wAtE60U7hHedbTs\nqi7n/OVehEC58YTRvRF+A37BarlQo0AYC6hEfWto9wWAnsN66fJdyPjR59YM\nTz0uLy6RaQ3BDVueTqyb/4Ku8qVAcA85gJN4UgB/i1ABdNyiMaMeyWNB8l7k\nbcuq\r\n=jiix\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCSmwMpwUONqhWbhqvd9U4aNBP0I4nnf4+Y0UWyt8zUVAIhAKlLdYcYYbdouOaWM19ilSvBmtc74uEzPc4sMdjJ6lle"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.55addb8c.0_1613772134970_0.823477585736013"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.85dd5e9b.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.85dd5e9b.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=11.0.0-canary.0b4a4b2eb.0","@material/line-ripple":"=11.0.0-canary.0b4a4b2eb.0","@material/mwc-base":"0.21.0-canary.85dd5e9b.0","@material/mwc-floating-label":"0.21.0-canary.85dd5e9b.0","@material/mwc-line-ripple":"0.21.0-canary.85dd5e9b.0","@material/mwc-notched-outline":"0.21.0-canary.85dd5e9b.0","@material/textfield":"=11.0.0-canary.0b4a4b2eb.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.85dd5e9b.0","@material/notched-outline":"=11.0.0-canary.0b4a4b2eb.0","@material/ripple":"=11.0.0-canary.0b4a4b2eb.0","@material/shape":"=11.0.0-canary.0b4a4b2eb.0","@material/theme":"=11.0.0-canary.0b4a4b2eb.0"},"publishConfig":{"access":"public"},"gitHead":"a723fb0b68d5c0ab6eb13c066a9c255b58d1e19f","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a723fb0b68d5c0ab6eb13c066a9c255b58d1e19f/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a723fb0b68d5c0ab6eb13c066a9c255b58d1e19f/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a723fb0b68d5c0ab6eb13c066a9c255b58d1e19f/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a723fb0b68d5c0ab6eb13c066a9c255b58d1e19f/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a723fb0b68d5c0ab6eb13c066a9c255b58d1e19f/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a723fb0b68d5c0ab6eb13c066a9c255b58d1e19f/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a723fb0b68d5c0ab6eb13c066a9c255b58d1e19f/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a723fb0b68d5c0ab6eb13c066a9c255b58d1e19f/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.85dd5e9b.0","_nodeVersion":"10.23.3","_npmVersion":"lerna/3.22.1/node@v10.23.3+x64 (linux)","dist":{"integrity":"sha512-e2EgbP/ZUHLl38gBDJr7/n+QvlxNdSZ4z9JZAhXDJdU0Mh/7Vy2AI8TzyJ1bzyBGWA/ctOtiTpJ7zuO+M5iwgg==","shasum":"32e8493ef0e631074e99d4c5bcda717b50842b1f","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.85dd5e9b.0.tgz","fileCount":13,"unpackedSize":204777,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNGYgCRA9TVsSAnZWagAAx54P/0O+JVb4GoszlV4BXpaH\nRia962DBuKq/p167PLgWK1T4yOCxdiQz0+FjxiERQjt3s3GBbUBsrdMqxQSV\nhkKQG0rzCzI2xV/MAly1vKO85E7L+MF+SwRjk1mzFoLfYqFnPi7EvRBGTXX7\nqb+ARa3AvB48oLPo6slN2lflIiU+Rpf0YCnblIyILe31uvRkC4n3FB8ZQJ7e\nP9DZ2SGbBqZh0x01l72FQCgBUCTWZXQAlSFA8RJ2uhDMzH4gjhgZfLSWGFjv\nx08LHenTno5UnxFskCurMPXLSIK96AFjeG8jio/wb0J9kN2SiSepRs7Ve9TE\nsyx+TSzzjNHvAl9bchXGx1dg7ykBediGf7UBnelODbI1v+uR23HD0p+dc5/n\nzccoDqxBA9O9PBUdGGHQsR90ies6OHVEt6a59M+YwIF6gnWcsk04ByQ40NWI\nUp0SU8h/ybF1YYt6jVsORgf7//6ECLtnciOReBoY/ELM+JSD/r0MsEAuC5be\nVP4Ebd64j6r45a74AAYiujfgwOkJ1vnh5CpsKefOYkm6m88WHsFLu2Rl4yHb\nl+fKodEi3V8IPenloSYb+AbNwhYHuuNCSxflc6Ve31AcwjHWSkdlA+fncqwH\nGViBc4l9djid8M98e64WVo8ssZFw6SqscohRaxHiXKLnSSOWC6ZtZTC6KGhk\nsdi3\r\n=Uu86\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAoLuUFqRF5ddedZK+kZiyouUsW0cERIkB9xWMcgfGG7AiBToZ7jKpfCnggfRTt1qCgkoouLcBU5W9vLzlGyDJqSLQ=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.85dd5e9b.0_1614046752285_0.5341153493695028"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.aa3e078e.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.aa3e078e.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=11.0.0-canary.0b4a4b2eb.0","@material/line-ripple":"=11.0.0-canary.0b4a4b2eb.0","@material/mwc-base":"0.21.0-canary.aa3e078e.0","@material/mwc-floating-label":"0.21.0-canary.aa3e078e.0","@material/mwc-line-ripple":"0.21.0-canary.aa3e078e.0","@material/mwc-notched-outline":"0.21.0-canary.aa3e078e.0","@material/textfield":"=11.0.0-canary.0b4a4b2eb.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.aa3e078e.0","@material/notched-outline":"=11.0.0-canary.0b4a4b2eb.0","@material/ripple":"=11.0.0-canary.0b4a4b2eb.0","@material/shape":"=11.0.0-canary.0b4a4b2eb.0","@material/theme":"=11.0.0-canary.0b4a4b2eb.0"},"publishConfig":{"access":"public"},"gitHead":"2acbbc6ed6d9f649621ee54e8265c9d26c49f634","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2acbbc6ed6d9f649621ee54e8265c9d26c49f634/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2acbbc6ed6d9f649621ee54e8265c9d26c49f634/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2acbbc6ed6d9f649621ee54e8265c9d26c49f634/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2acbbc6ed6d9f649621ee54e8265c9d26c49f634/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2acbbc6ed6d9f649621ee54e8265c9d26c49f634/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2acbbc6ed6d9f649621ee54e8265c9d26c49f634/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2acbbc6ed6d9f649621ee54e8265c9d26c49f634/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2acbbc6ed6d9f649621ee54e8265c9d26c49f634/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.aa3e078e.0","_nodeVersion":"10.23.3","_npmVersion":"lerna/3.22.1/node@v10.23.3+x64 (linux)","dist":{"integrity":"sha512-IPckXSnf6Mv2dwy9nU2jMZG5dVORzisCY1N5extE50Mq7aFyRohqVgNrmfkdoKYBz4JNa1OYIQQTYGbunuMKYg==","shasum":"26be9842f87fa8d9f72724c2ffc22a57de2240fa","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.aa3e078e.0.tgz","fileCount":13,"unpackedSize":204777,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNTgpCRA9TVsSAnZWagAA7mMP/ja6hk5j/0nKTVp6EJem\nBmk1S15/YTMcGxG6gdO3gdvXo3yJ+1J8Ju/t4JXGydm/oArSW+jP1O/sPLrO\nRWs9zxHD4CoMtEa/6I3LS1bHGHQH5JFDHo2OpDDkrILsbGVgP4TmgX+SJ35Z\n2kVL4iQHrG6+/59VSTMtUMnIvtNSp9j1AC3sRc+PSfNWxtrix8h9CmT2qoX6\nIvOhUD2kWg9DRcY+8wegNUKcMg/oCughHIvJSyFsNRqyc4RlHl7eqpDIuNZG\nD9TRqITKsF0PpAGsR7H44/yhQZu8wi5I8VqFXinme2B8cHDMlQJnCLr6o9Lc\noC1Noxxr8XpEoncRdUa728dvBFh8qv+XeLT0vNjewQx0V+KM8+y9+bGY9aWn\ngCXV5jdZr+F9wlLUlE4hweq5OqXeCaUrA4eQEZGiCd0RlLHpts1ATTHu7Uxk\n9h0zeAN60RMiNYFxGEBL29D6UEtFTTd/q8YoJRpQMgmRR82NIGzmb6bh1ey+\nAkiiAUgqeK0QlRZd2rChiHH0gIvtdaj0OfrnjviztdNcdEck+L0xsYxYSs3X\nHaSwauyMFA3sBbOydfTbvX7ST2bKFHIq7hTdMRS/E6ZpkdjMbJWOXLWlVx73\nnZte7dbbs8JnZ9sneMdr7PcQmw8EmZXrfZslWRTuShOsulpiG4GU9nvbi81E\nHrL+\r\n=lpyP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHMgglUNdw45CX29JdHpUobPxCeOLM0+7+Kkhoh2yHH8AiEAoBNhZercn5j4Fuz4uR3EN2nZ1kNkx/fVNf+lYUVD1GE="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.aa3e078e.0_1614100520875_0.35028395928051426"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.dccd254e.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.dccd254e.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=11.0.0-canary.0b4a4b2eb.0","@material/line-ripple":"=11.0.0-canary.0b4a4b2eb.0","@material/mwc-base":"0.21.0-canary.dccd254e.0","@material/mwc-floating-label":"0.21.0-canary.dccd254e.0","@material/mwc-line-ripple":"0.21.0-canary.dccd254e.0","@material/mwc-notched-outline":"0.21.0-canary.dccd254e.0","@material/textfield":"=11.0.0-canary.0b4a4b2eb.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.dccd254e.0","@material/notched-outline":"=11.0.0-canary.0b4a4b2eb.0","@material/ripple":"=11.0.0-canary.0b4a4b2eb.0","@material/shape":"=11.0.0-canary.0b4a4b2eb.0","@material/theme":"=11.0.0-canary.0b4a4b2eb.0"},"publishConfig":{"access":"public"},"gitHead":"7c3011f1d9328f6405596f794c28c98485d9d40b","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7c3011f1d9328f6405596f794c28c98485d9d40b/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7c3011f1d9328f6405596f794c28c98485d9d40b/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7c3011f1d9328f6405596f794c28c98485d9d40b/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7c3011f1d9328f6405596f794c28c98485d9d40b/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7c3011f1d9328f6405596f794c28c98485d9d40b/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7c3011f1d9328f6405596f794c28c98485d9d40b/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7c3011f1d9328f6405596f794c28c98485d9d40b/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7c3011f1d9328f6405596f794c28c98485d9d40b/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.dccd254e.0","_nodeVersion":"10.23.3","_npmVersion":"lerna/3.22.1/node@v10.23.3+x64 (linux)","dist":{"integrity":"sha512-pzw/RA/u6SiXskBlQNWrqidUrtyJ80OpKvV09tNJYwX4Y23VaRXBCcARJm3iL2Eif2hYN+ZCQdEiTj9Iw+w7qg==","shasum":"220a636a2df8aea5641e15ed38122b005a20a802","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.dccd254e.0.tgz","fileCount":13,"unpackedSize":204777,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgOWPICRA9TVsSAnZWagAAnQgP/3lufG3T91XjZt5t/ccd\n2VNFtoVuqn4I7mMbc4FHAOODfc5V5+Y5UdxCV3IB4t3l/avIXnm5tyb8/XJV\n5yM0vtu+3Dg+5W9wC2OfE/IDJRh19X+QbJ25X0qYelx2p2wzE7PXvs/1ZwIS\n1lT6pbGGteiolkqzqUetsskG+p7j/QPmCoAmU/BO6cm+aHXyDOd7CwRgTZlm\nPwjlJchfinWYq5xfJwO0+5TIjIELJL5W5Nbh8+MpZokyYd8ETHXGcnnxI3PD\nE/ss+umKZpVH1lrtt52uW/pETXxrpczWBR5LhnUqiEE7NrpFE1UX34gNzJxf\ngCzc0zM0c6fHkC9qE/VVx1NfWp4Nak3gZPO2xO9QE0LVI4Z9RJWeXKxwSTcF\nBmqy8bOgaXdfBSHj7Q+x1mD3nRhoLCN9VyBlIY6UXtz8MrLA0Va9QUOQArwg\nTT1Zw6y69WuFbNSlM2ddruny8OAYRqUScjh0Huxtple7u7qVTSZfhBssgvY+\nhF7PEgAnkR+jrjL161hVmqLSBqjQXf6jWs7Kn8rXRrAuZzjXop2v3kpvPY9V\n4T6WHL7u96pkgC/n4ZYv7KuD6X8SmGv0pB/zSE6RFb4gH1BoolIzyQ/0XcXr\nRv3cg9cOLGEuD0TCqHcY/vHukqyykHcBPqht/8VSokvjzo/VvRNPRFZ8As55\n6OAX\r\n=DdCa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBSwNfPgUnCQHIWJQDL+XKptQkYC3rJiS+Qs7Nu4ElajAiEArzgqYx5EqB9i5AlDcwLsfLTANuseAgewDUVKYPCFsss="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.dccd254e.0_1614373832491_0.9485543142227308"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.7dd1a27d.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.7dd1a27d.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=11.0.0-canary.0b4a4b2eb.0","@material/line-ripple":"=11.0.0-canary.0b4a4b2eb.0","@material/mwc-base":"0.21.0-canary.7dd1a27d.0","@material/mwc-floating-label":"0.21.0-canary.7dd1a27d.0","@material/mwc-line-ripple":"0.21.0-canary.7dd1a27d.0","@material/mwc-notched-outline":"0.21.0-canary.7dd1a27d.0","@material/textfield":"=11.0.0-canary.0b4a4b2eb.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.7dd1a27d.0","@material/notched-outline":"=11.0.0-canary.0b4a4b2eb.0","@material/ripple":"=11.0.0-canary.0b4a4b2eb.0","@material/shape":"=11.0.0-canary.0b4a4b2eb.0","@material/theme":"=11.0.0-canary.0b4a4b2eb.0"},"publishConfig":{"access":"public"},"gitHead":"15fa381ead1eb4897aa006da0f445765fa9a037b","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/15fa381ead1eb4897aa006da0f445765fa9a037b/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/15fa381ead1eb4897aa006da0f445765fa9a037b/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/15fa381ead1eb4897aa006da0f445765fa9a037b/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/15fa381ead1eb4897aa006da0f445765fa9a037b/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/15fa381ead1eb4897aa006da0f445765fa9a037b/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/15fa381ead1eb4897aa006da0f445765fa9a037b/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/15fa381ead1eb4897aa006da0f445765fa9a037b/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/15fa381ead1eb4897aa006da0f445765fa9a037b/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.7dd1a27d.0","_nodeVersion":"10.23.3","_npmVersion":"lerna/3.22.1/node@v10.23.3+x64 (linux)","dist":{"integrity":"sha512-7GdAOfV2JKS49iA9WA/ty4wlymc9EDGcc0fF490amK9hGRkSKqz5ZutqTgIJwbOGPLUFdXaeZoBSf3pwIVTetw==","shasum":"6d4009eeac3a226bbefdef9030040c96141f2fac","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.7dd1a27d.0.tgz","fileCount":13,"unpackedSize":204777,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgPWQiCRA9TVsSAnZWagAAHmMP/3RiG2dwAgpamgVOr+jX\nGTsUHIZXxtzgDlJMtfn34xA52RH6EGOLDr9FGV4Jr5lm4aBxizUk2L/b1niw\nfuGGH9Kv+Q+DRUwEA8ymp5KQzelE7+Gmju+un+4DIl+/UJpsoF7Zech7WwWq\n9gGQxC0MpQMNYQyOr41f4u2G7t2cXIw6N9omPpefJOkE2gNYsYl9MmbPn64r\npwqu/Uv5oQGzcRfSQlYgmbpoNG7GWTsjAhG3CqRQzzMqxpXkVSF+7bpDRqOK\nfBNuW+norVFZ/WjPySYTlAIeB3UAq3YMi6Le6i2JtW05P4YlPA1Qoo+/4deC\nKc+yLWHffttwBjxnURqnGtigWsqlBe8L77ArRonpLnDA+MSktsUSGqOsqmjf\nPJQ7RBln5fG2VZOIcjHbxOYz+tF3yCtiSEareLDlofAovkyy9yV6zXewxt5X\nutdagkDvJ18sXu6G7U/PzDy6u6DzQe1VaVXcqeYIJQf0n8EyUXdVaXaryRkd\nu2GZmztfFF8VMthlHGFhsi+FDoUoWgurVZnrfSOFbbYqXAYNARxqVR8+dajR\np3HLLyoCj5aZV7X0WKoc0abXR7wCZ7BnhQ6p787piiq64HQFnAEKPPc4wF+R\n/Ms0/KkFDGFGaGIXzuZSLsJxbXXagCe+n3fcVhgIudmi7V8ilVm2LWo544Xv\nke3r\r\n=6rNo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCO9laPnfLJCVSS3cFmeFR3Ou+joyunlgUqFW1jDhQKugIgXncPj+jPkdcE5RYEx56PnEFji4GgX9xVYMQ43zk8aWk="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.7dd1a27d.0_1614636066108_0.4919514978735071"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.12574572.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.12574572.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=11.0.0-canary.0b4a4b2eb.0","@material/line-ripple":"=11.0.0-canary.0b4a4b2eb.0","@material/mwc-base":"0.21.0-canary.12574572.0","@material/mwc-floating-label":"0.21.0-canary.12574572.0","@material/mwc-line-ripple":"0.21.0-canary.12574572.0","@material/mwc-notched-outline":"0.21.0-canary.12574572.0","@material/textfield":"=11.0.0-canary.0b4a4b2eb.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.12574572.0","@material/notched-outline":"=11.0.0-canary.0b4a4b2eb.0","@material/ripple":"=11.0.0-canary.0b4a4b2eb.0","@material/shape":"=11.0.0-canary.0b4a4b2eb.0","@material/theme":"=11.0.0-canary.0b4a4b2eb.0"},"publishConfig":{"access":"public"},"gitHead":"043d9159945b812192eb864b33d16f892831b4d9","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/043d9159945b812192eb864b33d16f892831b4d9/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/043d9159945b812192eb864b33d16f892831b4d9/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/043d9159945b812192eb864b33d16f892831b4d9/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/043d9159945b812192eb864b33d16f892831b4d9/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/043d9159945b812192eb864b33d16f892831b4d9/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/043d9159945b812192eb864b33d16f892831b4d9/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/043d9159945b812192eb864b33d16f892831b4d9/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/043d9159945b812192eb864b33d16f892831b4d9/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.12574572.0","_nodeVersion":"10.23.3","_npmVersion":"lerna/3.22.1/node@v10.23.3+x64 (linux)","dist":{"integrity":"sha512-6nx2yZT9PDGQ4kzoe7Tbi/JheQiAYvSdOmvVXkWU35Tch/Ijdm1CioQUSEAvlPKY+zyEP9bR8dKwzGIkw5pPaQ==","shasum":"5e95296c773da0dc156e2f8749a3ce928b497141","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.12574572.0.tgz","fileCount":13,"unpackedSize":204795,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgPqAkCRA9TVsSAnZWagAAzxkQAJnD/QZBVaW3ciIwCKx8\nanLeUJknNZs8E/GktsFsv9trdHn938eu1/Kc+Y9wly2qJ7IEV9AkcG9N6Wjj\nUAI8qgf/Yk/xAEYkIIptUtRb/p6Rd4JZO7xXPhANMfb5fkQRgRF/2edZLvmh\nCkxIg82dPDL+A6hDOnbCbpYuvRyXFdEyaG3R5LTPJynmOw4MS0ivKzTf0dgd\n1+roT4EFwkyH+YACfKURgdpZmeTCA0Y8+fSYIaDWGHWyfs5/XvrgEtyLu4ha\n7aWEJ1yyMN+MzmWj4B95odAAexfNDTgskxIy74yo/aNKzzYCB0S1a7tJX6xc\nHTTaJ3DGEvYdCJAsmJmgPES8G1mYt1uj9U8iDohu89Es1qh3xwzOXcfjAwOJ\nmLRJmy7LHvvUQM7pXkcF9ZlExQAI2oTO8AXLnr0pESk3HkK6PD70HBimnnvi\nKbT2oYOXXspre1Ae9cdRJ6V1miciVDQ//oB6vGHDPEtR7td/CPrrR9fv8owq\n1POGkqnRhlNHB4vop/YImgBwaHvoRwU/iEJ++P9T9BqlTEqnZwHXlVwsUeE9\nHZ2VHNO6s71rqlHcTUGEc/UwtoOOD0UnoZdTaoZi/MzoFQ8Hsn/3fb6rsq9H\ndavG2IrDXSRtDkyXaJjDDQkZuNVLrqcYid0fcAzUyaOw8o9vDGOFQH2P10RN\nHnl5\r\n=LrbI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCGBROIRpery+Ep2FjkrTb8OkHR3SmJEjD2oePiTE7JDwIhAKrNMv2WR6SNr9WcCc0X6ffLr8oBuk2VnkCv841FSbj0"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.12574572.0_1614716963847_0.39123865810794367"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.1109a3d3.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.1109a3d3.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=11.0.0-canary.0b4a4b2eb.0","@material/line-ripple":"=11.0.0-canary.0b4a4b2eb.0","@material/mwc-base":"0.21.0-canary.1109a3d3.0","@material/mwc-floating-label":"0.21.0-canary.1109a3d3.0","@material/mwc-line-ripple":"0.21.0-canary.1109a3d3.0","@material/mwc-notched-outline":"0.21.0-canary.1109a3d3.0","@material/textfield":"=11.0.0-canary.0b4a4b2eb.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.1109a3d3.0","@material/notched-outline":"=11.0.0-canary.0b4a4b2eb.0","@material/ripple":"=11.0.0-canary.0b4a4b2eb.0","@material/shape":"=11.0.0-canary.0b4a4b2eb.0","@material/theme":"=11.0.0-canary.0b4a4b2eb.0"},"publishConfig":{"access":"public"},"gitHead":"8cdd512cc62bfc703a1cc766d67d04509e4e0c08","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8cdd512cc62bfc703a1cc766d67d04509e4e0c08/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8cdd512cc62bfc703a1cc766d67d04509e4e0c08/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8cdd512cc62bfc703a1cc766d67d04509e4e0c08/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8cdd512cc62bfc703a1cc766d67d04509e4e0c08/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8cdd512cc62bfc703a1cc766d67d04509e4e0c08/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8cdd512cc62bfc703a1cc766d67d04509e4e0c08/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8cdd512cc62bfc703a1cc766d67d04509e4e0c08/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8cdd512cc62bfc703a1cc766d67d04509e4e0c08/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.1109a3d3.0","_nodeVersion":"10.23.3","_npmVersion":"lerna/3.22.1/node@v10.23.3+x64 (linux)","dist":{"integrity":"sha512-f1/vbE84+J2m1OfjNgsClzQe4FU55jFdgd6vtD8L3197RLuOSbjKEjivAiIZoVp811zuVgoyiC/jJAqxRJO83A==","shasum":"180d7abee4e537a6ac0e39993b0bed76202c41b3","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.1109a3d3.0.tgz","fileCount":13,"unpackedSize":204795,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgPqFcCRA9TVsSAnZWagAAcwQQAKUK3OPW0/32ryfmv9G5\nTR5msdZmfyE8AbZ/dkl/xhmCjE1e9bN2CjnEx1kla9h/kXSTTC3QAO525WrQ\nCvNj6UWmJnoLPQKAmbGVqU3YsoTwpEnxVMeJqp1EN49EQA/qBzFbsdVx6ESv\nXl6lHkGsXCfF1MqSd7lEywwgqSUWoFJ36JVIcW17GrhvDwR3C/zetHHMuXgB\nzlWuZe4wgYNxwtXAydhKRI1bueKtP++kx5B0wkbWhYZWUYVNK4wHZIc34qUS\nn+EGWx2K7DyqPYEiDCXw4P8lnXbEA00ORPryu/CKDUfNfEOxq+ZdBGBTEc3H\nR9FUFHJpUSUMC3If0nv9SgX3xWkDN5NBhfJAHrMEtraxRIR2aq+EdoiH6gT9\n5GyCgG0aGoGai4/jVErOnwsy98tgnoi97kcWDCVHQM5ilEH/JNl+Zy++2TE+\nIIxf3vS+lrJ4kIwW40H5B5kYw9pEYzZLnGqwAqrMe90vo0VGPo0y/jo3Zrfp\na88CFN/D4Vr8D7u2/5Fo7qu4pB3C/8zZ2aXuPrq5DcA0J5K6xcTCkUHRsHFu\ncDkk+7kn6ZcQMHHlehGNPIumYNDTohwHK0Xgsnc7cINE483+940LMdgx74cQ\nghcgzF9E+BqN0KIg1L26z3LLCEs0swEI8gpGo1wG8cXqShRqcsoRXRsD/G5K\nzeDx\r\n=LAFA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH4TaT6uTMbxb6ZRx693oHYMNf+aCr1SlQQ+Ng7IDDdGAiBnN4T+iaSy3FsK2AN6Oo06N9wkur4NPr591m+pC0L6Dg=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.1109a3d3.0_1614717276247_0.5814852978224667"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.b9cd8739.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.b9cd8739.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=11.0.0-canary.0b4a4b2eb.0","@material/line-ripple":"=11.0.0-canary.0b4a4b2eb.0","@material/mwc-base":"0.21.0-canary.b9cd8739.0","@material/mwc-floating-label":"0.21.0-canary.b9cd8739.0","@material/mwc-line-ripple":"0.21.0-canary.b9cd8739.0","@material/mwc-notched-outline":"0.21.0-canary.b9cd8739.0","@material/textfield":"=11.0.0-canary.0b4a4b2eb.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.b9cd8739.0","@material/notched-outline":"=11.0.0-canary.0b4a4b2eb.0","@material/ripple":"=11.0.0-canary.0b4a4b2eb.0","@material/shape":"=11.0.0-canary.0b4a4b2eb.0","@material/theme":"=11.0.0-canary.0b4a4b2eb.0"},"publishConfig":{"access":"public"},"gitHead":"89fe0448abab4c371af17b2866ec736d9ebd8cae","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/89fe0448abab4c371af17b2866ec736d9ebd8cae/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/89fe0448abab4c371af17b2866ec736d9ebd8cae/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/89fe0448abab4c371af17b2866ec736d9ebd8cae/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/89fe0448abab4c371af17b2866ec736d9ebd8cae/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/89fe0448abab4c371af17b2866ec736d9ebd8cae/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/89fe0448abab4c371af17b2866ec736d9ebd8cae/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/89fe0448abab4c371af17b2866ec736d9ebd8cae/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/89fe0448abab4c371af17b2866ec736d9ebd8cae/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.b9cd8739.0","_nodeVersion":"10.23.3","_npmVersion":"lerna/3.22.1/node@v10.23.3+x64 (linux)","dist":{"integrity":"sha512-VehrHB03YQyx12qZHXE1qVC5ol/9gFAOKAIHv+aWlSKoNEewFukBr7Yk06IJNhY6o+gPKW7TKccj/5Zg6QSoTw==","shasum":"1550c1369d1be4efd59237ed584885f4383c8ff4","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.b9cd8739.0.tgz","fileCount":13,"unpackedSize":204795,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgP8uvCRA9TVsSAnZWagAAK6YP/0b//TPzeq6SRqeh92Z5\nod19NbuwJF7z3dunGteg9R+i2k9pAXzbH9s5LPdVJemJLqPDcyu+tE4jopv5\npc3u+OC/vueCK2nHsDIU5xuG2Fb8BBVIkk6rMbKORRsZ0jOEmdSrUlC3BAXV\nOYaCQnnqSjFSzLA4R86IvdNvMlJjMCEsQ6hF8nulXlB6xxtNL/Hc3b+uflfs\nGeOdyQsok1UXQXTZCs1raR7XzBWm4qAFnjmAnNpeigHgac9RwdcrlWnP4vU7\n7DBJFJbcC+WzMaLa3ts/h5xr72A3HrrsunKbWdLThUXas4ysvOgs69f8hWL9\nBK9+uE39JZYznPUPbW6UullprgZnCQGCvUncaqrq1ew1YBctGCUEEFGkKfgk\ngy2vbn14nJdelps8w0wjDBZT4QELarzL1abaJXftj8IYGQXNFbS2lbm1TSxa\nkAIp2h9eSxI/HyOzOFBm9ba4nPNVPPzq7Suvf5kn3dS5LOw+mud+EeCwoT9x\nKqWlFoh28pN+mkxRn2JY5pcB8Zr+FMR2ATqOw2JAgI8FsvcBsZyDv9Ia1Fpa\nGvx6huWc8jTH3MZfZ8AvUwOKj5qpcSQDQ1OBYv2jRkXaKB5cqfrYj9NUB8lU\nwRfCvnrRRvJ+twKSxMKhxoEOdb3SNm8Xdoveun2xqr02XZL6qJzrIFG1Vu7L\n4AbR\r\n=PZ61\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBEJNNn11WcxCnTkmCMmbbObUBD3A+rngpMWY5m77u2BAiEA5KtC8XOv/DIDPAR8VSh3a0ubj1s0JzI8bEwvAFIzPvI="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.b9cd8739.0_1614793646494_0.33672983688963765"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.71ee796a.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.71ee796a.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=11.0.0-canary.0b4a4b2eb.0","@material/line-ripple":"=11.0.0-canary.0b4a4b2eb.0","@material/mwc-base":"0.21.0-canary.71ee796a.0","@material/mwc-floating-label":"0.21.0-canary.71ee796a.0","@material/mwc-line-ripple":"0.21.0-canary.71ee796a.0","@material/mwc-notched-outline":"0.21.0-canary.71ee796a.0","@material/textfield":"=11.0.0-canary.0b4a4b2eb.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.71ee796a.0","@material/notched-outline":"=11.0.0-canary.0b4a4b2eb.0","@material/ripple":"=11.0.0-canary.0b4a4b2eb.0","@material/shape":"=11.0.0-canary.0b4a4b2eb.0","@material/theme":"=11.0.0-canary.0b4a4b2eb.0"},"publishConfig":{"access":"public"},"gitHead":"d989f6470cdcdd144c7021a4eb0ea47e63945cc7","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d989f6470cdcdd144c7021a4eb0ea47e63945cc7/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d989f6470cdcdd144c7021a4eb0ea47e63945cc7/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d989f6470cdcdd144c7021a4eb0ea47e63945cc7/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d989f6470cdcdd144c7021a4eb0ea47e63945cc7/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d989f6470cdcdd144c7021a4eb0ea47e63945cc7/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d989f6470cdcdd144c7021a4eb0ea47e63945cc7/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d989f6470cdcdd144c7021a4eb0ea47e63945cc7/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d989f6470cdcdd144c7021a4eb0ea47e63945cc7/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.71ee796a.0","_nodeVersion":"10.23.3","_npmVersion":"lerna/3.22.1/node@v10.23.3+x64 (linux)","dist":{"integrity":"sha512-8MzlW90xbdMBeFPsiGiMtC6Hk+cUOfUEoNgVfOj2MhTpcA5DroJ5YsO1LrN/6BNErjGVmCg286D+uxrTls/ojQ==","shasum":"6e994c5c4cd0aa98a68594401da61a3cf8acd34a","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.71ee796a.0.tgz","fileCount":13,"unpackedSize":204795,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgP+1TCRA9TVsSAnZWagAAdJ8P/jZoFXB0JIAiYPx6eaNb\nV2/3Uq6MEKNMSxv89zQ3v8La5BeMVqaXHJdZvBL523USPtrWlbJzP4FZ+PIe\nbY1x7kr5JcQS+DuLECjhcgZqCFMyUiYFkG8CSpkMN2YyJ0eeeHYLg2U1uWTa\nq9bzUxCCsXOyMHiVZeIxktFhQCWjYmw6f/iZEaOqYU6aRddo4c28P5jctWnj\nABJj4ixXwTwyEHf41dnyrgf9kgP/FbjpBsH6SPJWsK5Bh359vSQOY5YsBZWg\nCymnTzKVgGw7A8f1iqb+7+7Rza7J66PZ6YVvymfjG99MZPa13mHX3tFscBhL\n0a9F7WUdO5pPmCF+3sHzW/NEcbBBmz9ww/3DDGOTYcuywIUx2wg2fYnB/pGl\nBjbTxca8pmjKu50kllVBWShQbYf0gaZJEdIklDVdEflxQggAe7Z0+3ZizxId\npOSS+9LZyLEsgpyP80E4+M44jbrwBVa6WDkwqUzL9pcqYVZntnqy5Y8WsA3J\n4nGQWmY2xzasbEAxns2UGfXyAwNrj8HWgYqSCAzu8IbaNanVIcaZAryVj3vW\nNyntkm+0wadnPdIMjU6eo6H+BVqS6VJ1Rxz2rnOPrp+7Hbuh6JmJ2Qo0nigE\nglYJTrYE1bBtBo8khDy/sArrnfmizZthn2QzZrKtnzu9EBqUkspAXLNOzuSp\nWz18\r\n=NDss\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB067FkEqy4IDYXtsDKoYQPSEml6L67eI7jUudfft1U+AiEA1AMr/0WyeQx2lCq7G1U1pG9kkYZBiEewfA+R5NkoNvM="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.71ee796a.0_1614802259526_0.1942448054951551"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.2be191ed.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.2be191ed.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=11.0.0-canary.c7d98fcde.0","@material/line-ripple":"=11.0.0-canary.c7d98fcde.0","@material/mwc-base":"0.21.0-canary.2be191ed.0","@material/mwc-floating-label":"0.21.0-canary.2be191ed.0","@material/mwc-line-ripple":"0.21.0-canary.2be191ed.0","@material/mwc-notched-outline":"0.21.0-canary.2be191ed.0","@material/textfield":"=11.0.0-canary.c7d98fcde.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.2be191ed.0","@material/notched-outline":"=11.0.0-canary.c7d98fcde.0","@material/ripple":"=11.0.0-canary.c7d98fcde.0","@material/shape":"=11.0.0-canary.c7d98fcde.0","@material/theme":"=11.0.0-canary.c7d98fcde.0"},"publishConfig":{"access":"public"},"gitHead":"e273563187c689092eb053c50fd9b94385380fb8","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e273563187c689092eb053c50fd9b94385380fb8/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e273563187c689092eb053c50fd9b94385380fb8/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e273563187c689092eb053c50fd9b94385380fb8/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e273563187c689092eb053c50fd9b94385380fb8/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e273563187c689092eb053c50fd9b94385380fb8/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e273563187c689092eb053c50fd9b94385380fb8/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e273563187c689092eb053c50fd9b94385380fb8/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e273563187c689092eb053c50fd9b94385380fb8/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.2be191ed.0","_nodeVersion":"10.23.3","_npmVersion":"lerna/3.22.1/node@v10.23.3+x64 (linux)","dist":{"integrity":"sha512-xkH5D8/yhfpJpSbI16NNculxbzgsgLBFpEIymU4r45ckfrgFl+pNPtpi1+0WtiizGGSrAxBQ4bpzvpQ36fwsHA==","shasum":"06a6b74d28e718c6c99ab9e4677e5e09e2c9a5ad","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.2be191ed.0.tgz","fileCount":13,"unpackedSize":204795,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgQATnCRA9TVsSAnZWagAA1d4P+wS85dEpIBc3Nq2ysoDS\nLh4j2S0TMhTeH7YeNLQMUxvKedFeLf7GqLTc24Dzp+QotNNlp8STQE7ai/Aw\nl+TeLDnLvoWHGvv1TnBYZpW3rjLbRlQKAdtNxKF5fwO1BVhMBYzJAsZxxGBV\nhJnQgV9ephvBCLp7NrWGW73hE8quDLLO4v+H39rGW6F1zDbLPbfc+f6/sYD/\nYHxuGhHZC/Y11yXgueOz+nwT4UuKmUTf4asM+1S7O7N2PPV+JoEOO9b0Sjdv\nQvXV8RR8Mres1EBbBRcTFseJfk/zBMgZbWfdAii+2JjYMGW/i8A+ib3Jgs50\nzI2HTDbAlgN3eNNRqmHfm4qmRMjBykDSH0QMtqYCprlSlvkjJmovu1euPHM7\nVO8K7/gWaINHFWI3hL382R+OCj0WNlBXIIOGGQhuo107qPX6BOwvHV7F7jpI\nP270xvdvQWWmJPSOdpbgqtHFXTef+nTdaeBWlIyZJt+RmKZOhArGRJRjemze\nnux0kvKx2CwxzxIFIWEcNrql6n5sAcqv1N1aUvEDgKRR5431JM8pOOzFwmTY\n2Z4GwExgQTyK7X8Fhwth3PC8UFsHoPzFKBXmvJFJ2jAwhQrtHT+B9feDyD2a\nxIRE3ulQSBLLKM6IDIVTAgILmXzRVIPPn8iBvBtPOFkFSnduMvHj3D5uxnHN\nOa84\r\n=BTdq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA2qojmZTt+i0eOviMFFwhLlPH0IVOOOvfwpXamq5k8OAiEAjCG84ywCCQIuD50pP8CqQBB1wW8tg1VJGeNqMwl/iMI="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.2be191ed.0_1614808295449_0.3898429801597234"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.6dc7b06f.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.6dc7b06f.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=11.0.0-canary.c7d98fcde.0","@material/line-ripple":"=11.0.0-canary.c7d98fcde.0","@material/mwc-base":"0.21.0-canary.6dc7b06f.0","@material/mwc-floating-label":"0.21.0-canary.6dc7b06f.0","@material/mwc-line-ripple":"0.21.0-canary.6dc7b06f.0","@material/mwc-notched-outline":"0.21.0-canary.6dc7b06f.0","@material/textfield":"=11.0.0-canary.c7d98fcde.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.6dc7b06f.0","@material/notched-outline":"=11.0.0-canary.c7d98fcde.0","@material/ripple":"=11.0.0-canary.c7d98fcde.0","@material/shape":"=11.0.0-canary.c7d98fcde.0","@material/theme":"=11.0.0-canary.c7d98fcde.0"},"publishConfig":{"access":"public"},"gitHead":"9a8a072daac91e9fc841e2f6cacc0fb753ada76a","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9a8a072daac91e9fc841e2f6cacc0fb753ada76a/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9a8a072daac91e9fc841e2f6cacc0fb753ada76a/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9a8a072daac91e9fc841e2f6cacc0fb753ada76a/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9a8a072daac91e9fc841e2f6cacc0fb753ada76a/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9a8a072daac91e9fc841e2f6cacc0fb753ada76a/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9a8a072daac91e9fc841e2f6cacc0fb753ada76a/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9a8a072daac91e9fc841e2f6cacc0fb753ada76a/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9a8a072daac91e9fc841e2f6cacc0fb753ada76a/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.6dc7b06f.0","_nodeVersion":"10.24.0","_npmVersion":"lerna/3.22.1/node@v10.24.0+x64 (linux)","dist":{"integrity":"sha512-wkedamuku/gKhM62b5HulR7gx4JzLRUKA7OqSLBR5OWcKiZDGaPXCMexNPCMH9mn9Wl4Z1vuvNs6NbPIr8yaxw==","shasum":"4b58d95a89d335dd07f9f8fcd8d7acc9575f9ff1","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.6dc7b06f.0.tgz","fileCount":13,"unpackedSize":204795,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgQXm0CRA9TVsSAnZWagAAhB8P/RWdQskP+15InuBMtCp8\nHHSZA+Oa+OCdN7usgo+wEZEwY5YnS8OhIWab2mcflGsHMhy8WxA8Zo1NJh8b\nF4AF0Eo/RGNTpUTVOVCdUCxU/2Th33AFTg+k6kKabs+jF31siEKvyjE3Tfdb\nKSAuYvJWrxnAxHt8ru4Ub/aOVrnls+aj1plP4YKNIyM3jNWoRLjeNqU9MbNP\nmJqzWmh51N7ew2bxXd/4NpHtEDNe+lHuBP92Kh75pAJ6fLRs+P7JIuGmEgVb\nCSBcP2F38sFiOVVuzgqdBY/CXyxuO66eE1vki06AZ8ocNv1k1RoiOlFNUXdJ\nf0YbkeDn8BRzV648xTeBZOP0dSYHgE4cju1YshyC78G/H4NE+E9NHzUlwGaJ\nBeEg13WRdAbR4sD4dTFiwPMxhcr88/QmflKLu93iwRYHR4rhkRTFfOc1xfRK\nXRvpQPlCXeMOyrV5LSNox8SYnZzZHStu1M/LY/o84lRIqe+zUkPOdlG3THZb\noQXp8xt9GwEbGW99IrXsQ2Fg62H1oCi4zoUJBEqM6Nmx95/yqNKj52nOy4Uv\nG8u5s4d67IYQ3Xsmm0NoYqXAYod/r6H5tA2oAYkoIVArzTkKtdqlmpcylzfz\nBNLazb/RovQ3VOmP8pV0JWRd3tcjC805cMUKGGrGldzKn5QBu+OUJ09/V3H5\n+Xag\r\n=gWSo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDp+r04vD0fEyGT++lFFqiqGg8Aqp5kU3AG8HLpmBltBgIhAPQYIx6Pqorg3daMIvcMzER7N4JSDJYpBcD664WdrG2q"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.6dc7b06f.0_1614903732067_0.452484518760085"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.24fe7ba6.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.24fe7ba6.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=11.0.0-canary.c7d98fcde.0","@material/line-ripple":"=11.0.0-canary.c7d98fcde.0","@material/mwc-base":"0.21.0-canary.24fe7ba6.0","@material/mwc-floating-label":"0.21.0-canary.24fe7ba6.0","@material/mwc-line-ripple":"0.21.0-canary.24fe7ba6.0","@material/mwc-notched-outline":"0.21.0-canary.24fe7ba6.0","@material/textfield":"=11.0.0-canary.c7d98fcde.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.24fe7ba6.0","@material/notched-outline":"=11.0.0-canary.c7d98fcde.0","@material/ripple":"=11.0.0-canary.c7d98fcde.0","@material/shape":"=11.0.0-canary.c7d98fcde.0","@material/theme":"=11.0.0-canary.c7d98fcde.0"},"publishConfig":{"access":"public"},"gitHead":"d87a6c320af38bd078f91bc9ea457c0e21cea9cd","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d87a6c320af38bd078f91bc9ea457c0e21cea9cd/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d87a6c320af38bd078f91bc9ea457c0e21cea9cd/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d87a6c320af38bd078f91bc9ea457c0e21cea9cd/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d87a6c320af38bd078f91bc9ea457c0e21cea9cd/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d87a6c320af38bd078f91bc9ea457c0e21cea9cd/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d87a6c320af38bd078f91bc9ea457c0e21cea9cd/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d87a6c320af38bd078f91bc9ea457c0e21cea9cd/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d87a6c320af38bd078f91bc9ea457c0e21cea9cd/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.24fe7ba6.0","_nodeVersion":"10.24.0","_npmVersion":"lerna/3.22.1/node@v10.24.0+x64 (linux)","dist":{"integrity":"sha512-K98FYFjTm6f8BxRqb/T+mQCIMkO2PlPz0I791ZIRBpJVq6zKBF32eZIG9Lr7Ae4SBXpUk6InQBdfyI8S2QLnmA==","shasum":"1c4b025710c52b6137ffd2510cfff51a05f2ed55","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.24fe7ba6.0.tgz","fileCount":13,"unpackedSize":204795,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgQmnqCRA9TVsSAnZWagAAdlcQAITZ/ttcwyFpwMfsVwtZ\nBHaKzCFp6b8ZLOTaG600uf/bSX9v/lEZxItWD8v13TaYqIUPKMQahz1cR9ID\nygWdDdHFh71Tgcda3Cb70dJHv6fmF2+X20plO2xijyzJqm5CelwmpLCDqCpj\nd+72+RXGh6RwmToccGkqJAG381UscVhmAbLHtdf28G8zimmLOBIWok2MuW87\nqEfPsK1nX3zw9UOLuPKLqJgHXEaJ/cKzvnUxn+Mla6lMVSYRuNHdl5V1bYKM\n4oNMbnj5wRIvbJvIAAreIldCQaRge7XTZuPgrtJWQk2V/90Nx3kNL3O7kt+W\nfshaSJc33fsrWMMDx7ONBOxOuet84upCKzyR9KIC/7GxiFWlBzJ2lLBA7f7y\nMhnm+0WxQ5z5byZfODwMphGbe0Wn6yPGf89Rp8ZiqDm4T30HO5hk7PrJLIOg\noSpV46o1gLSJwny91/1BMQpc13h/e9ToVEBz/JXPNVhR/TYK/C3aQoaMUrOD\nGP4u9vWt+38Zv9eEU0jc91s6c3oVHdv8mFsSlJ6+1uxwBCrymJc/Qg68pWWO\nF4Gs24RUtniIaPctVu8OXZtjAQ0jXsKW0ixWcl+wkrLnn3T1+hBSFVUvpCIX\n24CJ5ETEGBjRj4GaEj50z8TlfDbRUve4LmkG7Ce9DTDFW1TY9UX/VjexhDTL\nvhyO\r\n=H7SF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHLgPTsp1I3MN/eZpggVNfoaHO4D1HbveYnsSB2wJEekAiEAllUxXE+x/pE8r0YqjRW1uWPR77I4V6RolyDxxzRQOnE="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.24fe7ba6.0_1614965225838_0.2952352017221729"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.12c477d1.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.12c477d1.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=11.0.0-canary.c7d98fcde.0","@material/line-ripple":"=11.0.0-canary.c7d98fcde.0","@material/mwc-base":"0.21.0-canary.12c477d1.0","@material/mwc-floating-label":"0.21.0-canary.12c477d1.0","@material/mwc-line-ripple":"0.21.0-canary.12c477d1.0","@material/mwc-notched-outline":"0.21.0-canary.12c477d1.0","@material/textfield":"=11.0.0-canary.c7d98fcde.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.12c477d1.0","@material/notched-outline":"=11.0.0-canary.c7d98fcde.0","@material/ripple":"=11.0.0-canary.c7d98fcde.0","@material/shape":"=11.0.0-canary.c7d98fcde.0","@material/theme":"=11.0.0-canary.c7d98fcde.0"},"publishConfig":{"access":"public"},"gitHead":"ea7731f325b77f7ec93ac77e442625ecf14e7f25","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ea7731f325b77f7ec93ac77e442625ecf14e7f25/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ea7731f325b77f7ec93ac77e442625ecf14e7f25/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ea7731f325b77f7ec93ac77e442625ecf14e7f25/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ea7731f325b77f7ec93ac77e442625ecf14e7f25/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ea7731f325b77f7ec93ac77e442625ecf14e7f25/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ea7731f325b77f7ec93ac77e442625ecf14e7f25/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ea7731f325b77f7ec93ac77e442625ecf14e7f25/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ea7731f325b77f7ec93ac77e442625ecf14e7f25/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.12c477d1.0","_nodeVersion":"10.24.0","_npmVersion":"lerna/3.22.1/node@v10.24.0+x64 (linux)","dist":{"integrity":"sha512-1bj3hW6sE790wJCUUOWDcOEDBFaqSjiq6wKAtD2WPySOMCGwLebN18NID1mONjKFLF7AXheBrfZhc7qrs+pkug==","shasum":"c68de39add1c12cf59c32b14669afa16abcf337a","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.12c477d1.0.tgz","fileCount":13,"unpackedSize":204795,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgRqPjCRA9TVsSAnZWagAAqbgP/0mbaQ88NkXCz33R7aka\nFfACjvSrC05jx6lVgfoMQLDWjmR6eY7wftCiwaLOfw6ft1q0wE7PYPUc4R9u\noP33LQ375K7IEz/g2ZsZMBxYabkHm2bXS2+0GEvjdLbS8bKbFIDugJp8E6eq\npRbl+nEyfr1XMR8oF+FQi2pYWXy9rFWjRHk1cn+WLnhzzcMs/5a50A6sNwQY\nBPNck7jY7VKl7lea9xQu2+0aJM8Wd6RjUdcnhcGuk0c42BVf56HkR6ivcGca\ng1/vhNdsWfoOyv49Ar3YscOa/g+erOmfWVP6DkU/Tvja4oMtIdTRGj10cayW\nx9Rq7jTe5x8aBn05KEscXz4Zw53IvApoAoh1S/qiLYU0OBlAO40e72Sb6Kzv\nwvc/q/ju7nY0reJ9jm9R4CnQGjBFf3XN9+AONLk4/YQfXUM3CuLJPnY6b7wl\nf7FANcVMHWR2ALfOEc7PyT4kudg6aEDsBMTwGhDEnXpPRfjeHed2EXkHLMMu\nt858mt+kFzdYUe9ewtOGCFoOyH4pltpgpuamNCg8zlDKfzMlxzj2XNf3MVGh\nJeexupNlueDsuXgbZiVP7vvXfpWDH3yIkDMxcViWgWJ+rNm9Eu/drnfjUxcc\nPakkFVJJkzGb6whWQiAR3atjTdplOPx2k7yOpINq9OTBN+FqrbWKXNIYVERN\n443T\r\n=RyUj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEYjrT5+ncNljiEK+N52YMJblelaE1VUWHen2phNWRbtAiEA8ueoG6sSj/Yry0lJ88jjuUhbH5m1jO79KL1bv10MVmc="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.12c477d1.0_1615242211036_0.7788913367768291"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.4c38f801.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.4c38f801.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=11.0.0-canary.c7d98fcde.0","@material/line-ripple":"=11.0.0-canary.c7d98fcde.0","@material/mwc-base":"0.21.0-canary.4c38f801.0","@material/mwc-floating-label":"0.21.0-canary.4c38f801.0","@material/mwc-line-ripple":"0.21.0-canary.4c38f801.0","@material/mwc-notched-outline":"0.21.0-canary.4c38f801.0","@material/textfield":"=11.0.0-canary.c7d98fcde.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.4c38f801.0","@material/notched-outline":"=11.0.0-canary.c7d98fcde.0","@material/ripple":"=11.0.0-canary.c7d98fcde.0","@material/shape":"=11.0.0-canary.c7d98fcde.0","@material/theme":"=11.0.0-canary.c7d98fcde.0"},"publishConfig":{"access":"public"},"gitHead":"2f19e904d6306b3a12d41b0158ca0c3fc34362db","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2f19e904d6306b3a12d41b0158ca0c3fc34362db/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2f19e904d6306b3a12d41b0158ca0c3fc34362db/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2f19e904d6306b3a12d41b0158ca0c3fc34362db/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2f19e904d6306b3a12d41b0158ca0c3fc34362db/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2f19e904d6306b3a12d41b0158ca0c3fc34362db/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2f19e904d6306b3a12d41b0158ca0c3fc34362db/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2f19e904d6306b3a12d41b0158ca0c3fc34362db/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2f19e904d6306b3a12d41b0158ca0c3fc34362db/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.4c38f801.0","_nodeVersion":"10.24.0","_npmVersion":"lerna/3.22.1/node@v10.24.0+x64 (linux)","dist":{"integrity":"sha512-uBCWQmmElqIJF4rs9T1DmBqVXEmcDice3B9n/4s0EJ0AVJdMjtWXBCZdsqCLCLtGmZHJx0f7bLPeoXoVYSQ1og==","shasum":"0246fc0631651159c2daa2972cb5649c0e058a64","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.4c38f801.0.tgz","fileCount":13,"unpackedSize":204795,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgRrIzCRA9TVsSAnZWagAAUh4P/jBc1Hd/iJ7OIztqDcar\nVG2e0y1T5x7a8mxAOqL69BuPG44SCicM1aP/cBhVL4w0zFyniRP/jdRf8xMj\nmWd0SONrBPU+Dkewbhk8vSUJb+SEpIzpelWtXO5DHWWVO85zT1PyhYsuJATP\nUAIP5ReB9Xw/oKXf2XeAGV5if6KKCT2kJrxeATApOWCeSppcvgi/XM59Kapb\nN+mYCQG5eTrAbJwJRUo2F6RNCpccwgFufqj+AKt69NePUwrM4v6tOIm1nJce\n6X/ny8IUMU5SBOAw/15CBf9fqsYysrqXnPB/dNzxUPg7PsFynRb2V9FVz2V5\n7Cl9M3ExrU3N6/NHRaFqw8WVA5oRgoil+wYRE1h/ew2rCPQi+GYtj8GHohNl\nusTJO7xrzcOp1tgzi0s4O6d/CEU6sKorc3WOfL4qjHOPu1CaiON0ucUTTsiZ\nYzdmAKb2Orzy+fTEU9GEQolsfci5y5U49QdGNOuyFxjIt+MvflQW8Dx0WGoU\n1F98+6waiRnQ671rWLS+JVNhdWlzPRo3kSoN+nc2t0Nt0ZaPbCTEEb7vzF6J\nkwaOin4st0zBCfygUKCeh/Sm5VOEflCQ69jfzeuwHqeqqN0U+tg+j5jiDzEX\n5K14sk6ZnwdLE1wT9+RpEPmKgHxIFeqxY3i4MZQu3sYsZUWCvKFNwleZYpgH\nPraP\r\n=RipP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCdWTBwWjaSCNyHKxdct4+PZ7milmLRbfcfvoh1TWLk3gIgKGubt1v3Gwc5GReSGfPAiM5d9WoZ6RKERbuOGlSSM5E="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.4c38f801.0_1615245874941_0.2987761696931692"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.8795b83f.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.8795b83f.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=11.0.0-canary.c7d98fcde.0","@material/line-ripple":"=11.0.0-canary.c7d98fcde.0","@material/mwc-base":"0.21.0-canary.8795b83f.0","@material/mwc-floating-label":"0.21.0-canary.8795b83f.0","@material/mwc-line-ripple":"0.21.0-canary.8795b83f.0","@material/mwc-notched-outline":"0.21.0-canary.8795b83f.0","@material/textfield":"=11.0.0-canary.c7d98fcde.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.8795b83f.0","@material/notched-outline":"=11.0.0-canary.c7d98fcde.0","@material/ripple":"=11.0.0-canary.c7d98fcde.0","@material/shape":"=11.0.0-canary.c7d98fcde.0","@material/theme":"=11.0.0-canary.c7d98fcde.0"},"publishConfig":{"access":"public"},"gitHead":"e3e75af3d23a6f47c66e86d2168ac672364726c5","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e3e75af3d23a6f47c66e86d2168ac672364726c5/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e3e75af3d23a6f47c66e86d2168ac672364726c5/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e3e75af3d23a6f47c66e86d2168ac672364726c5/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e3e75af3d23a6f47c66e86d2168ac672364726c5/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e3e75af3d23a6f47c66e86d2168ac672364726c5/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e3e75af3d23a6f47c66e86d2168ac672364726c5/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e3e75af3d23a6f47c66e86d2168ac672364726c5/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e3e75af3d23a6f47c66e86d2168ac672364726c5/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.8795b83f.0","_nodeVersion":"10.24.0","_npmVersion":"lerna/3.22.1/node@v10.24.0+x64 (linux)","dist":{"integrity":"sha512-1CbiUAAKv4cWuCsccWRNwBUjWPb/XK5RiLZpLFDFSfQd7S2ynRNtv8oJoqvzGUUssQwL3rgF7WQsCyYzsCbbpg==","shasum":"fedac0d6a31763891892b3381517dc35d5809f5d","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.8795b83f.0.tgz","fileCount":13,"unpackedSize":204795,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgR74QCRA9TVsSAnZWagAALzcP/R2zzvisjWaKUqsXbYBA\nvoB8SZZ1GvFXPO4UAPWAe1DpVWQWeB/nYvn+T7UCPMfxkr3QYL2bljIbfAXe\n7ld45+KljUtJ69vS8iJstrh/o0tWtdjm4S5qQ+HT0CxzniWBoKzZxnwE3lhJ\nMM4j8FIpn+k1KgE8nR1IKAGCpr1lC7av7ESdWX0LE7KkklWnoueNsSXQZhI+\nVzwbJ0SZ3Kc0QtmZcWjfWeA2EkXou/UY2eRVa/3sa1EZQzP2BngLr5hHMv6X\nGBj+YQ847yVydfRk2umZVNrqk2//ODXY9a+n0r01OhctwsOD6tIPWAXL89/v\nxhKF8Q2/gywTLLOPx0oUrxihwOT9FVIV4H7eQvLhgYRhs96JSKbj3LWn8ld+\nbaiwC5estsn9I8BlGb8MFW7oWIehvxicPgS8jHy9d6VGQAKqEDRIAs1EWI1J\n270rruU1xExHeMCfBXTB0ubkIj2FKmalsirj7uYwSvnyVBoWs8y8csun1Eyb\nycWJMeSPA/pHAn8TSXd61Tkg+V9j+jBTrsLRka08II0DY7jABNCEnk+PxGug\nB3BkCtqj5i5nQ3WVqHbGPAR3CkClABxd6QUa9Ef0rxMS33cQg12fDcP488Js\nGUgjQ3bMKngLNG8+jnH5ozi4dAL1CusUZX9qphQw7fYm0/EJ3w3akwBfVYjC\n2Da1\r\n=58bS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCXo/8Dr7uVSJU2ZZ528TC8F8tQLe5aJAxBMWAYmVtR5gIgWejU6FT9BDJrhSs8kY2stgUYVO254ie891/b6kGcrwQ="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.8795b83f.0_1615314447674_0.24621389934025606"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.12b84cb7.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.12b84cb7.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=11.0.0-canary.7522dcaca.0","@material/line-ripple":"=11.0.0-canary.7522dcaca.0","@material/mwc-base":"0.21.0-canary.12b84cb7.0","@material/mwc-floating-label":"0.21.0-canary.12b84cb7.0","@material/mwc-line-ripple":"0.21.0-canary.12b84cb7.0","@material/mwc-notched-outline":"0.21.0-canary.12b84cb7.0","@material/textfield":"=11.0.0-canary.7522dcaca.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.12b84cb7.0","@material/notched-outline":"=11.0.0-canary.7522dcaca.0","@material/ripple":"=11.0.0-canary.7522dcaca.0","@material/shape":"=11.0.0-canary.7522dcaca.0","@material/theme":"=11.0.0-canary.7522dcaca.0"},"publishConfig":{"access":"public"},"gitHead":"1f49d8bf5098f7acbc51aaf3dbc6880cbd46a2e8","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1f49d8bf5098f7acbc51aaf3dbc6880cbd46a2e8/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1f49d8bf5098f7acbc51aaf3dbc6880cbd46a2e8/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1f49d8bf5098f7acbc51aaf3dbc6880cbd46a2e8/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1f49d8bf5098f7acbc51aaf3dbc6880cbd46a2e8/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1f49d8bf5098f7acbc51aaf3dbc6880cbd46a2e8/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1f49d8bf5098f7acbc51aaf3dbc6880cbd46a2e8/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1f49d8bf5098f7acbc51aaf3dbc6880cbd46a2e8/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1f49d8bf5098f7acbc51aaf3dbc6880cbd46a2e8/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.12b84cb7.0","_nodeVersion":"10.24.0","_npmVersion":"lerna/3.22.1/node@v10.24.0+x64 (linux)","dist":{"integrity":"sha512-ZndT8cEQGSTieseK3pWpmHdulorZo2bEIsphz46nO53JeMT2IvnYuDsHpsvGu4oOxKpzxJOq/D3YfUlt6/lMBg==","shasum":"11c76f13c3b6b61c55148c93a3944fd75bf60bde","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.12b84cb7.0.tgz","fileCount":13,"unpackedSize":204795,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSBWmCRA9TVsSAnZWagAA9oQQAIVW1ceajew5Hu0uWSJS\nvxGJvuV9u44KBKA6hzdrtabfP8izo+QEgefFFxHAOFwB5O+IZN9giNmQq+wo\nVnvibDewQhJay9DYuyi/5h9yQkPgdv65KT2y2KHTvoIYADTpfze6rf4FiPd0\nMSkhCSfMFLF0MebYs+Lt1iopvT5op+CFcaekBaSbKdps/X4CymbreLW8VJU8\nMrV4SKPEg0PriZ2NcyKZjD1T+/d1sLwjT4IhJkftSFuprnChHO80PkrPuJ9n\ntoNNqefcME9j/t0yDzvz/QzC/povFZFXjaAPecY14hnM5+/paH3eo5r26aIq\nWcmSoDEo87ScctXsTB9Ar0zOaxpt31tC4z24jMS4qlSMJqhYkdfP+4wHHrtc\nTbbgYYuGshVLN7ibia1a0rPkdcZ4TFyoSnRWmQl+YfoqP0etGG6cjS0yiWTU\ns05u4xBvK+pvNE8pcsHRpTfXuRZsAQa/kuQktnN5kTMDeDvYjC80Pw3whwQl\npX/CPJ/1PkRKT2TfdLd37MbhpTJ90+DfO4O4mKrjXjRtfreuHhzMfYAxYx9v\nSz1PflsG9VQnYU0v6mAJYWj3gLYXla0zpzByEuroNf2REHCJJ8whfeHlkAqf\n2q1aepwcyXOAR4nvMbeNeV8V2L5ho3+o/wzfUJMxkt1j21CPSoG2Xu8piEg7\niJew\r\n=62Nl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQChvrcZzug8feZQV3+o9JOFzbxqGvLvO+sO25n02EstgwIhAJqnL9zG14L1DqxL41zHpw9BdQSG8Rwc03LnkOQDG5eY"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.12b84cb7.0_1615336869900_0.7323175437940455"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.6ac6784b.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.6ac6784b.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=11.0.0-canary.7522dcaca.0","@material/line-ripple":"=11.0.0-canary.7522dcaca.0","@material/mwc-base":"0.21.0-canary.6ac6784b.0","@material/mwc-floating-label":"0.21.0-canary.6ac6784b.0","@material/mwc-line-ripple":"0.21.0-canary.6ac6784b.0","@material/mwc-notched-outline":"0.21.0-canary.6ac6784b.0","@material/textfield":"=11.0.0-canary.7522dcaca.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.6ac6784b.0","@material/notched-outline":"=11.0.0-canary.7522dcaca.0","@material/ripple":"=11.0.0-canary.7522dcaca.0","@material/shape":"=11.0.0-canary.7522dcaca.0","@material/theme":"=11.0.0-canary.7522dcaca.0"},"publishConfig":{"access":"public"},"gitHead":"c60d8f8df8e8260f94f9e15fccf93afc356b0634","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c60d8f8df8e8260f94f9e15fccf93afc356b0634/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c60d8f8df8e8260f94f9e15fccf93afc356b0634/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c60d8f8df8e8260f94f9e15fccf93afc356b0634/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c60d8f8df8e8260f94f9e15fccf93afc356b0634/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c60d8f8df8e8260f94f9e15fccf93afc356b0634/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c60d8f8df8e8260f94f9e15fccf93afc356b0634/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c60d8f8df8e8260f94f9e15fccf93afc356b0634/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c60d8f8df8e8260f94f9e15fccf93afc356b0634/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.6ac6784b.0","_nodeVersion":"10.24.0","_npmVersion":"lerna/3.22.1/node@v10.24.0+x64 (linux)","dist":{"integrity":"sha512-NCI0gi19wBxZumNRxeuF2mpfl1HchOwsmeb4TIiNXGSFTZ3AtnHg1HnbuhEBjQRMLx1FM2KXCRfboAkCsh3xWg==","shasum":"ac59cf9e726248f6d649dbe899631351de361b2f","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.6ac6784b.0.tgz","fileCount":13,"unpackedSize":204795,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSBgICRA9TVsSAnZWagAAuRAP+wdtUn9dq+t+mjB34sr5\nOg7ziCtplZlUs5Ogu3Ah7ofSAaKCvEtB2prbpJD36M9N0VxiU+9MosLRIDy8\n08PtEd+wMXir7DZAS4+1ZzD+ZMm0gb56i1iVF2r1SaHJFWOvrX5KjE5GITry\nkDM0DlAa3wT8qGgcQoEm+mdl/KXGx1dYWhro9MafGcbys3Ojq8Yu0eQc6Dht\nlnhbCmXy95pd2/zS2sBjy+hbChYva8qyFwayM6flRX8++9fCm5j4/11k0Qa/\nsj1x//GtVccdecWCoXovONFunvANvxZHaV2iZJp/GzHcRWyueyZCl4uWZ8Wr\nCQFPQ7VxcbXSM+86Kp5428mgsWFmfvI12/mmQNylUeZtvLjFaNHZHLcmdkgn\nQCMlssjJo+JB2ydTPgHLbQ9OJFDXN/PRV4Ckuol5JlKmwdOLoG3XXl7PLZJh\nOFXqANlC0TU7e1ybFx7cLxcjkRMctQAYLjoi1R7207XEQtatLJcY7YsX1JmT\nCWE8Cr8ba+T6aeeIP8HWKaVLR/TjdHtLyDeazvm/3e2OD3oHNvZ+NsngX/YQ\nLNS1tR8WI/nSLRJG97H4hP/2G/1LwcjJcEBaHijWZ2Iz3ZF4Ox5vP+PheEIu\nXyIap2NAB+W9s3Ck/lbf5IBvCnCeiv0+TpP7+aGg73qROr1hORRB8UcsP3sk\npBv1\r\n=/qFB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEP9diAQd14HXUweMhaHttvmhP6bEV0VQYHUwuGa7uXyAiEAka0sPWb51X9dZJx58P5y/pWoXCHZmea42k1EJPJ9gA8="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.6ac6784b.0_1615337480416_0.9227985564727768"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.b6d92934.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.b6d92934.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=11.0.0-canary.59010b6dc.0","@material/line-ripple":"=11.0.0-canary.59010b6dc.0","@material/mwc-base":"0.21.0-canary.b6d92934.0","@material/mwc-floating-label":"0.21.0-canary.b6d92934.0","@material/mwc-line-ripple":"0.21.0-canary.b6d92934.0","@material/mwc-notched-outline":"0.21.0-canary.b6d92934.0","@material/textfield":"=11.0.0-canary.59010b6dc.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.b6d92934.0","@material/notched-outline":"=11.0.0-canary.59010b6dc.0","@material/ripple":"=11.0.0-canary.59010b6dc.0","@material/shape":"=11.0.0-canary.59010b6dc.0","@material/theme":"=11.0.0-canary.59010b6dc.0"},"publishConfig":{"access":"public"},"gitHead":"82c48b7f335ed9103a3bbcd062d3163b1eb661a1","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/82c48b7f335ed9103a3bbcd062d3163b1eb661a1/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/82c48b7f335ed9103a3bbcd062d3163b1eb661a1/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/82c48b7f335ed9103a3bbcd062d3163b1eb661a1/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/82c48b7f335ed9103a3bbcd062d3163b1eb661a1/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/82c48b7f335ed9103a3bbcd062d3163b1eb661a1/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/82c48b7f335ed9103a3bbcd062d3163b1eb661a1/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/82c48b7f335ed9103a3bbcd062d3163b1eb661a1/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/82c48b7f335ed9103a3bbcd062d3163b1eb661a1/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.b6d92934.0","_nodeVersion":"10.24.0","_npmVersion":"lerna/3.22.1/node@v10.24.0+x64 (linux)","dist":{"integrity":"sha512-amMjHN+KF1eepvV4IYvfR9YzdqVsxIUXPkxLF7y2A+MM9us7cwxl8Wkk+sq5UFKkLkxDBvCk1qO5B7o4KV4gXA==","shasum":"6338e6edc5ec478070fd9dbe81a74e0271185efa","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.b6d92934.0.tgz","fileCount":13,"unpackedSize":204795,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSUGXCRA9TVsSAnZWagAAS8cP/0ugv410gxj81mkpM6ZQ\n0bEk6PESZA9/lKwAuS3jFeGDUQAhG69JgLE4ttumJ9dneEf4riJMJBjJaHky\nJqmT+SNcDYb/eF3qzv+wqr7e0ZB/xoJODlqbfvgykw1h99FHzUM7mtruA4Pt\njC8ehixQ+lT5c1FsybcJD8aFb7hw3SxXnBatV0+z0fjUA74PLROGQJ8OpL2D\nKXKGoNZmtQXcLfgalhg+q1IRpvBqqOQbSLToRy++DuVyHuOOyEn1D+lGJBHv\nDlTyNBlXA4ticbOzKSHSadi/9FefM61IwQBQy6edpd0Yzw9MSecS4A/0300Q\nRrjd8/G5UOsPtR6RkFs5VVvdeoCP/XaHx71+doj8w6oSVitdAyJn30rmHVoR\n/RHaPBPplujV1BCR6HkpWfi8vjDPFJHQdDgfpMLITn8NldH49DyNdSGI13ZA\nW8FpqyU0cyqUzBt9dwdq1QI8P9JsdcAkO1PTNcEOxE76Ui3vpG6xCV9XQn1c\naImAO5BLknpw3+6VjcX/gNTnB73CpjgdZ3xe6Yp4XqxMWmg5HWpnQcORlFv7\nzpbYyD01QOswc5VgIAZFlzf1GkBhlp1AtZdQ8Eq8QpW9b/njVOoh97udnvxQ\nUFQk/pOuWELmI3X4yslHh81w6ICIxL8VBOjNOkBjlMT9AjIIShkV3mMeWKQo\nibTw\r\n=8VFQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBNS1XmIYDO37kmp8hHn/EPqRSMJyvFoEUYZNGFx1M+DAiBNmJC7sFCk0WaOL22G+2fyrQtxiZq3goe8Rg8/AL3hlA=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.b6d92934.0_1615413655076_0.3114303223917889"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.99a55b9e.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.99a55b9e.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=11.0.0-canary.59010b6dc.0","@material/line-ripple":"=11.0.0-canary.59010b6dc.0","@material/mwc-base":"0.21.0-canary.99a55b9e.0","@material/mwc-floating-label":"0.21.0-canary.99a55b9e.0","@material/mwc-line-ripple":"0.21.0-canary.99a55b9e.0","@material/mwc-notched-outline":"0.21.0-canary.99a55b9e.0","@material/textfield":"=11.0.0-canary.59010b6dc.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.99a55b9e.0","@material/notched-outline":"=11.0.0-canary.59010b6dc.0","@material/ripple":"=11.0.0-canary.59010b6dc.0","@material/shape":"=11.0.0-canary.59010b6dc.0","@material/theme":"=11.0.0-canary.59010b6dc.0"},"publishConfig":{"access":"public"},"gitHead":"8b0d740e8ff12f180cf11caa9a264f3dda6542f7","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8b0d740e8ff12f180cf11caa9a264f3dda6542f7/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8b0d740e8ff12f180cf11caa9a264f3dda6542f7/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8b0d740e8ff12f180cf11caa9a264f3dda6542f7/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8b0d740e8ff12f180cf11caa9a264f3dda6542f7/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8b0d740e8ff12f180cf11caa9a264f3dda6542f7/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8b0d740e8ff12f180cf11caa9a264f3dda6542f7/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8b0d740e8ff12f180cf11caa9a264f3dda6542f7/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8b0d740e8ff12f180cf11caa9a264f3dda6542f7/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.99a55b9e.0","_nodeVersion":"10.24.0","_npmVersion":"lerna/3.22.1/node@v10.24.0+x64 (linux)","dist":{"integrity":"sha512-jLf2U+RWQYdROBqlxvKBhFAoexZke9OQ6qVv54T6r1FaSuZnJvb0i1fYR9DhrAOGbHOTe/5sDf+NcNVyMku5rw==","shasum":"f905d70a6c4d8da27c09c77f107dde052b5f3bc9","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.99a55b9e.0.tgz","fileCount":13,"unpackedSize":204795,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSU1+CRA9TVsSAnZWagAArCsQAJbiy9Vvu287CQhoDeH2\njYuX25/ItsAreWoNKFMZqIFKVZs8wEHOFVsON2Z2hAFLMx2VMd5DuKKy2p2O\nQY0St2vG5xE8+nG2+3hu5w2yqBcsrIDXNORuIAJFc27qtbYRohXDqQsj7Ysh\ndQ2NhALZmG4b+jkHZ95C4M0oJK/+zZtP7YKGYOoJfntsZ+S9RE8DW9CPjO6K\nyJLHiY2Rl8OZh8PvpYH832gUke8ekD8s+S7RSQi27Oq1udBLBaCtmn2VaO9l\nxiMBDX6Bhqvy/utlbDra3C1SF4Y/8vt88hxHmisfP9OZzBYbtP1XVVLl661a\n8Y3yEBlt7HwRdOdmnfpMzv0tNac2Ye+mu0jqAWnmwhtC+XJNInMTHnwaYcGL\nIlA9AwHCoIaAhkWNFfKFKBO+D72AG0aIB+wOCIhGWNDJQJZlvCqv79/vgwVL\namljXjcQzPnBPkV1FeXcHoT4Eza8gIbmpgSe2lRNUpWhPvN5oUPx7yFETWiJ\nt73ESqzi7IamW4WZQ5Nd5e9mPCNGtH82ye1POrwtf690vF+WebWNoJ+D6Cai\n4DXO44hKpAEMaMSRi1ZWf0fdBbC7ELK+MoqIzFGSCEn6hkT1EQJLSvwazgdY\nuJFmAYNDfMCFe0zLOZKK3xWbCE57KeVZo8F2t7HyVe18tR54DbgBjmvTnGP7\nLzlp\r\n=bv9I\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDkxBOPHvmUPK/yHHyoCf+GCdihYSB4qEGps7DXb79wrgIhAJVVYDxQL55onXMvK+4k1f8NYpgelH+LnLNdr7E6iKjg"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.99a55b9e.0_1615416701565_0.3366881028585462"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.bb14efb7.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.bb14efb7.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=11.0.0-canary.59010b6dc.0","@material/line-ripple":"=11.0.0-canary.59010b6dc.0","@material/mwc-base":"0.21.0-canary.bb14efb7.0","@material/mwc-floating-label":"0.21.0-canary.bb14efb7.0","@material/mwc-line-ripple":"0.21.0-canary.bb14efb7.0","@material/mwc-notched-outline":"0.21.0-canary.bb14efb7.0","@material/textfield":"=11.0.0-canary.59010b6dc.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.bb14efb7.0","@material/notched-outline":"=11.0.0-canary.59010b6dc.0","@material/ripple":"=11.0.0-canary.59010b6dc.0","@material/shape":"=11.0.0-canary.59010b6dc.0","@material/theme":"=11.0.0-canary.59010b6dc.0"},"publishConfig":{"access":"public"},"gitHead":"00644005f58173e15c7e271bc9c226535d1bbbc7","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/00644005f58173e15c7e271bc9c226535d1bbbc7/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/00644005f58173e15c7e271bc9c226535d1bbbc7/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/00644005f58173e15c7e271bc9c226535d1bbbc7/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/00644005f58173e15c7e271bc9c226535d1bbbc7/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/00644005f58173e15c7e271bc9c226535d1bbbc7/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/00644005f58173e15c7e271bc9c226535d1bbbc7/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/00644005f58173e15c7e271bc9c226535d1bbbc7/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/00644005f58173e15c7e271bc9c226535d1bbbc7/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.bb14efb7.0","_nodeVersion":"10.24.0","_npmVersion":"lerna/3.22.1/node@v10.24.0+x64 (linux)","dist":{"integrity":"sha512-oKHyFx855ztmdAFYr2uVlQL7yfX/FUGKrRwbcDxWymK1cd5jgm6NJ1gOWLg2owjQHjT6tlefFCCiHdCTSstopg==","shasum":"7b253eb6fb5878c70feadc650327780f22914c14","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.bb14efb7.0.tgz","fileCount":13,"unpackedSize":204795,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSVgqCRA9TVsSAnZWagAADfoP/1SSE2c9Ue6wff41csCY\n2FUoYC4uwMAmUDKa3eXFWoLdQkF9aPXLc9RoIDCy8D7882ILOo8BwYoxSf9+\nSVyenDfq5NuO3epocNpUyMxkCod3T63iimKFrtPHGlwlCj5ZqajaMyU3PD3g\nQo0SwuFf1mahmALXXH2N+JMd/1tCMaCSbUx+KY8m6r1jZQYgcryrCwFZJXR8\nFkJZIqu7vGQPoLbCDctZchdjz9wsoedB57EcVD9KyilHTsJWBWokFJpQe5nz\n5M5andmfBFCS/RKoqWJAM/ak9UbMciarRNzGSsykxWAhuZwFaY1D89NKW9AO\nU9EYxk0xhn7MPfZ9dKYl/Gh0X+Rcwnzdh4gOGQe4l2LjX0o4oUMj/gKvXDtq\n42vuuqvz8TlugTcgKpjV+tBmxnGiv6JI9DSU9Zd/3U0Ve1qwTRfSl3hqMeDG\nbCrAhin/pMEhdF39LMVnTeyNgoxAqAvRERXCWa2186pna+w+CKcKskWUpxLE\nviwztO3XTLqJikdxHWUxS4TWvN/ODtB5YjssLNBYuwlE0qxrPQMlRnP5TJY2\nc2P0ygp4hNqdTD5tlB+XHu7rWDle/CjROXvJl/fmlVf9xlVKBhN1lu1m9bsE\nMk2qmFRpnROfLh9W4ExFi3LNxzcy/Zj+xEcICAFh+LZabuEcDXJFp0XYFJWX\nGRUj\r\n=hK+D\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQChXJJ1HtQxArHpvu4jPgQv6WfvX8lUGSBiIviGaODY1AIhAPZlRnUbDmdzUdP4v96Eq8kRqDFMhSwabW2syCeEEr9l"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.bb14efb7.0_1615419434387_0.13363743289468988"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.9ecf3bdd.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.9ecf3bdd.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=11.0.0-canary.59010b6dc.0","@material/line-ripple":"=11.0.0-canary.59010b6dc.0","@material/mwc-base":"0.21.0-canary.9ecf3bdd.0","@material/mwc-floating-label":"0.21.0-canary.9ecf3bdd.0","@material/mwc-line-ripple":"0.21.0-canary.9ecf3bdd.0","@material/mwc-notched-outline":"0.21.0-canary.9ecf3bdd.0","@material/textfield":"=11.0.0-canary.59010b6dc.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.9ecf3bdd.0","@material/notched-outline":"=11.0.0-canary.59010b6dc.0","@material/ripple":"=11.0.0-canary.59010b6dc.0","@material/shape":"=11.0.0-canary.59010b6dc.0","@material/theme":"=11.0.0-canary.59010b6dc.0"},"publishConfig":{"access":"public"},"gitHead":"536269b5f421223a32dd73271ba878cee3e04ec0","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/536269b5f421223a32dd73271ba878cee3e04ec0/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/536269b5f421223a32dd73271ba878cee3e04ec0/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/536269b5f421223a32dd73271ba878cee3e04ec0/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/536269b5f421223a32dd73271ba878cee3e04ec0/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/536269b5f421223a32dd73271ba878cee3e04ec0/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/536269b5f421223a32dd73271ba878cee3e04ec0/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/536269b5f421223a32dd73271ba878cee3e04ec0/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/536269b5f421223a32dd73271ba878cee3e04ec0/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.9ecf3bdd.0","_nodeVersion":"10.24.0","_npmVersion":"lerna/3.22.1/node@v10.24.0+x64 (linux)","dist":{"integrity":"sha512-XvQVL1akIxUWEIxb/TuSynlXPt5GQrXwdAm9axIT8qpIrmGBzkSs2Kay4eGTL0Gf+Z+dk6zDIT9+ZIi0nhKEpg==","shasum":"03158afb6d74902f3b6dc0d37a3e8f38774b8283","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.9ecf3bdd.0.tgz","fileCount":13,"unpackedSize":204795,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSWL4CRA9TVsSAnZWagAAckQP/RgbMLIckDzmFEvJ/rNc\nPmZmSZrnkwh4eR2AJ8qt7NKBrqfUPqml6QPmLreUNA/EO8t6FLLCiCVJhDmF\nxa6SHbgTrF5vmS05vPRbuSBktj08p7eSSnuTIlz/CJK8bzMhXLDgmsQ6TzmB\nx1o6kZCinkVhpnYuUZWbEC+K8J0ssKMaGYpLA+c/40s+zp9v73WO9WOzoGr9\nU+uwsNTdahY8y1FiyPdjsKPQDqe7zVvy9LVLF/ZveXWdX+7r103NfjDyMkXG\n6EA3OHgjicTg7hg01nFpX7hy2oH4BlAiY+4a5UjzeSLS7AAx5wXTGfwBh3LF\nWObJN3SLt7baPQoBsw8TGFo1UdhUlHMYVTDmj/vmhe8JHFwadx7hNSg5wgwQ\n0zxRqDshkJHI0Nch3Ld0i7HqT2hfU5joKarfJpOkJ213+M1abW8XLF+CH74N\niKAA0MTG2OvBvVezC/kqhHlpoBJNYADEJMzBZpDK0r2g47xI8aoIk7mhn6jP\nEPv11k1fRGOx0aj2299Q854LKx+gtWsxNL6SpK4KWmjeBPpqxPHqsw2Wqu4w\n9v0H/03F9xGVW/YTuTDvmUMXC9RZFaybaZtFua5Im91qbzYxxWB9KSyrKsgy\n25owS+SOaHiNX+iA/n35DJsFw0sgqPHldSFWNUC42FcbO6pcMJ8PwCeIpPEz\nylXq\r\n=9Zmj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDj+3VsSbQG5awByUZodb91mOuP5BK3HblxuY9V+bilEAIgKbrlEJV9L4nzkel5rygSI9vXU9BKOezdm0PqRIK2ckk="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.9ecf3bdd.0_1615422199860_0.09816542130617689"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.7c0e02fd.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.7c0e02fd.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=11.0.0-canary.59010b6dc.0","@material/line-ripple":"=11.0.0-canary.59010b6dc.0","@material/mwc-base":"0.21.0-canary.7c0e02fd.0","@material/mwc-floating-label":"0.21.0-canary.7c0e02fd.0","@material/mwc-line-ripple":"0.21.0-canary.7c0e02fd.0","@material/mwc-notched-outline":"0.21.0-canary.7c0e02fd.0","@material/textfield":"=11.0.0-canary.59010b6dc.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.7c0e02fd.0","@material/notched-outline":"=11.0.0-canary.59010b6dc.0","@material/ripple":"=11.0.0-canary.59010b6dc.0","@material/shape":"=11.0.0-canary.59010b6dc.0","@material/theme":"=11.0.0-canary.59010b6dc.0"},"publishConfig":{"access":"public"},"gitHead":"96acba80bdfa05054613c4753b3c0211e2ac7a76","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/96acba80bdfa05054613c4753b3c0211e2ac7a76/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/96acba80bdfa05054613c4753b3c0211e2ac7a76/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/96acba80bdfa05054613c4753b3c0211e2ac7a76/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/96acba80bdfa05054613c4753b3c0211e2ac7a76/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/96acba80bdfa05054613c4753b3c0211e2ac7a76/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/96acba80bdfa05054613c4753b3c0211e2ac7a76/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/96acba80bdfa05054613c4753b3c0211e2ac7a76/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/96acba80bdfa05054613c4753b3c0211e2ac7a76/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.7c0e02fd.0","_nodeVersion":"10.24.0","_npmVersion":"lerna/3.22.1/node@v10.24.0+x64 (linux)","dist":{"integrity":"sha512-wiIuhWnFM+p9UP3N6AZMi4g4zjd07huBI8H+NIvH3IL69zBPW/aabtbga3TCftKdQGumcDLlAtINp1A1FBnNAw==","shasum":"e0208e5921e03874a7d49e6c58c66d57bfb703bc","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.7c0e02fd.0.tgz","fileCount":13,"unpackedSize":204795,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSXZ/CRA9TVsSAnZWagAABJoP/ii+FAQLSPIOWyC6oNwh\n1leNjVMOEfHYRWEsDOby44aGz5ialMtbvWfTw+Buhgt3InOJ4ZeQ4FQrrXP6\n9T2cdAej5zK9JWJLX6SoG96m3y2V/8j/o+ykPUPk5EM0UQiDQyUoR34XD5+4\nzsSdEMmyXjyUMnFv6femLbYFfLoxRlhLAQzk3mOaLbYWk+POaDgdTp6XfA5C\njjyE4vMAhyBeIRcEYluovgNo/cdcq4XtB/jLV5/9+Uz0J14ismA9lb/UFMrg\nsO3hXVbQyHJdV+9rTRNdgSLZyYQQs/P0MJYBFRPxZcNaK+47pNMBeqxzcKnZ\nnDeMMGkdcWa5Eoe5Sc/qHS7c2jEIsOuhLDSwIrWqXWP1pdelfg9XoQmzkTec\nKUyEnwi6BKmBXx5/w3D/SXvEPM0Kmpq6pe9oUAEvinfGp/45O4+VZjwupLyT\n7j+UgrGqjbW6Wc4SXZ3j1sqpmUl8CD5tt/FVuRc4JvhB4UzHxk0OZJPirDph\n/gkuBjjOrCyMXCpUd/rvSk/gw01cxYkdgUrmJPv9zkh2eMH2qBx2JQ2wnSbQ\nJ9xo76PDMEQsHGxvZDQnfkZ3u0XE/s1NiHppX8vPjyhbCrgbdOn4pHgXBUvH\n2waTNRy9WsWdFcA/0l6n8o37dykqBkH6TNJGkrpPHecGjAjE/vP2L8C7w+dh\no5q3\r\n=KE7i\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHGkag3TStmI+6K0pWx/8AybgDvZB91SIwR59Awqsa/CAiEAmID9qwwRqQtOyG9DLl9X3QqP4eFg4Z2JbAcdLahajvE="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.7c0e02fd.0_1615427199391_0.07027780626191871"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.2d6d59cc.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.2d6d59cc.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=11.0.0-canary.59010b6dc.0","@material/line-ripple":"=11.0.0-canary.59010b6dc.0","@material/mwc-base":"0.21.0-canary.2d6d59cc.0","@material/mwc-floating-label":"0.21.0-canary.2d6d59cc.0","@material/mwc-line-ripple":"0.21.0-canary.2d6d59cc.0","@material/mwc-notched-outline":"0.21.0-canary.2d6d59cc.0","@material/textfield":"=11.0.0-canary.59010b6dc.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.2d6d59cc.0","@material/notched-outline":"=11.0.0-canary.59010b6dc.0","@material/ripple":"=11.0.0-canary.59010b6dc.0","@material/shape":"=11.0.0-canary.59010b6dc.0","@material/theme":"=11.0.0-canary.59010b6dc.0"},"publishConfig":{"access":"public"},"gitHead":"52ad91ef80e9719962d213826d84928a37cf809b","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/52ad91ef80e9719962d213826d84928a37cf809b/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/52ad91ef80e9719962d213826d84928a37cf809b/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/52ad91ef80e9719962d213826d84928a37cf809b/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/52ad91ef80e9719962d213826d84928a37cf809b/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/52ad91ef80e9719962d213826d84928a37cf809b/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/52ad91ef80e9719962d213826d84928a37cf809b/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/52ad91ef80e9719962d213826d84928a37cf809b/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/52ad91ef80e9719962d213826d84928a37cf809b/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.2d6d59cc.0","_nodeVersion":"10.24.0","_npmVersion":"lerna/3.22.1/node@v10.24.0+x64 (linux)","dist":{"integrity":"sha512-+W1zgdJlnr1zNvk8f/VV5n4ADEJpYffzVWRrpb7UCnidabO+oLY/QCs3XmWLPKyQ4fXua8mous12l/h4dlvMvw==","shasum":"37f5d997fa25bc631e3641cf487ffbbde4dca34b","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.2d6d59cc.0.tgz","fileCount":13,"unpackedSize":204812,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSmGBCRA9TVsSAnZWagAArfoP/0qrhcVsMsegTiIHg32W\nw1Ei8caXNmdqW0Y0tngqX71r62N81pUcA+hbI2+eAnWSNLNd972GyR9sxomr\nzd0BiC3BmLRss8TEqoe1FsD1DtBPywVJGulWGurnCzilLgZ+Vq6QT5YXJNJw\nKYGLYRyPdR9f03uVEQePODnvaAb6xi8v4Ttti0Y1MaEvQ4/+P3lIiWbNjE3R\ntzHmS6bX6SXmn6Z2+b2R5JJsMV2Bhh2IKcxPoau3pVuB4+psGTZF7QKhw/Zn\nHU62KanmoIWijfm1klUCS6WUxiyXn+Zl+hosPeqZFRTFzMbmeK1RuEwmiqQh\nCooOGGXgZzM91P+XDa+qE0TumaGnulmVqn4A/zD4MMdeCAQSHwMTSQzew6Up\ngtXBDr2lM14ARUXRtUARnx4w4h0gqAQ/cn/cuL0vGoOap8PfWCjaamsWKjdu\nsM7eLvns/Roo724OpV7lyjx+xOwgMfXDOUUbWx3kVW5/qqkDqiJTkt6QVeb1\n3eF+KC2DPy6IyPhuXGf4kZx92dZwl0ZSOGb5ZZ9tfUn/6WsXQtS4dCXfjaTg\nKAwzpUI7NcgGW63dnPi29qaCEjIV+v6uhdz+hEs4tHPlpIUjrX/jRlQlU64z\nx/jMJp7pBlCrpjknsbNqrd9tJWUAgF6wSrtstt+F/kk2WsduzUiAOTGPiJLx\ntHkg\r\n=w8Si\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHIMIYw17o1MESZltQY4GIC2CRuruYRNvWuDbah7S7r2AiB5l/q82dM1FAeQCZHmXhSqckakkn7lt/kU6Q0GnJBTaw=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.2d6d59cc.0_1615487360646_0.9785067948023318"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.0138863c.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.0138863c.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=11.0.0-canary.59010b6dc.0","@material/line-ripple":"=11.0.0-canary.59010b6dc.0","@material/mwc-base":"0.21.0-canary.0138863c.0","@material/mwc-floating-label":"0.21.0-canary.0138863c.0","@material/mwc-line-ripple":"0.21.0-canary.0138863c.0","@material/mwc-notched-outline":"0.21.0-canary.0138863c.0","@material/textfield":"=11.0.0-canary.59010b6dc.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.0138863c.0","@material/notched-outline":"=11.0.0-canary.59010b6dc.0","@material/ripple":"=11.0.0-canary.59010b6dc.0","@material/shape":"=11.0.0-canary.59010b6dc.0","@material/theme":"=11.0.0-canary.59010b6dc.0"},"publishConfig":{"access":"public"},"gitHead":"851518435241b4315820e91765f5b26a5537c63f","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/851518435241b4315820e91765f5b26a5537c63f/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/851518435241b4315820e91765f5b26a5537c63f/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/851518435241b4315820e91765f5b26a5537c63f/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/851518435241b4315820e91765f5b26a5537c63f/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/851518435241b4315820e91765f5b26a5537c63f/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/851518435241b4315820e91765f5b26a5537c63f/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/851518435241b4315820e91765f5b26a5537c63f/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/851518435241b4315820e91765f5b26a5537c63f/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.0138863c.0","_nodeVersion":"10.24.0","_npmVersion":"lerna/3.22.1/node@v10.24.0+x64 (linux)","dist":{"integrity":"sha512-GhT8XQbSqOo0zwmwGfP+ym5qnJbu+KrEqTPiDiqgXRD47VeFrTilsGano9Wmra6NZylE2Sbo3nJSGlEH8pVrmA==","shasum":"7d903339ec9784626e709e6712c88e18f8994f5c","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.0138863c.0.tgz","fileCount":13,"unpackedSize":204812,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSmNBCRA9TVsSAnZWagAASz0QAJ4J8srWcAfMD45W4YEq\nWqX/neP5IPAijhuEjryM/ShYH9Dh2QoX37s9GVNH56yJXor+qPDi/KKOIPt3\n9m4DWy67aiMg9abKNLO2o0xxDn/Uw/mAGwsxlBrIGUD7d468zI7OHp5leVj/\nN+qTeA+1BIKQiKltk7bz0Oma3G93Sknwfr72BBZoW32NIbkdD2NcBGwWdt4u\nzxOWfCN6AWzGBEcl6KkCF9i6mkUoH+y5F8t3PZwQSPoGRgqLZlOQjMexFE1P\nwPS5JbVrV5c8McV5yxkjxH5Oj3aXlpTn5iEbg4MzZ+Ado6hewZLU0wTzRDsk\nc0xUhJXIJ/m0ai0Mi1lLAq8tX412K7Q5OoMxT5Jusyd8Ep2yH4WF0pp0bTlm\nhVT14XHn5NwFeM0nNVc/j/MpftSoCcEvc/64NBAH8HIxfvMIqXfaiIL3fmwN\naEUPzh/wooWtagDDJzHizopUpfg2EC6k2fgG2vK8VvZxwCDgfP8x5lFPVubU\nQxbFDe7TdOBIMqkCtVP1n/h5wExO1J7DVRUA86tZYDkrB2Lnqx9FXl/Du9Vh\najWJh/NmAc6xS+OmhTShDkPsmG6A022nXA2A4MBlZQET7Cx6qNkAZEby2aVA\nSGcNMPiS1VvH7EMLd412+r/JbaBbNMejTxL7vkjOkJiH4a9SUdHovjzcYbbo\nwyOD\r\n=DwNy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDSgmJNHmMgdXZJ9oFbaFaH8eoVo1Ei0qf621ig9xd/0QIgETyEdLo9ZzR8zp/pUt+RURKdiJMcxDVHHGoTnNGAN0k="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.0138863c.0_1615487809453_0.6183716931703325"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.926f5bad.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.926f5bad.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=11.0.0-canary.59010b6dc.0","@material/line-ripple":"=11.0.0-canary.59010b6dc.0","@material/mwc-base":"0.21.0-canary.926f5bad.0","@material/mwc-floating-label":"0.21.0-canary.926f5bad.0","@material/mwc-line-ripple":"0.21.0-canary.926f5bad.0","@material/mwc-notched-outline":"0.21.0-canary.926f5bad.0","@material/textfield":"=11.0.0-canary.59010b6dc.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.926f5bad.0","@material/notched-outline":"=11.0.0-canary.59010b6dc.0","@material/ripple":"=11.0.0-canary.59010b6dc.0","@material/shape":"=11.0.0-canary.59010b6dc.0","@material/theme":"=11.0.0-canary.59010b6dc.0"},"publishConfig":{"access":"public"},"gitHead":"516a00bc24de904c4782b3d5f4f0d285b7fd1d3c","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/516a00bc24de904c4782b3d5f4f0d285b7fd1d3c/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/516a00bc24de904c4782b3d5f4f0d285b7fd1d3c/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/516a00bc24de904c4782b3d5f4f0d285b7fd1d3c/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/516a00bc24de904c4782b3d5f4f0d285b7fd1d3c/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/516a00bc24de904c4782b3d5f4f0d285b7fd1d3c/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/516a00bc24de904c4782b3d5f4f0d285b7fd1d3c/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/516a00bc24de904c4782b3d5f4f0d285b7fd1d3c/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/516a00bc24de904c4782b3d5f4f0d285b7fd1d3c/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.926f5bad.0","_nodeVersion":"10.24.0","_npmVersion":"lerna/3.22.1/node@v10.24.0+x64 (linux)","dist":{"integrity":"sha512-QIx07ZlVeFJC1GtMITjOoJScQ4htAUclZ628mf7dc8+wFKwevfLDaUCLUD4eI2gvdQjRU6sOd6a7ivbGwa59VQ==","shasum":"c54932d0efe2de66b4a11add6eb33dfa297dfc72","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.926f5bad.0.tgz","fileCount":13,"unpackedSize":204812,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSnslCRA9TVsSAnZWagAAbCcP/3aAxlAhwvU2d3ZIyrvA\n81+YEO2UV2uPJ2pt762uPeSYo9fUiqJAeMzwrfi5KVkA1WySoTImKf+MRQsd\nsfLAuiJfnlKUFpmjS3cV8gVnXh+G9BHME0Mbc7xQxS1ibZsg0hP55PQzjT2K\ntw416hO9a/ii1g6GW64EZ/8wi0pIU0Z1fQ1VKmnOh67Wn94Xn2cdlwHuBIAE\n8di0fly6t3hTmwe9tJk1CkF73jHY625i+LD/0Lqg5Ea4MNdIy0M5RW7s1OJy\nU15af0grpxm7Zyowx+ed8BJOk6ak+W2w7hWbCYpOSh5CzOd9I3jZvqEKfi3U\nc8ZzGbgPLu2Em1UB6YljuwHdTq7s2HkC2bUtFAsnZpUXbJuX8ctEsK8fx+SH\nCjNfvPQ7xqDHcT96v3F0LgJ91u8nywsSXu46Wftlvq5UsKXohhoRFfx7K0w9\nyj4JBqe/lKINMULX8ixbMwdr5zsBCGYfsCHvW1ncp/y5TsTvzGtO01Jtjk7+\nU1e0kjU1PVgbs4Tbs0LGrc0NROsNVZ1k4Cv1/cskeOgJOa4/NJqpqkHnVzOU\ntVRDSwjdCcG9gfZmso21FRMWZd4+9Ze0N9l+KvdKvLnv9sVLoQG34/De+aIA\nncvg2bkMTlJM3Mks9goHf/w3JrCUOnsxwAmsUPcRKviptWryQxLWdGp4bqWS\nOJ91\r\n=9lT5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID45jcH0kr40v1PGCOhJq+aZoAfpPekTVVehhORN2QheAiEA1W3rnZep5s6VS9QZIvDodgwZRnSNyFrZYAXGX/ipNeo="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.926f5bad.0_1615493924972_0.23420845411102853"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.520290a9.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.520290a9.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=11.0.0-canary.1e0653477.0","@material/line-ripple":"=11.0.0-canary.1e0653477.0","@material/mwc-base":"0.21.0-canary.520290a9.0","@material/mwc-floating-label":"0.21.0-canary.520290a9.0","@material/mwc-line-ripple":"0.21.0-canary.520290a9.0","@material/mwc-notched-outline":"0.21.0-canary.520290a9.0","@material/textfield":"=11.0.0-canary.1e0653477.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.520290a9.0","@material/notched-outline":"=11.0.0-canary.1e0653477.0","@material/ripple":"=11.0.0-canary.1e0653477.0","@material/shape":"=11.0.0-canary.1e0653477.0","@material/theme":"=11.0.0-canary.1e0653477.0"},"publishConfig":{"access":"public"},"gitHead":"9817154a83b0101256b341e18843332e354f6c08","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9817154a83b0101256b341e18843332e354f6c08/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9817154a83b0101256b341e18843332e354f6c08/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9817154a83b0101256b341e18843332e354f6c08/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9817154a83b0101256b341e18843332e354f6c08/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9817154a83b0101256b341e18843332e354f6c08/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9817154a83b0101256b341e18843332e354f6c08/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9817154a83b0101256b341e18843332e354f6c08/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9817154a83b0101256b341e18843332e354f6c08/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.520290a9.0","_nodeVersion":"10.24.0","_npmVersion":"lerna/3.22.1/node@v10.24.0+x64 (linux)","dist":{"integrity":"sha512-gMDiw5z1gtMwZ+/ZQisQ92Atrl7AGMAg88WZvGq5Al4BmBv9ik3QjkJWZmWYQjd7RmqDQQcAnd9mfXjVyd0tUQ==","shasum":"13d29f9c11d52f33cf7e2252b122c7822b3cd1b3","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.520290a9.0.tgz","fileCount":13,"unpackedSize":204812,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSplsCRA9TVsSAnZWagAA/+kP/3rBpTssNxLv010v6WFR\nfDTnaEFV6OwskDy08W9HYDOhAOh6WVzHwI3Ur/j0MeX3ShhzuRzOkOlq0LPX\nXBzObvpJsTK1bqS50UkOzfou56ps7tO4FaWv+TZ3Ii7QTuv5qCBAFoq8KeDK\naPKZvxsvH8RWbLbZIZV7vFzrHHhkqDDvUqxGkH0KqYXRD5+9bcZhZQ+u2lIa\nBSE8OcDJq4aSgxDEmPqf3rbwIcRDkK1vkRylodbiR7OqeHBgU8njFhEU8Je6\nwd5ZQhTuVvKekDlYmq06rvMtumY0YMMSTRRLvG/kHf5cPEV6zn6xD/o8NCPw\nmtlDiR+6sRAoOHqx5oozcOMbzWnwv39l5nAyxCTJPNcL9Lwh63gPF4OcbJ0y\nrzmej0oP9a6ZZoeiCJaoN8AVrxOr4jLBspFc3DgklWy5ZviMQZNw+Hw2exwn\n0HuFBJI+XQpit1ov6WROtNeibDc12iGvtHHVQCfrhNQHLhmetVcZ3xApgk2e\nR9sKUVXXarQ1jaeakU8i5tBsDRS+IS0PTe9rNmB4i9xmC1OWVQ1j5YULJlOW\n+TKpasXqyx5XfRd8ingifEJYnVeY0LAWxGnoad9NzTpTrYTkTy9DLKZVcFzu\nt7NhNODhX2MYSPnc0r2uemSeHk3io4qBciv3+olrVF6IurqGq0+NADbwmOjo\nIWPK\r\n=KaYG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCnR0reJDo53sz3XqLpNtWIlbenqWlUIglxkpPVMF+LOAIgPTuYA0w3JlTbkzuKeckItkYKcbvQRdiJZcKfXM3+9Ao="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.520290a9.0_1615501676253_0.8652675589163483"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.9ec431d1.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.9ec431d1.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=11.0.0-canary.1e0653477.0","@material/line-ripple":"=11.0.0-canary.1e0653477.0","@material/mwc-base":"0.21.0-canary.9ec431d1.0","@material/mwc-floating-label":"0.21.0-canary.9ec431d1.0","@material/mwc-line-ripple":"0.21.0-canary.9ec431d1.0","@material/mwc-notched-outline":"0.21.0-canary.9ec431d1.0","@material/textfield":"=11.0.0-canary.1e0653477.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.9ec431d1.0","@material/notched-outline":"=11.0.0-canary.1e0653477.0","@material/ripple":"=11.0.0-canary.1e0653477.0","@material/shape":"=11.0.0-canary.1e0653477.0","@material/theme":"=11.0.0-canary.1e0653477.0"},"publishConfig":{"access":"public"},"gitHead":"d7159bb385f7dc7e6077615de2e9bd441747fdc2","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d7159bb385f7dc7e6077615de2e9bd441747fdc2/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d7159bb385f7dc7e6077615de2e9bd441747fdc2/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d7159bb385f7dc7e6077615de2e9bd441747fdc2/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d7159bb385f7dc7e6077615de2e9bd441747fdc2/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d7159bb385f7dc7e6077615de2e9bd441747fdc2/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d7159bb385f7dc7e6077615de2e9bd441747fdc2/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d7159bb385f7dc7e6077615de2e9bd441747fdc2/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d7159bb385f7dc7e6077615de2e9bd441747fdc2/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.9ec431d1.0","_nodeVersion":"10.24.0","_npmVersion":"lerna/3.22.1/node@v10.24.0+x64 (linux)","dist":{"integrity":"sha512-6w5JWm+E/d2hik5tdF5gv0s5u3gUOTakDL+5LRcg5K/xhgYYOfbPorTWxNGzLAU2aElW1JCOMXwy5bXoLb7jwA==","shasum":"ff59e17ddca08383e3b302862b0a20ac5bd5dc1b","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.9ec431d1.0.tgz","fileCount":13,"unpackedSize":204812,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSppyCRA9TVsSAnZWagAAdX4P/3W0QuwNX0atYl5awekc\nhBHTaGqv11woRAyNVbTZhs4LDYUQupdh5W8PhCirDV2+V1+L/u+qQL5pshdD\nK17c/l1htPGLHXuBIFJ1k5L7vsfimPC7l2VqfzP32fkzsJOxiOqhLnyXTUle\nIaYqxOQvDOYpgza9HqpfAtAt0n+PBHCXcj8HLh0IpcmILjFotWta/1LL+Iib\nzt9LQ31/AIhJVjqUHOHhQtFLrQqwlvIKE/prP8ZPbe070TaIV5mFcY11LqFb\nPDk6OClWczX19k5jbo+8FcNY5bqQ0fwycovHYHkf58AV+DkDxggjrHj4pWKZ\niw+aC8WqBGzZPVo8s9GOiKRdMyuCewIi+lXU1m7zG0XssNsjo8yFQuylvqDt\nhKNxjluZwiwqvPnnk87mstjyUP1WYxNSVv+lkxXtPuN3FyZZNirKOTiuCjIR\nhrwa55NiHQ71PugTvr6hLUkZql6OM2xscTzZlNqGMuTWvjyiICX8WtlWeA4M\nKtdZaQF/NBtAA5UuXAdaQcSAtapoqk9pEJGgBKePnrWDOkeFZrFkrY985qbk\nu2gP6JRgs80VMhqw/zDU1ljRI07/poFYyuSc9RgYcH8WU4u4hRi3RT2jq0w2\ncDToT/+lIH5mvomfgHjRXwKXVOg8TOCbipAcaFS18/X7LwZ9kbFkDt+99Dbv\nMzlr\r\n=7SCf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEA6UaKd5Siq7zMl/V1t+IFA1h6JwZ3vh0N2uZdDu39hAiAWVgNXhyBBTnw42v1NhmyScOfpGSipiqIha5tJpgXnQw=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.9ec431d1.0_1615501938208_0.9232201468282442"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.4246c082.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.4246c082.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=11.0.0-canary.1e0653477.0","@material/line-ripple":"=11.0.0-canary.1e0653477.0","@material/mwc-base":"0.21.0-canary.4246c082.0","@material/mwc-floating-label":"0.21.0-canary.4246c082.0","@material/mwc-line-ripple":"0.21.0-canary.4246c082.0","@material/mwc-notched-outline":"0.21.0-canary.4246c082.0","@material/textfield":"=11.0.0-canary.1e0653477.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.4246c082.0","@material/notched-outline":"=11.0.0-canary.1e0653477.0","@material/ripple":"=11.0.0-canary.1e0653477.0","@material/shape":"=11.0.0-canary.1e0653477.0","@material/theme":"=11.0.0-canary.1e0653477.0"},"publishConfig":{"access":"public"},"gitHead":"571cad0df3b7d77ca4f17d7248d6115fb50b756b","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/571cad0df3b7d77ca4f17d7248d6115fb50b756b/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/571cad0df3b7d77ca4f17d7248d6115fb50b756b/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/571cad0df3b7d77ca4f17d7248d6115fb50b756b/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/571cad0df3b7d77ca4f17d7248d6115fb50b756b/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/571cad0df3b7d77ca4f17d7248d6115fb50b756b/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/571cad0df3b7d77ca4f17d7248d6115fb50b756b/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/571cad0df3b7d77ca4f17d7248d6115fb50b756b/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/571cad0df3b7d77ca4f17d7248d6115fb50b756b/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.4246c082.0","_nodeVersion":"10.24.0","_npmVersion":"lerna/3.22.1/node@v10.24.0+x64 (linux)","dist":{"integrity":"sha512-s79A5N8INl8DKqE4/lTfFyM2WPIQbnxbU5/W+7Zt2z3qxFoZyWrbNx4tRt43D2/z97Tiu3rwT75xRwNhGctWMw==","shasum":"ac31503f74567b92d9a831c8e7c105a37c67022f","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.4246c082.0.tgz","fileCount":13,"unpackedSize":204812,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSpwZCRA9TVsSAnZWagAAppUP/1LFePDH7sDMM0a/NTlo\nuRx17DwrE3TToEdZm7WcJrOjn4X7bc227lasM+aQLW1zMvcOLTEqbVczaUk4\nAQiMdG9V4Pph6PkqO7RPOBdza4I3gkf0/K7V7N0dZLZKE85YS11plAs5wkm6\n8IBp4gvOb5jkSlNEODwKI9xlaXKq9cmncOTq5bxyqeFEITjGn1cW84aAtekw\nwRGMN6uFNJr6OoDL5LZLzSaK26A2JovT6khae3N/1Ox8zGWGyrTDUshtfAxa\nAfWxnO41l6r+x2MZyDohGNB9wRj7l2ljLoYjHqMJ78Yu27DIE+5jaCTEmWHv\npLKoclocKwwuj0PXUWOjNKlG5yeZSyB3Iz2pz9NNBsxaktTLQzkocXof9AUi\nFNETbUCwiGXLF8ZEhYLUKi8/FdwXEW3U8eXs4TYX5C6QIQj7CTiE8Eus1GaO\n625mM0CxEDq2N1Cgza7A1lK5BKG090y/LqmAlm7OgpSxmwIondqq3cATQtx3\nrJkMHljmP1VceBhOGsXNrJWPN9JUqA3UJDo/PRYCqEBkEhpPBnKXlTEURYOf\nicmF33qSg3h5bySxE9psg6WYNPC8ail0T6p4DrzMG6oAt2QqA5c2Hc8N65CC\ndiviJ4/1sd7I41xTXzZWybftLatMrOed63TUbntBca9EhdIZwQjaYgYgJhGB\nryc9\r\n=sKT1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEWqLI5FhwCS9ggWatPQLxmjg4zipO4COiHPJZpsEAqTAiBzZJ2Iy2ToXkMTQ1i/JUKTPsld4KJgQIeHXXanXKwjNQ=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.4246c082.0_1615502360857_0.9429310811034046"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.2d736253.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.2d736253.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=11.0.0-canary.1e0653477.0","@material/line-ripple":"=11.0.0-canary.1e0653477.0","@material/mwc-base":"0.21.0-canary.2d736253.0","@material/mwc-floating-label":"0.21.0-canary.2d736253.0","@material/mwc-line-ripple":"0.21.0-canary.2d736253.0","@material/mwc-notched-outline":"0.21.0-canary.2d736253.0","@material/textfield":"=11.0.0-canary.1e0653477.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.2d736253.0","@material/notched-outline":"=11.0.0-canary.1e0653477.0","@material/ripple":"=11.0.0-canary.1e0653477.0","@material/shape":"=11.0.0-canary.1e0653477.0","@material/theme":"=11.0.0-canary.1e0653477.0"},"publishConfig":{"access":"public"},"gitHead":"4d8c53039218a8da7cc5199162317802bf01f7a6","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4d8c53039218a8da7cc5199162317802bf01f7a6/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4d8c53039218a8da7cc5199162317802bf01f7a6/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4d8c53039218a8da7cc5199162317802bf01f7a6/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4d8c53039218a8da7cc5199162317802bf01f7a6/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4d8c53039218a8da7cc5199162317802bf01f7a6/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4d8c53039218a8da7cc5199162317802bf01f7a6/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4d8c53039218a8da7cc5199162317802bf01f7a6/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4d8c53039218a8da7cc5199162317802bf01f7a6/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.2d736253.0","_nodeVersion":"10.24.0","_npmVersion":"lerna/3.22.1/node@v10.24.0+x64 (linux)","dist":{"integrity":"sha512-S3t5q2ts1kQt7p9BA6Pf/BDaxobym8ATppuqZfbllbST5LJsZYm5r76g0eDV60KXroH62HcKUe5cfWrwNNLRcg==","shasum":"dd21fab387c517a60b69ed98b54dea71db22ec82","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.2d736253.0.tgz","fileCount":13,"unpackedSize":204812,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgT+FECRA9TVsSAnZWagAAzlgP/RvTKURGOTQ+W2sEecJm\nqXICBF2/jbIqCDaEayDHjoJ6/b43jvVH5+yLY0kY5N6IBQ58kVNMbo0dB2fD\nKPDHMhaOOWRsbOofoVsRHPvfLaPaA3HDrNoXo6xP1NtDe7AVBKccgGS7E28e\nqXyutnM4/7aQGuUYgsflH+DkGqiP8T3HOIQj7dOpTRU6gqGPNmCv4uqfJNib\n0q7DHDzR9ap9mw1GkoNuFXMTd/zfrvg22Lc2L5lBkUbLahVvAObXcp7qzvBi\n8cDjpJBqoIzrRu4YeQKYkt0vfP5wE93nJIYaqaFKiPh7sudIkACCTrkF9NP8\n2yFxbuTBgW9pR9iY5eXpCzHNQOU5jd+S++n/5pDepgUza07GV63jpRx/IB1C\nV92/yNZ5usXNUxWnt+/HPYbw58fXofxTsJqgW4XG5MSIRXiMxno46f24fXwW\nR4k9ctlnNneHNUOhEqKkWzFHfC4v4runHHzo+unBhwxfLTHC9H9Y7E3pD1Da\nsuS34iejM+Un886wq306En0HabJlb/uKsBjaHFEwSQVymK3kWxxAjXOXN50X\nK8G3yAFrXCW5ueALIXVrjs2p5mVd6QtvBjiMXaKyuczd7VJnIchl8mihE0X/\ndKxbe8Z76BJJOTOFlX6/GdjCqCSYpCHm6euliNh9298mRhGesEsF58giygq4\nnzMu\r\n=W1tt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAaZ/drDzjoeDMYAEYlk6MGRC/01e04voYDiC9fIw6GzAiAr0LjGUtMLF1/hRfp1JNQ/fqgoohp+AjUKHdINvuctvw=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.2d736253.0_1615847748221_0.3567583186001062"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.7033124d.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.7033124d.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=11.0.0-canary.73a227194.0","@material/line-ripple":"=11.0.0-canary.73a227194.0","@material/mwc-base":"0.21.0-canary.7033124d.0","@material/mwc-floating-label":"0.21.0-canary.7033124d.0","@material/mwc-line-ripple":"0.21.0-canary.7033124d.0","@material/mwc-notched-outline":"0.21.0-canary.7033124d.0","@material/textfield":"=11.0.0-canary.73a227194.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.7033124d.0","@material/notched-outline":"=11.0.0-canary.73a227194.0","@material/ripple":"=11.0.0-canary.73a227194.0","@material/shape":"=11.0.0-canary.73a227194.0","@material/theme":"=11.0.0-canary.73a227194.0"},"publishConfig":{"access":"public"},"gitHead":"7797af96dedeb3641f0889f0ae67bc02a1ff2332","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7797af96dedeb3641f0889f0ae67bc02a1ff2332/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7797af96dedeb3641f0889f0ae67bc02a1ff2332/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7797af96dedeb3641f0889f0ae67bc02a1ff2332/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7797af96dedeb3641f0889f0ae67bc02a1ff2332/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7797af96dedeb3641f0889f0ae67bc02a1ff2332/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7797af96dedeb3641f0889f0ae67bc02a1ff2332/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7797af96dedeb3641f0889f0ae67bc02a1ff2332/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7797af96dedeb3641f0889f0ae67bc02a1ff2332/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.7033124d.0","_nodeVersion":"10.24.0","_npmVersion":"lerna/3.22.1/node@v10.24.0+x64 (linux)","dist":{"integrity":"sha512-eN2ZCe+OtMlq7cv83JAaWyBBylbl1fxEClWWql2a4Wc/kbxButUyq+o4P/u20h+n//jteby7B/+84tFmO9Kl5A==","shasum":"f513bd76b6d65d0e9fad98043ce96cd810a399cc","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.7033124d.0.tgz","fileCount":13,"unpackedSize":204812,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgUPruCRA9TVsSAnZWagAA1Z8QAIghVxDzCr2OxAU+RpeF\nRcJDU0OLc54zTO4fDDf7RzDFTMd6fI8wD4KYMHYtorXGUVLrwT117lNf87t+\nWsL8D7yl+4IkaX+PPqjcBDXTWxPJcg2XL2SCgjMMGTBsB6i9eTwMIN/rUGfW\n/0a+OOa0vq5kNB2cBmYz/IyT5kZR2PQ57+R7rSFRYQdSRL2pq72fNz5itqdE\nk30Nh9h/Lr3BXJkEjgFQn7NqAv5L5nPtAZcAA8qrzzL+seHAmrymSgUfh1EL\nRNcT355ZCMGHY3Z7Yjo50Agy4yzxsalIL4AHwRCsAaDhFri9RU/z/sScUpGz\nww9YNp2QYyV6CaTW8CWBpP3n+jXagN1q4V1+K+lNEgY8ZCUXnf6gQfesKG4W\nGyL2Sf5iMq2l+u/jBG5r9vubXqAjIx8S1LYqxz//bnAOutrqUMURydjLnzMM\n98j5ovmTOdK6YP6YkFb4QC9M7PC9eJRMD+rJhwR0jqFtY4AbCBuinklUfQXg\n4P5sQyJ0VwjlEddaB4UkyBVU7O43awbVnyPmPFbvIwIFP0TS8dqB0WQtnGIl\n4uFegzde+Daa7fM75QfyK0vHxCDjklP07K8FyJbOxPGHJ/OQnSo3BfbMCoFW\niNG5V64+VyfBhD9emV4PV1lS7qqWSYEQdEb8a1WstCDJYyLFQyn9Nqs+eZdp\nhSC+\r\n=He+i\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDnxFm4bfFSUxko8lzCcYudcU2dwz7QMqQfoBRYC5L4EAiAwdvHzdFOTinXygVr+uvUdJ/gkIS5dRoq1DsEpsaiUiw=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.7033124d.0_1615919853522_0.017037895597144193"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.6c0ee901.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.6c0ee901.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=11.0.0-canary.73a227194.0","@material/line-ripple":"=11.0.0-canary.73a227194.0","@material/mwc-base":"0.21.0-canary.6c0ee901.0","@material/mwc-floating-label":"0.21.0-canary.6c0ee901.0","@material/mwc-line-ripple":"0.21.0-canary.6c0ee901.0","@material/mwc-notched-outline":"0.21.0-canary.6c0ee901.0","@material/textfield":"=11.0.0-canary.73a227194.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.6c0ee901.0","@material/notched-outline":"=11.0.0-canary.73a227194.0","@material/ripple":"=11.0.0-canary.73a227194.0","@material/shape":"=11.0.0-canary.73a227194.0","@material/theme":"=11.0.0-canary.73a227194.0"},"publishConfig":{"access":"public"},"gitHead":"d7894da96b1452ae771bb3096b993e3f51ce8adc","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d7894da96b1452ae771bb3096b993e3f51ce8adc/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d7894da96b1452ae771bb3096b993e3f51ce8adc/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d7894da96b1452ae771bb3096b993e3f51ce8adc/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d7894da96b1452ae771bb3096b993e3f51ce8adc/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d7894da96b1452ae771bb3096b993e3f51ce8adc/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d7894da96b1452ae771bb3096b993e3f51ce8adc/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d7894da96b1452ae771bb3096b993e3f51ce8adc/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d7894da96b1452ae771bb3096b993e3f51ce8adc/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.6c0ee901.0","_nodeVersion":"10.24.0","_npmVersion":"lerna/3.22.1/node@v10.24.0+x64 (linux)","dist":{"integrity":"sha512-40abP0lsrPIH2TRca5aNpVJjG+Q5PfmvqWM1pyHJyP9APXdZwfSX8ys9GD905f+t23N4SVjcuOaHvFIvMiqwIQ==","shasum":"b4e39dcae9ea6c19154d8d51a62194709cdfe852","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.6c0ee901.0.tgz","fileCount":13,"unpackedSize":204812,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgUTOFCRA9TVsSAnZWagAA998QAIp4hZeiDvzr6fdDi/1q\nKgXOpWviWkq3zdZNN6/9QPhHHmABRSP+ajBDCZmSVR4Cv0oWGDiNeQVSBFDN\nBfSJXo+v6r1UVLbYHTQlXYjn26VCQd8PNgXcblUng6JuFZogEkTPaA4iAxh0\nBdUxoiwVRtDWhhhYg39OKZqW8Wr6aHlU5nlUrWfU7fFrGM0QHRgWJExkRMvF\nJBcD0KGQMcrS1neYvzpm/EO//Y9C/N+f1JF3hZDqPgfFZeDrz1CLkaGS/9cp\n0MwExULKw8HJXfemcn2rcaI0YTBLFLPtwnrmFfqj9yDFOrrv/QV8sfpKDvoW\nv7iMn22kP1SW130sUElr7yKoK9NXeGxpRg+P4MzEKl2KURwpRck1JvGi2Cb9\nJXBchjYHkEily5X6x1L3g5htw2qfdM/NJyhk7gJQsEkKZnqSljMwClnSVHBW\ntigRS3EK0ztPZXolLTIWdf2b4wQP2haleq6mdOBB8O0h6NBmmqBXga2LtWw2\nEpLwHCLa2UO/7L9ZLQb+aqelnE4UE+LecdvDPPYvt9d3eSoiimIBTwR/cQnn\nOvyHBhzkrqZdXKOkYXxFPk2/m8SYRi7q31hEr+1+3WnW8vaL3XrhWNFLMYlj\n1LNbR4Bp18F53WZd3ks9CpX0I+wcX1b5I4taaYgoWhWwcPyrWZXCSNWgffl9\nGRUq\r\n=qZ49\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCH+qiNLK0hcm3o9Hg5VetrB1hPaLDWBszuCYakYfuFZAIhAKqVT9ynGHw/oZv4DelbD5OnLcEmrvxNuh5UcPdYgaxd"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.6c0ee901.0_1615934341119_0.7664126897287633"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.7f0d605e.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.7f0d605e.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=11.0.0-canary.941ca3b3c.0","@material/line-ripple":"=11.0.0-canary.941ca3b3c.0","@material/mwc-base":"0.21.0-canary.7f0d605e.0","@material/mwc-floating-label":"0.21.0-canary.7f0d605e.0","@material/mwc-line-ripple":"0.21.0-canary.7f0d605e.0","@material/mwc-notched-outline":"0.21.0-canary.7f0d605e.0","@material/textfield":"=11.0.0-canary.941ca3b3c.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.7f0d605e.0","@material/notched-outline":"=11.0.0-canary.941ca3b3c.0","@material/ripple":"=11.0.0-canary.941ca3b3c.0","@material/shape":"=11.0.0-canary.941ca3b3c.0","@material/theme":"=11.0.0-canary.941ca3b3c.0"},"publishConfig":{"access":"public"},"gitHead":"77ccd00da9f68d22de2494a2aa4f35b0da375669","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/77ccd00da9f68d22de2494a2aa4f35b0da375669/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/77ccd00da9f68d22de2494a2aa4f35b0da375669/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/77ccd00da9f68d22de2494a2aa4f35b0da375669/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/77ccd00da9f68d22de2494a2aa4f35b0da375669/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/77ccd00da9f68d22de2494a2aa4f35b0da375669/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/77ccd00da9f68d22de2494a2aa4f35b0da375669/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/77ccd00da9f68d22de2494a2aa4f35b0da375669/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/77ccd00da9f68d22de2494a2aa4f35b0da375669/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.7f0d605e.0","_nodeVersion":"10.24.0","_npmVersion":"lerna/3.22.1/node@v10.24.0+x64 (linux)","dist":{"integrity":"sha512-uNuERdwdwG4Tq/xBPT78p+r1fuS508fVDTQQ8CRX2TZTsH2kEqGz6JTR+gJe/r7G5GN3lNHVKNP3E9/5SayBCg==","shasum":"0dee4a66bc9f99bc765f08fd5535d02e1d809ce9","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.7f0d605e.0.tgz","fileCount":13,"unpackedSize":204812,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgUkS4CRA9TVsSAnZWagAAf0UQAIEepiL5VMDlfnkiGq14\nJMjJzOyZVEdTJfzZtJ1I5lriblpIy+jp7QoJpjqcF2VgfoGenkclnpgflH0L\nXx2twoDgB9lg/imfUXWDrB7ogwhlpVBVI2p9cZI2r0b/9wbbIHmU+4Rdr4aV\nFzsaxxnVR4o3748ITQ7s+SaiCqDgX+qTkKeY2EcqbjXnbDT7PDPvx23d3Tlv\nmAml6iF2k2K/tdxV6412IMwDKXkU2a0r1NxNP8hdACb9OdbPAdwym4UXRGJ5\nnSfydQduzhF3ZBObkwK8jhQmBF3TFouFjpvZPVpsDpWAat67ySJaCqw1LL08\nxAfEfFnC5K/aE0MV+jPp7sOrUpGkZ4W/3ybb1GAc24hyh0DLgUcjyLfgErbG\nvs9lTa9OkzTEtWk7C1NAY0k43+kGLJlX3ndFl9sWTuOB1Jf+ptXqujxkuEXt\nyf37kxdILxmf3lOkSLrll+GCVW8jqGi+OkPoIJQsV2K8LCQBC86h3ZcpO4mw\nLlJy4ktEnajfCrKaq3cPqVBip8YoHbaZCTvwm0ceIpBM8dcVfjr/GBhrMxN6\n4CaBWkHc3iP6+4/wtENTfmXk5a2HCTULTEz1nhhV/7EI1r1vayZoOyd2DG2F\nfcBoI7/FtREu3foljb0QxtQmm8EFclVAukcX6os472o98qzrtCmtyP9xsRko\n9JNp\r\n=u280\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC4CgCSYRQiWgMnbmrQ5WPXd3pc/sb8h5yGwHpt2JJvIAIgN6WpzQcasMVuww4TjS+ieTEIAft2gYa/ZFq+FgH6bDM="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.7f0d605e.0_1616004276321_0.6334307076347585"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.572107b5.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.572107b5.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=11.0.0-canary.941ca3b3c.0","@material/line-ripple":"=11.0.0-canary.941ca3b3c.0","@material/mwc-base":"0.21.0-canary.572107b5.0","@material/mwc-floating-label":"0.21.0-canary.572107b5.0","@material/mwc-line-ripple":"0.21.0-canary.572107b5.0","@material/mwc-notched-outline":"0.21.0-canary.572107b5.0","@material/textfield":"=11.0.0-canary.941ca3b3c.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.572107b5.0","@material/notched-outline":"=11.0.0-canary.941ca3b3c.0","@material/ripple":"=11.0.0-canary.941ca3b3c.0","@material/shape":"=11.0.0-canary.941ca3b3c.0","@material/theme":"=11.0.0-canary.941ca3b3c.0"},"publishConfig":{"access":"public"},"gitHead":"9399ecfdfc3b2f0153e16b3970555c1351c9ea81","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9399ecfdfc3b2f0153e16b3970555c1351c9ea81/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9399ecfdfc3b2f0153e16b3970555c1351c9ea81/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9399ecfdfc3b2f0153e16b3970555c1351c9ea81/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9399ecfdfc3b2f0153e16b3970555c1351c9ea81/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9399ecfdfc3b2f0153e16b3970555c1351c9ea81/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9399ecfdfc3b2f0153e16b3970555c1351c9ea81/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9399ecfdfc3b2f0153e16b3970555c1351c9ea81/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9399ecfdfc3b2f0153e16b3970555c1351c9ea81/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.572107b5.0","_nodeVersion":"10.24.0","_npmVersion":"lerna/3.22.1/node@v10.24.0+x64 (linux)","dist":{"integrity":"sha512-7jju5dvhe5Gl3oW11P55PeVoZOPthygKg2xG2OgdCNqAIYVcytPjgu2Shb+iFNRXQy3o+AEVoIhB5CepnV5AyA==","shasum":"46efc413a38ecc835855037ecfdda75ed7088ef0","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.572107b5.0.tgz","fileCount":13,"unpackedSize":204812,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgU+goCRA9TVsSAnZWagAAkecP/iw5SH3YobK+yGfy9KK9\nmSgAepOE1XfYGohoObEnmOPQmC2cwsLlsXqeMDSWeLvIw5FWbq4agsDNq1gO\nZ0BNvobWI4C4S+BjKHmVYWt2J/jpNfLPuMCJudCclWGIbRCV5vs+IXF3ffyO\naT2NhiWTL48Rz1zw5uBD10CQk8ewrdFU0SOShidbTgxHhvv6SVM0uxGRWwMi\nxU5HTdns/S5U77PDiamN1suJZaE5zVASAkX6PC3fb4/+dDOTIyssAVtnz4lJ\nLMR0d8KNZjQPzdffEZ44s9/BunZ5x/D7Nm2tLD84mz2LIVh9CFfkZ5FIXkwf\nS1xqgh0PMjXLVfnhFTg6gcoIBDl7iUqpkTwj8kRk7yQlsR/7OJ2ToeNH7JR9\n/BAulspzB3nFMlesMqpMtvfaEsq6w300LYxUlHTo/ege7gIiwiylX9DvGTWH\nDwnP2/Hj2uJn6CpXQsY16WM8t9SLY/uv3iJkEkixd5KXT/CsOsCDBM7bgfNx\nQpj6k1ZhNVMRZsT6bT4uXCSOGf1VnoeW7jnlVA2fCNng70TAll1YnLca3ita\n9iKd9EZWBETm0CRZgHiET2+s/PLwziwROQW7WvNo35LzJYtMI8hVPseSQscy\nHHGPJyW+rQFDgCYBjGrFgmQU8q/eRLZdccTniJVsPqb06QdnI250rBrjtvQ5\nm6ld\r\n=TVdY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDBSBNIlr8iumOED60CHZJz8+dhXdg0QylEZAs81KiUqwIgPEBY0nCPtIp/XR+wfxZJDCkYowPKwpjTXyZcn1RyGEc="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.572107b5.0_1616111656192_0.373448170029653"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.b7b220b1.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.b7b220b1.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=11.0.0-canary.941ca3b3c.0","@material/line-ripple":"=11.0.0-canary.941ca3b3c.0","@material/mwc-base":"0.21.0-canary.b7b220b1.0","@material/mwc-floating-label":"0.21.0-canary.b7b220b1.0","@material/mwc-line-ripple":"0.21.0-canary.b7b220b1.0","@material/mwc-notched-outline":"0.21.0-canary.b7b220b1.0","@material/textfield":"=11.0.0-canary.941ca3b3c.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.b7b220b1.0","@material/notched-outline":"=11.0.0-canary.941ca3b3c.0","@material/ripple":"=11.0.0-canary.941ca3b3c.0","@material/shape":"=11.0.0-canary.941ca3b3c.0","@material/theme":"=11.0.0-canary.941ca3b3c.0"},"publishConfig":{"access":"public"},"gitHead":"23f87dc3afa9f7b0599f9673a9f27f15d9751f3a","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/23f87dc3afa9f7b0599f9673a9f27f15d9751f3a/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/23f87dc3afa9f7b0599f9673a9f27f15d9751f3a/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/23f87dc3afa9f7b0599f9673a9f27f15d9751f3a/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/23f87dc3afa9f7b0599f9673a9f27f15d9751f3a/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/23f87dc3afa9f7b0599f9673a9f27f15d9751f3a/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/23f87dc3afa9f7b0599f9673a9f27f15d9751f3a/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/23f87dc3afa9f7b0599f9673a9f27f15d9751f3a/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/23f87dc3afa9f7b0599f9673a9f27f15d9751f3a/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.b7b220b1.0","_nodeVersion":"10.24.0","_npmVersion":"lerna/3.22.1/node@v10.24.0+x64 (linux)","dist":{"integrity":"sha512-4eKsQlRYGWJZr3EgTC+TihsZuPVxlVerT3oOjbUmeABtVhaIzjux0IgcKEIcTuh+1d+f9SPAepLy03iDVxYHNQ==","shasum":"95c63c21f9e38ccd5c96a6985a6f8aaed2ae6c84","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.b7b220b1.0.tgz","fileCount":13,"unpackedSize":204812,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgU+4xCRA9TVsSAnZWagAAXrUP/01cI+zvf85u8d7p+kai\nqOacAcCrWWndWbZpaMgcgWmLAV4pnx0j/S8z+iD/sw57czO30iVQknW5E3uB\n9bMQl5jo31FmAHJubbAnBvERL0b7sQiXs5DGcl6iOXZl2QkGnTQvZmJWcl9d\nayt9LnA9sF7NADph1YA6H9arWTIPQtq4QPCmLaPhPiZKIZKUajt2WPNG8aCb\niDG7kdVNFjGk84+mpRPBepVZjicuwpJUjmgwMqTtGBFtt4lJT8836FJkqT+u\ntYfMCnnThE9E06ognjH8t25BcOHMmoXIyvRotVusmDMFf555E3gHyvxCPsgT\neptleLaie11Vs5p/z+SQBVQvSBOWZ6kaIVUjMukvrdvLdTaIyDaj81Cqusxf\n79YcSRv3pDZwiWLk5ZIlyk5VvSngZ+Ehn1NI69OJgFtaq6+cgGvfoh2AhiRi\ny5cQiXvsfDk0K9JsizLHGXs/klrZidrKxZ/YT+2tO0lHsi5boLqUOTUEI4Rn\nAGlC2yZzwgoGNEcoXiu5I8vpw3e30RPwRwwL70JFPEzPOjGwrV4FQQCp7ji0\nzyWAGLDpJt4mKIiDZ+fpYo1LC15o+lpiT7WKDzMl4CyaqqwxOM2PcxfFNRhx\nSXdNvB+FJ+v24WKO8CtSKDxCC0+5i3kGU6rbLbZ0KC9bHgdJ0/2ukmVbpO0x\nBu9P\r\n=AEHs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDUmYf0ddp4zWzghERYHQe+Q1ok3S/rOnr99/EKwxgc7QIgayA/aVSJu/A6CS7Z16PxmcTMupvU5MX+FxKI18e+LKk="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.b7b220b1.0_1616113200962_0.6004157654531799"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.233b2de7.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.233b2de7.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=11.0.0-canary.941ca3b3c.0","@material/line-ripple":"=11.0.0-canary.941ca3b3c.0","@material/mwc-base":"0.21.0-canary.233b2de7.0","@material/mwc-floating-label":"0.21.0-canary.233b2de7.0","@material/mwc-line-ripple":"0.21.0-canary.233b2de7.0","@material/mwc-notched-outline":"0.21.0-canary.233b2de7.0","@material/textfield":"=11.0.0-canary.941ca3b3c.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.233b2de7.0","@material/notched-outline":"=11.0.0-canary.941ca3b3c.0","@material/ripple":"=11.0.0-canary.941ca3b3c.0","@material/shape":"=11.0.0-canary.941ca3b3c.0","@material/theme":"=11.0.0-canary.941ca3b3c.0"},"publishConfig":{"access":"public"},"gitHead":"6887e9dd977fe57d5199416b097952ea056e78c6","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6887e9dd977fe57d5199416b097952ea056e78c6/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6887e9dd977fe57d5199416b097952ea056e78c6/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6887e9dd977fe57d5199416b097952ea056e78c6/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6887e9dd977fe57d5199416b097952ea056e78c6/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6887e9dd977fe57d5199416b097952ea056e78c6/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6887e9dd977fe57d5199416b097952ea056e78c6/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6887e9dd977fe57d5199416b097952ea056e78c6/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6887e9dd977fe57d5199416b097952ea056e78c6/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.233b2de7.0","_nodeVersion":"10.24.0","_npmVersion":"lerna/3.22.1/node@v10.24.0+x64 (linux)","dist":{"integrity":"sha512-a3QCtfXw/VaawQohBse76LlvozwinC9K4Qbhp7t2rpIN8FjWG8R5x90xvSMBMDkjuD7FvwxpkcARAICVPDE8+A==","shasum":"28f37f2ccc7f3d1bbd878f6f23da99d2444eae43","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.233b2de7.0.tgz","fileCount":13,"unpackedSize":204812,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgVO23CRA9TVsSAnZWagAAz9IQAIgPk6Pb1/9ZicP/DZcU\ng6OrMGRs38FfWrqwttzX6tosHuvzK6PVRw1XYknyk7xTjprowrUnE3KOB72K\nVtiWUFhNfOyifJ83jRYz7vSjsV41wtLTeJUhN02HByXw7k4f+i6kkyBN9dvY\npA7SYLXvpqRlqM3c/xqLyBX7+yQaYfLq3j+QjJAKtOVQo2HnTAl5oE8pr7rj\nJOXvFLa52JWYG/+lcbYBnvnuApY2U16J+xil6uSueef+BbPAG7MWEMd+BZZv\nczrdbQ5GL+n7iHRKBNWCEZnZFcQWUMeyPF65bWwegb9Y023hvtXqOuYcSBMw\nC2ti2n3Id4RP/rOf73XevBKtKpp8X9IINYHMWkUl4rwEG+GGBUiPozEW0bAb\nCUxXMzK2BW1isFbknt+r9YK/A7v7p5RV3NF/4gRMt6MHnKd6cNp4N1XbCwc7\nIko/PI4hc6aGmj1Nw3v4ACbCzO/I8twpTUkG6bXhfFs5Fdkn1NdIWggLtlGo\nNYteqPK440qWjUe8YW2c6fRw/GAFRtQz9pKBAgqFGmWTrQmFkwi0vZKFcjVa\ndEZfHpm/6QiUiSa8l+myv0vhmxZliN4jJoQlX70ohIbYWGe+yDrVeoRf3SKA\nDhMjc6cjMyncJ3MHnuZaJv/+ekByKAz2AYHtuud0VrbltFIIs2g77MES8wF1\n1A58\r\n=H4oT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBpPm5MLEuZb2wpf5swNFmGV8jO0rNjCHfURmJHawoMYAiEApuYEIlfZrVeezwqGGV5g3wiNDGC0nX8kBdUp2fQaN38="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.233b2de7.0_1616178614561_0.5612591324643981"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.0c1a2d97.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.0c1a2d97.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=11.0.0-canary.941ca3b3c.0","@material/line-ripple":"=11.0.0-canary.941ca3b3c.0","@material/mwc-base":"0.21.0-canary.0c1a2d97.0","@material/mwc-floating-label":"0.21.0-canary.0c1a2d97.0","@material/mwc-line-ripple":"0.21.0-canary.0c1a2d97.0","@material/mwc-notched-outline":"0.21.0-canary.0c1a2d97.0","@material/textfield":"=11.0.0-canary.941ca3b3c.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.0c1a2d97.0","@material/notched-outline":"=11.0.0-canary.941ca3b3c.0","@material/ripple":"=11.0.0-canary.941ca3b3c.0","@material/shape":"=11.0.0-canary.941ca3b3c.0","@material/theme":"=11.0.0-canary.941ca3b3c.0"},"publishConfig":{"access":"public"},"gitHead":"d341fb857369610d763723d28d8c9955cc461de4","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d341fb857369610d763723d28d8c9955cc461de4/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d341fb857369610d763723d28d8c9955cc461de4/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d341fb857369610d763723d28d8c9955cc461de4/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d341fb857369610d763723d28d8c9955cc461de4/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d341fb857369610d763723d28d8c9955cc461de4/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d341fb857369610d763723d28d8c9955cc461de4/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d341fb857369610d763723d28d8c9955cc461de4/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d341fb857369610d763723d28d8c9955cc461de4/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.0c1a2d97.0","_nodeVersion":"10.24.0","_npmVersion":"lerna/3.22.1/node@v10.24.0+x64 (linux)","dist":{"integrity":"sha512-dAEh9b1Fmkj7KBkQFp1qByCklFjx58jmCtKCHzZsszyEhq5nYGgtaOgRTNPeQ5xcVKbAJVsmub1wG9ahAsm1SA==","shasum":"7dd1037b898fd752ec1e639d456abf01b588c60e","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.0c1a2d97.0.tgz","fileCount":13,"unpackedSize":204812,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgVRXMCRA9TVsSAnZWagAAlhAP/iParp27BnoMwBquFHku\n4G7hqpIYYjPfiaR6Nl8yAq28nlPW9mY3NeQ6VRSyvkfpcoVJvFoHOIAXmVAa\naKsT1dhu/D4P5W1Q9deulT97wU1gUQxjhQYcCVPycb9g3ptbqoC+019d7YOG\nwJ/LqDTEEcT62JWwJSR5OREp+VSDCH5zDsF+RLeA7VjbmjO/oeA5OEWHT/Qe\nMdEkBzFYyOyPPHDv/JtxDahWphw7gSWn4uwr8793zx7RvJScEq2GiZx1oXuj\n36eTFX9HVIy5nXC5XanPIT9AUpk0332Uykfh9TcLFj+DmlZ1b9AiiKhS5SrL\nDM5kLUTRpN75gpxEzUJ/15GpUXDYk56k5lOlJq9suvicGAJ+6jQBPOqTO1BQ\nwO//Un+51H4RZ3ovJeBpCGaj6O0TyNUTHazQbQ/7Z8fWYl1j11mJ8oXl4MBI\n084MUI+OdkRkyimHGZQWr5OBef3g6uzCRLdCEuo9ZVUm+OewWTc94CIPfDwB\n1PGD+4HfctVyLTWszJ85jRpo1vpDj+4rZTw+W+FtYT98DUfUyuO0TW4lJomj\ntYuVY1ph5CWHYIf0jMX162rky7623EYvWe4T1ChXRgqtwtPMW2bqKKWPxKKW\nU0VM3FHAIntNZELR3kPJSnLCBY/zq71TGdM8PgNCextA59G9x7Rkle4Aer2p\noh+h\r\n=RX8W\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC0h244lphYdernkYRGMRdKvy3tIPYPf9rwQ8gXOXOBpwIhAICdFjtNJWK5kBLPR9owc5qv3l85sruTvbr1fJdHd0V+"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.0c1a2d97.0_1616188876115_0.4916927054581681"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.57ca2e73.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.57ca2e73.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=11.0.0-canary.5f0fc444a.0","@material/line-ripple":"=11.0.0-canary.5f0fc444a.0","@material/mwc-base":"0.21.0-canary.57ca2e73.0","@material/mwc-floating-label":"0.21.0-canary.57ca2e73.0","@material/mwc-line-ripple":"0.21.0-canary.57ca2e73.0","@material/mwc-notched-outline":"0.21.0-canary.57ca2e73.0","@material/textfield":"=11.0.0-canary.5f0fc444a.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.57ca2e73.0","@material/notched-outline":"=11.0.0-canary.5f0fc444a.0","@material/ripple":"=11.0.0-canary.5f0fc444a.0","@material/shape":"=11.0.0-canary.5f0fc444a.0","@material/theme":"=11.0.0-canary.5f0fc444a.0"},"publishConfig":{"access":"public"},"gitHead":"aa86345a10da02c5166fca78e72e367ebeb95677","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/aa86345a10da02c5166fca78e72e367ebeb95677/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/aa86345a10da02c5166fca78e72e367ebeb95677/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/aa86345a10da02c5166fca78e72e367ebeb95677/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/aa86345a10da02c5166fca78e72e367ebeb95677/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/aa86345a10da02c5166fca78e72e367ebeb95677/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/aa86345a10da02c5166fca78e72e367ebeb95677/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/aa86345a10da02c5166fca78e72e367ebeb95677/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/aa86345a10da02c5166fca78e72e367ebeb95677/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.57ca2e73.0","_nodeVersion":"10.24.0","_npmVersion":"lerna/3.22.1/node@v10.24.0+x64 (linux)","dist":{"integrity":"sha512-VqcPNxfdncVVKHGlFsgeIoOAXfxzF7LuZRM0rwkLLhXXc6Mm1rBnF09gxYZeOTK1ggm9NavJUhTmDn22wHjSpg==","shasum":"612efe45834094b5e160c4b6fd95228bb09a1f11","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.57ca2e73.0.tgz","fileCount":13,"unpackedSize":204812,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgVShzCRA9TVsSAnZWagAAQCkP/AnNHRuKFnZqpSWqfa7O\n/CPZfXG+qdPj2CNVNd2qHV8qQW3M0Q7ogjLbUpvpBYHgZs0sss8kxeCEVnDc\nJ0N8w8SMbZDKRu+9RiOaJnPMOnn51UTs/ks0TBYhNwIgblG91dwwNu/kKbH+\nWKIpdOatpl6lOXnmldJEv8IPMf3QmX1xN9a0otmMO0d7+2ZkyQLiTCTDA4Jw\naanJ4lDZL4C05FP7x0fPfCwiFADLUf8Nnc8j0eRUtFdKKOFKSX0d6vPiBoRn\nGHtUp/XnbrW/b6ZS0nwr8CeYHdduPLH+vVjxBCnN59X0fN3olKPwDdO+Y1fY\nlQRqE1M6M5wAfcOQFa16R/zfcqHH2n82JaogLeSOiT5ZkmFxJI4QWbsEgLk5\nLIpQmKODbHrFOhnApjIm9RXVT/BsRTrrYYmE8VDAikCh4LDWzd4zPConPYTn\nN2H3/unm311Fn4PKOZW+HgFm1gOLG/7x4NTuLMClTf7Phvi/mKSUjpAtVUKr\nhTwJ2c4aS36eCTYNlYLdPSqxaXNnx4TcbHDOS+GNLQAuXPRuLunt6kDgozOg\n9fP9hs/q+hq/3r6PJMNxHD4eJNJWjmfZ90+w9F4mTe7V1+1asPhtOU2TrJVM\nwGEZjhqqA05WVgWLS+blNMe3LgzV7nAZNFp85c1euHY+BWIsC8P4aY331e/S\nyQdP\r\n=zX3t\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC84L5Sy1UwazyWSLlRrNkEv36T4aq80KmL168ij1vAgwIgMPH1mek2sBG1KZcWAAxMKdjgxt57I+U0wvDwx4k6iTc="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.57ca2e73.0_1616193650742_0.4470761597363011"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.5c058f4b.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.5c058f4b.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=11.0.0-canary.8943b991f.0","@material/line-ripple":"=11.0.0-canary.8943b991f.0","@material/mwc-base":"0.21.0-canary.5c058f4b.0","@material/mwc-floating-label":"0.21.0-canary.5c058f4b.0","@material/mwc-line-ripple":"0.21.0-canary.5c058f4b.0","@material/mwc-notched-outline":"0.21.0-canary.5c058f4b.0","@material/textfield":"=11.0.0-canary.8943b991f.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.5c058f4b.0","@material/notched-outline":"=11.0.0-canary.8943b991f.0","@material/ripple":"=11.0.0-canary.8943b991f.0","@material/shape":"=11.0.0-canary.8943b991f.0","@material/theme":"=11.0.0-canary.8943b991f.0"},"publishConfig":{"access":"public"},"gitHead":"6a50e9efec728fe20024c0ac52645387b1485f08","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6a50e9efec728fe20024c0ac52645387b1485f08/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6a50e9efec728fe20024c0ac52645387b1485f08/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6a50e9efec728fe20024c0ac52645387b1485f08/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6a50e9efec728fe20024c0ac52645387b1485f08/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6a50e9efec728fe20024c0ac52645387b1485f08/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6a50e9efec728fe20024c0ac52645387b1485f08/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6a50e9efec728fe20024c0ac52645387b1485f08/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6a50e9efec728fe20024c0ac52645387b1485f08/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.5c058f4b.0","_nodeVersion":"10.24.0","_npmVersion":"lerna/3.22.1/node@v10.24.0+x64 (linux)","dist":{"integrity":"sha512-pdMoHdxBfX2pINMCNulP8TDeZuNe5DsV0vjyXEHG1yPAQhI4nxADffLC1tahYv8Jsbu4YHgpKDOOim/aEEPLBw==","shasum":"818e869a982ff3a5106df9e3fba12c770aa49455","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.5c058f4b.0.tgz","fileCount":13,"unpackedSize":204812,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgWnTtCRA9TVsSAnZWagAAuYEP/i76pvYyF8X8fpFjs9Pu\nT1YJRMmskwV+5dBKpmFqM08gCqhPaNAGe5hCP9+1WDJBVyumec8GMYF3JNNB\nuiJeieHT7KgkgjLcNq/K4pjm2333ng319Uc8mbcUvXDChCQNROVE4/6gebxz\n0zrJBwGKVHBgURUN0T4ttri2tuZyYZNbzh1jdfZVCjYOt+TH4Bqll3sgZ2g7\nbch2TvTLWJN9Ba00tfoQGIV0Xz23stEIHihoKLYHmQ8e18pER3iAz2XLxltA\nFSG7Gmh0Nu30sxEy7/jP+PP7YZ3h1lweiD5UfrYiHaWnXgzyrpzuGTcKCTZj\nYGK0iwS+Hdv9WR3YsMHowHUKj7DCyEGqCF/rwi5UucRpXKXq02Nj/Ptj+CU7\nVnecManeT2SqFhASi3k4p7l1OwtKBvFEtV75cnykJi/x7BUOBGbZrf6SnzJ3\nVUcVcadqdELXhwBkmAG0iYmQ0+tyI9zPEqoGLVPC6c4geGyYCDqzNQ2iTYa8\n8kZRzTTuXVCEoMZBPG/OfwhbzEXnxECQ2BHRxGkqOubiT87HTL+PI0ZdzEKg\nLdBk9Hhr29FjRezICZ7tk0DSMY28UkraZM8ePKTKsJJMIH0eyGTTqUA237lB\nfvVyOI+kTXH9z1Z3ycalY02Ilwkp3yKlV/8UoLH6O5+sOGPMaLagQVL6Sghp\nQhaU\r\n=Ar9y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICQLIl38qJDtQX9lVOZP4WOOqvCkO/Aue6b9cVoGnJFOAiAJ43RxKYl0rvFqvFRoUu3fDwbqZKo6qDKKnnbQgA/xGQ=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.5c058f4b.0_1616540909208_0.3982898960826631"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.e27ef7cd.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.e27ef7cd.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=11.0.0-canary.dc9c84023.0","@material/line-ripple":"=11.0.0-canary.dc9c84023.0","@material/mwc-base":"0.21.0-canary.e27ef7cd.0","@material/mwc-floating-label":"0.21.0-canary.e27ef7cd.0","@material/mwc-line-ripple":"0.21.0-canary.e27ef7cd.0","@material/mwc-notched-outline":"0.21.0-canary.e27ef7cd.0","@material/textfield":"=11.0.0-canary.dc9c84023.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.e27ef7cd.0","@material/notched-outline":"=11.0.0-canary.dc9c84023.0","@material/ripple":"=11.0.0-canary.dc9c84023.0","@material/shape":"=11.0.0-canary.dc9c84023.0","@material/theme":"=11.0.0-canary.dc9c84023.0"},"publishConfig":{"access":"public"},"gitHead":"7631d1b220323112ce72141784e75c8356ca0f88","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7631d1b220323112ce72141784e75c8356ca0f88/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7631d1b220323112ce72141784e75c8356ca0f88/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7631d1b220323112ce72141784e75c8356ca0f88/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7631d1b220323112ce72141784e75c8356ca0f88/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7631d1b220323112ce72141784e75c8356ca0f88/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7631d1b220323112ce72141784e75c8356ca0f88/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7631d1b220323112ce72141784e75c8356ca0f88/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7631d1b220323112ce72141784e75c8356ca0f88/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.e27ef7cd.0","_nodeVersion":"10.24.0","_npmVersion":"lerna/3.22.1/node@v10.24.0+x64 (linux)","dist":{"integrity":"sha512-V3yMUnmdxOZVHLRftGuRuVXi9clGW3YdzKH1Ry5fe+7gIdWP1hdjKnTvwNPORnTM9ux5UsyWS8r706cLW5gqBw==","shasum":"3d0f618c5386adb288dccfe1110f217f0af08629","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.e27ef7cd.0.tgz","fileCount":13,"unpackedSize":204812,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgY4XpCRA9TVsSAnZWagAAVTkP/3N3/eTq5uA5A6Kb5BgF\nsRzCLBekw6WQ8Ge9UyzlQSNBbnq9TsSQHkCUAGUVBU3J2rzllA+bQ1S3WlJ1\ndJlHaA2i2zh4UaPhbF2KfQZD4IDJAO7lDdA8DdDjCHqY+8AtiaGB21FVv5Do\nVef/LVjPdsUgG3NfY60NIX9a/nrBW1a+G6px8fT5QBh6h9Er99bE3PJhA0Zp\nq4Mbryj/xJxx/jMA5Po1Klzw1tUBxDwXgeWLYUwxWtWhKNlWSlMqJPuTDMQG\nHj+2QCBcuhDngpqzRGtXvAYA+gt3W7hkFjxrxAVFsqNGOmvn/Fuiw0b/fSAF\n4geyGeKeKIYGzsWvf0uPtyyK6i+jr7NT1+7gX6GgqYAL1PznJGrtrlaJs5Vz\nklqVMF55OoRHRd2B+zK1o6o2SD0wADk3WpOFScmnpM5V4ijBWJDm9P8uZmX5\nJOoJs4wAPSQmQl5QnhCr2+WY0joh/cZE5e3roVXvtrpNaw8KlgB/FbGGvHfH\nHgNyAhhlxxOVntZPUef/YAX0F73u1u/ypwjj2QoXYooQCpH3pz802+Ycu94U\nSOIXHZ+2vMmAuY4sTc0oskil/Fu5oDu8hqMF34nwCqIm/Ri7vMaUssoXMAT0\nvHaK02lVlYlB96ozCPbaSnHQL/9h9xOpnUxR4xSG2WHeY6uxmDNOEmK/2i5o\nWPgu\r\n=Clkj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGDck+s062XkMAdOdY3RUyFiQljDavUCGj81YnmFtWZ4AiEAuPpO6GW1ITC2SB7bLtpDkMrkFYAPVUjXyqh3qJ0b284="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.e27ef7cd.0_1617135081310_0.08835599051059684"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.15c09e74.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.15c09e74.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=11.0.0-canary.dc9c84023.0","@material/line-ripple":"=11.0.0-canary.dc9c84023.0","@material/mwc-base":"0.21.0-canary.15c09e74.0","@material/mwc-floating-label":"0.21.0-canary.15c09e74.0","@material/mwc-line-ripple":"0.21.0-canary.15c09e74.0","@material/mwc-notched-outline":"0.21.0-canary.15c09e74.0","@material/textfield":"=11.0.0-canary.dc9c84023.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.15c09e74.0","@material/notched-outline":"=11.0.0-canary.dc9c84023.0","@material/ripple":"=11.0.0-canary.dc9c84023.0","@material/shape":"=11.0.0-canary.dc9c84023.0","@material/theme":"=11.0.0-canary.dc9c84023.0"},"publishConfig":{"access":"public"},"gitHead":"6f3ebc4bb5f04f139f9cc24061e00f418b04ae88","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6f3ebc4bb5f04f139f9cc24061e00f418b04ae88/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6f3ebc4bb5f04f139f9cc24061e00f418b04ae88/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6f3ebc4bb5f04f139f9cc24061e00f418b04ae88/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6f3ebc4bb5f04f139f9cc24061e00f418b04ae88/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6f3ebc4bb5f04f139f9cc24061e00f418b04ae88/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6f3ebc4bb5f04f139f9cc24061e00f418b04ae88/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6f3ebc4bb5f04f139f9cc24061e00f418b04ae88/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6f3ebc4bb5f04f139f9cc24061e00f418b04ae88/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.15c09e74.0","_nodeVersion":"10.24.0","_npmVersion":"lerna/3.22.1/node@v10.24.0+x64 (linux)","dist":{"integrity":"sha512-Z+NaB/ITtZuKSJoLwREzIbRE1LGgwiEDas93eZp1/xN332yiCLvA1++FRErIkOTbinktKPW5nIQM5SADycyrRg==","shasum":"fa606f12abd0d75f577d05f32a5539545e0a01ac","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.15c09e74.0.tgz","fileCount":13,"unpackedSize":204812,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgZKerCRA9TVsSAnZWagAAQq8P/3KkQPXG7CUh4IOW8pdn\n/6L/zLO7TR5hxvwwvrNnVnGXFkTW/4JhXgWDni71oB6q8XJnmkmifQOXUo/d\nSHDSj3RKwX/4mglWe0+uz0oxtqYcIDioA1rDS1exfEvpvCI69aFH8/2dMdTp\nUfNhm8Vb+jHMHMoc21M5hAfa9tmvkCxMi2nVbXfYvTsiJ6ECfFQp1ixrOhCQ\nnyNjnNwgEQR63PHO4/ounK3Djk0KwKeiXiOqZTQgpCgxceNM6x2R8mo0ahYo\nifuDK8n/boZNxEILzwcOwOGqrBTeS1SLqpF/CxlY93TEW4GFIl00BqWmGMMu\n8gmR2ch/CXUsZMbFgCoTbl3MF++BDYZMWOJxqOrVP0+mEemt4yS/GP298VKc\nnyASxppXIlULWrv89zBxYLLKwvZoAAUYsHo69s5fA+8cMWcY8qAygzRzzWHD\nfqQ9J4jJobvKAiDS9y158NMIwUM+z5fAbXZLjfMqxlqY9Zj7zELSLRfiwec/\nR7T6XvTwjhLgTo75gFCR34drGBDViuGhSg5zK34psaLeqvcGl4wSsenlqPeK\n9elfKyTHGpW1TfpjhPDwyW3WzRgRrvM/Dsw7bv0pwt+DbNi5X746w7VgvFeo\nA8gtPw1tVvi6X765zhNX4gQX3rAHRcHNO+RqqAjTeGHu+GW2cMIvNQDF9E37\nvnTc\r\n=Y75z\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGn+LB81t+iUvrCgl6NHDm+UNdcgAxm4BBoIFWl6f+RrAiEAxEYhzyjgvXn2EIgXDaQHIHZiFr8uA5C5PTrgeAlQhmA="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.15c09e74.0_1617209258670_0.4856598710581794"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.4dc32be3.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.4dc32be3.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=11.0.0-canary.dc9c84023.0","@material/line-ripple":"=11.0.0-canary.dc9c84023.0","@material/mwc-base":"0.21.0-canary.4dc32be3.0","@material/mwc-floating-label":"0.21.0-canary.4dc32be3.0","@material/mwc-line-ripple":"0.21.0-canary.4dc32be3.0","@material/mwc-notched-outline":"0.21.0-canary.4dc32be3.0","@material/textfield":"=11.0.0-canary.dc9c84023.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.4dc32be3.0","@material/notched-outline":"=11.0.0-canary.dc9c84023.0","@material/ripple":"=11.0.0-canary.dc9c84023.0","@material/shape":"=11.0.0-canary.dc9c84023.0","@material/theme":"=11.0.0-canary.dc9c84023.0"},"publishConfig":{"access":"public"},"gitHead":"1f71c032815f456f2ddbee58c9b175e65da3c18a","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1f71c032815f456f2ddbee58c9b175e65da3c18a/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1f71c032815f456f2ddbee58c9b175e65da3c18a/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1f71c032815f456f2ddbee58c9b175e65da3c18a/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1f71c032815f456f2ddbee58c9b175e65da3c18a/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1f71c032815f456f2ddbee58c9b175e65da3c18a/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1f71c032815f456f2ddbee58c9b175e65da3c18a/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1f71c032815f456f2ddbee58c9b175e65da3c18a/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1f71c032815f456f2ddbee58c9b175e65da3c18a/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.4dc32be3.0","_nodeVersion":"10.24.0","_npmVersion":"lerna/3.22.1/node@v10.24.0+x64 (linux)","dist":{"integrity":"sha512-PjcICOyJqqNR0UQYBlsZjsO+A63rdZkmPRPYW8nM4EA8ZFCz/nhbQcE8+25wbJJMxwsZxZNzDAK+KGeNuQZSPw==","shasum":"f83d073fab335ee268f2d99ec9cfd222210544b0","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.4dc32be3.0.tgz","fileCount":13,"unpackedSize":204812,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgZQo/CRA9TVsSAnZWagAA+U4P/1YkGmmCGQMPvdd55oxn\nFJSsHY46vYNuy1JwV6slecv1RG7j8oSKlxLBgf/IHx5k/OfL5KVhTvkNo558\n+3q7YmE/yYKATUCVxagGUxvkTVDyjeB6iCQ3NFX8DtCADD4J3AQNDzhYeSjM\n/wgw6m/0nzoS6FUg4R9AhxJQbR6pvgd0KVqXXsNvGcP0JaiqK65MawwZeML1\nMhCPHMLMUn1XDUv2yexJjRVZf2snzSTbyoJfTpwog36EAWyg/ZaTMbRJUs/k\njKfVqCS6cpk7PZTBCmhuKh7B4QkXDZDutuXryDGHB9L9LnRD4mQOllpcZglm\n++bkwDPgHZNIPhsZ3BiYpoou+0Ib7RMPDSUPco9Y6vliQbt1bRvc/pFqXu23\nPOHV3oMRfPbqvVkqbLYIjFTu96MgQ74N6qHjWVdhcES6r2EuzRZMt16XUj3S\nkTFCccOUX8TUUGGeSvuz9LmBmzJdN6ksRMv2Gz/6twqktRJ84pynum4FHeCp\nj2PdYCWodFsBJAQAEDMyQliYx61Z+WpoQAoDY5AZ+ORgFzz+5Q9+i/Hrd8pB\nipTXl3Z4KO6XgUxehREVwVawdCWmj6nEvdB0k+q1sm0ZLkVAnteso5izppDC\nq4P/WRiqKzmfKb1hUy2ZEzsr7deMVF7RV7+4KSkH8WhAC+MpyLzJAfVQH/IE\nOYHb\r\n=dPxd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCuYa5/bL9Z4lMjWWfDq+FCXmbS0l+ljTFVOXIfoC0zeQIhAJ5/1sQrWVTO5Iuvk4+bErBdaixwhFS6cfmPVw/KxU8r"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.4dc32be3.0_1617234494875_0.6669126913718668"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.4b717f65.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.4b717f65.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=11.0.0-canary.24609b822.0","@material/line-ripple":"=11.0.0-canary.24609b822.0","@material/mwc-base":"0.21.0-canary.4b717f65.0","@material/mwc-floating-label":"0.21.0-canary.4b717f65.0","@material/mwc-line-ripple":"0.21.0-canary.4b717f65.0","@material/mwc-notched-outline":"0.21.0-canary.4b717f65.0","@material/textfield":"=11.0.0-canary.24609b822.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.4b717f65.0","@material/notched-outline":"=11.0.0-canary.24609b822.0","@material/ripple":"=11.0.0-canary.24609b822.0","@material/shape":"=11.0.0-canary.24609b822.0","@material/theme":"=11.0.0-canary.24609b822.0"},"publishConfig":{"access":"public"},"gitHead":"a7b21246791a74b1ae4e57975b1f4a394ad9cba4","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a7b21246791a74b1ae4e57975b1f4a394ad9cba4/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a7b21246791a74b1ae4e57975b1f4a394ad9cba4/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a7b21246791a74b1ae4e57975b1f4a394ad9cba4/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a7b21246791a74b1ae4e57975b1f4a394ad9cba4/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a7b21246791a74b1ae4e57975b1f4a394ad9cba4/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a7b21246791a74b1ae4e57975b1f4a394ad9cba4/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a7b21246791a74b1ae4e57975b1f4a394ad9cba4/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a7b21246791a74b1ae4e57975b1f4a394ad9cba4/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.4b717f65.0","_nodeVersion":"10.24.0","_npmVersion":"lerna/3.22.1/node@v10.24.0+x64 (linux)","dist":{"integrity":"sha512-9op2MSpyQXNrS15VxPvXsO0DkDL/BQLM9+9dNq04ZOeLRWc/ZzrI1tR+ycGZg3niIP4rPAyiVHsHXR0rMMAhLA==","shasum":"dc14e6a93e60394874dba6895d2b8497451d365e","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.4b717f65.0.tgz","fileCount":13,"unpackedSize":204812,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgZg2DCRA9TVsSAnZWagAAoxsP/3YI5gGx6arht3y77Epr\nOpJVpauwGKrKphPK8sfLYEZGsSK7O+1GiSAq2MpTfnv97rDppO5C+98BtH5+\nWeSdXXsJdDp1XSq+4eF6HRQ0D0BpJEE0A3cjSx+FnxXt0ba9KxYHHT/wPKcE\ni/h4NqWzXr2bTuQ937XZcCV1jL3eFWRrbyJQ+MFxuwAc/fdC2Cvn5ig7fmzk\nWUHfj7k3TWUTpi/kNeJ62haWfzVmj/MyQk1L/dBphQNhS928HrusHyt8o9S2\npb7imgRgMwWIYbaqluWO5N5GghwoRKO4f5zN0i2husxAuorjjHyMhQF9ge+u\nNE9ysv3WoJUbknFoQkaKr6kAlxxEHQH6hTG41mW2vSBMKv2zFdIOrRndmoZX\n6dqrvCfnxxLng54qJU+Ug9F9yYAJts7wFrMHCoRzGf/m8PHogEuNlQeA8Otb\ndpcNTKN4tJH2FachlW5HO8YfIWx2FisocGoAJ1N+J7bEsGPg+OWsoneixw/M\nwygkrSaoShYWJ3r+Fg4K9Ngr9+c+toG9sKlc29EK5c2TEu54oDlakQgEFv1o\nEmSliGuEaDwh5ErAfA9ID1Bs42UAOuolT08ol+d1nwTML+ggWPTFkXz/s2r+\nqz/Pwx9p/IvO3XUGiRWvGKIbPl1PyFCkIV+ER9ieyQDK1OOOwdh50wPaYAN1\nGmSN\r\n=uODn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDmVnhz2yX01xEGgQWBiGeOSEBZ39Kp+0aC+2XU71G6yAIhAJaDQhur9VuxgM9IjtfbfBB9M8U2U5ysB6JDoDw/lKVA"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.4b717f65.0_1617300867286_0.23850151165088884"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.c6870f20.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.c6870f20.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=11.0.0-canary.24609b822.0","@material/line-ripple":"=11.0.0-canary.24609b822.0","@material/mwc-base":"0.21.0-canary.c6870f20.0","@material/mwc-floating-label":"0.21.0-canary.c6870f20.0","@material/mwc-line-ripple":"0.21.0-canary.c6870f20.0","@material/mwc-notched-outline":"0.21.0-canary.c6870f20.0","@material/textfield":"=11.0.0-canary.24609b822.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.c6870f20.0","@material/notched-outline":"=11.0.0-canary.24609b822.0","@material/ripple":"=11.0.0-canary.24609b822.0","@material/shape":"=11.0.0-canary.24609b822.0","@material/theme":"=11.0.0-canary.24609b822.0"},"publishConfig":{"access":"public"},"gitHead":"5808fd48fe9ee3cfe17f631aa6addaaa847cea19","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5808fd48fe9ee3cfe17f631aa6addaaa847cea19/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5808fd48fe9ee3cfe17f631aa6addaaa847cea19/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5808fd48fe9ee3cfe17f631aa6addaaa847cea19/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5808fd48fe9ee3cfe17f631aa6addaaa847cea19/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5808fd48fe9ee3cfe17f631aa6addaaa847cea19/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5808fd48fe9ee3cfe17f631aa6addaaa847cea19/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5808fd48fe9ee3cfe17f631aa6addaaa847cea19/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5808fd48fe9ee3cfe17f631aa6addaaa847cea19/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.c6870f20.0","_nodeVersion":"10.24.0","_npmVersion":"lerna/3.22.1/node@v10.24.0+x64 (linux)","dist":{"integrity":"sha512-g3oOaaZoOeKTyMMjrqG1eCU+S76UF/TOmtwf99AJ1E5/ZYkoE7HTwi1YfqglVwJHpkgl3MU5giOL8/0FKdjO1Q==","shasum":"ab2e29f729a9316f4fcda1e66cc377b6ff3b350a","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.c6870f20.0.tgz","fileCount":13,"unpackedSize":204812,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgZlpOCRA9TVsSAnZWagAAjuQP/iiybvxvaPWpA70QovoU\nNO6fAFWourrSgVl/tAKhYAXUk5aQVz+DJ7GSM3ddR2NzwTHQTEuwDbXdjIu6\nBkDIm5vKruY7K/TlMopUVXg4vjNPBXD5x+57tVsRvx6HsaMAFlPswnROJ2Q1\nsN9C1PWMsGh0gsOSGihoKbrH6Yua2BqZ/2IameNxtThvZAS3TMu5X7jiO6cO\nwRqKnp2ZMLUUBwixLRWoAS/LCqWEQWza1qKy8ITlLWwwaSqEIDFmVhMSEjhS\nx/hI4mQQPOfzJDUjuzJyBR2Y9gfKZN6qfprID/hnuE3tTyha1gL59kxmQnp+\nRMDhm9kSUEuC8bfU6tZN4g7Rkw3kc5SJQQVwM7xbmcgbg+3vhUB9b+VZnfcR\n8bbjaiqnREvX/9U8t84etv0RlkoFMVsRBdPb820G0QFG0+hMm4k2dVdboBb7\nwJsz5jI+HonTe0ilXhaAKAli7FkQOVNNcAlWKyaOGwULp7YcLwDzBYMgicIj\niGdKsw4InFy2njShIx50vF3FF/v/JBCdqaY5C+/k526PYqNrFGYagbvzV2Pg\nKN20/XLR6Qsp+AgdsDdNd6q0yONOK5CFvovddJHOsFwusPjYUiGygQSfM0KF\nxsG29luUxqELoGbb+yhwFMpe9/kqQAqJMqDS+BEWm7bMQmyRUlJ9YzVM64hA\nQrIt\r\n=G2Zl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDjTJkjzEbECkQ6UQjYTWV7xcmg7qMF0U7U+e+JcB96+AiBSd3zCJ683siBOsGQDpyaC8Z4PFzptaS7F/UbMWNdLVA=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.c6870f20.0_1617320526203_0.3352567240665443"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.852f873c.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.852f873c.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=11.0.0-canary.24609b822.0","@material/line-ripple":"=11.0.0-canary.24609b822.0","@material/mwc-base":"0.21.0-canary.852f873c.0","@material/mwc-floating-label":"0.21.0-canary.852f873c.0","@material/mwc-line-ripple":"0.21.0-canary.852f873c.0","@material/mwc-notched-outline":"0.21.0-canary.852f873c.0","@material/textfield":"=11.0.0-canary.24609b822.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.852f873c.0","@material/notched-outline":"=11.0.0-canary.24609b822.0","@material/ripple":"=11.0.0-canary.24609b822.0","@material/shape":"=11.0.0-canary.24609b822.0","@material/theme":"=11.0.0-canary.24609b822.0"},"publishConfig":{"access":"public"},"gitHead":"f528b03c675bb05baf871766e103e6e35c28e203","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f528b03c675bb05baf871766e103e6e35c28e203/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f528b03c675bb05baf871766e103e6e35c28e203/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f528b03c675bb05baf871766e103e6e35c28e203/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f528b03c675bb05baf871766e103e6e35c28e203/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f528b03c675bb05baf871766e103e6e35c28e203/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f528b03c675bb05baf871766e103e6e35c28e203/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f528b03c675bb05baf871766e103e6e35c28e203/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f528b03c675bb05baf871766e103e6e35c28e203/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.852f873c.0","_nodeVersion":"10.24.0","_npmVersion":"lerna/3.22.1/node@v10.24.0+x64 (linux)","dist":{"integrity":"sha512-2A7EgTOms1I/5oLHBUIny4RMO957LV0UAQ/Lr++FHOkW4M6czMWeXRP4kjWSss8eZ2S7aIFthKuPuqRjh8Paww==","shasum":"2f75d2e3697fc5cabe1bb5a98f5e2947f7554f2f","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.852f873c.0.tgz","fileCount":13,"unpackedSize":204812,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgZqoBCRA9TVsSAnZWagAAl1QP+QGmPPCPOpxsKGGbzhQH\ns7cFCxpOXr0DYOK5VviNEXTITWLU515Z9dsgB0FA6ZJHdydpYGOk0GrMvF4b\nZ/n0YyYWvKfCEd8bgM5HDczaAsH1168XLNsyACh+77RXZ3DW/1IuahJe/D9p\nq0Z8mOlQBJMs8WRp/f7OS0oSQ26az9MyC9ggy8rkWew2w6jFO8daxEIi8NsW\ng7G+oJaSOIT6QZ7tDdBd6uIUK7KpXF/pkCiYplnrMFpFwCYmoCvV/phRyB6m\n//TQooTkPi6NK/xKXpNzw1AN69h5e1uCTHNgOwa3ZK6Be6Dh82zNyn+5OcVc\nYR+Z6h+n1CPeoPf6q3Oaf5ZMURgV5VbIIOtpRDIFwPtbhUM7kBsUkTH+jDUh\npB45rRXmOwznqMhd+i1ZSmj7tDUpnF4IxiQ49suHaYKrIWwVqJzMy6d9tK3o\np0ROgD0OZDJ1nacCGWPNXgnenW4NbLM0Cp/GeUBKl5KZkQNREb2OSm9YZ46u\nGFKFgT6rKJQ7QpcLRnD5ri/YkfyDMDDDAFI/F53jC8RpZlktkDaca4SSwd4P\n1moV6FVi1iQKYKveBo/TAxzsnolFJwoRSubT/2AyivwZ6yXQdFL/xANc+89/\nupqCHIC2fxwIlxbJWn/TuZYHM9hoWuuCEUZjgCPxfQvMLl+R9R9roi8rhQzM\nFxty\r\n=o838\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFyLdKjIUMM7umimp/HFvXySkG0hDiIFiNhsh8olgtNAAiBmR0bR+A+CC476uV2BkN1nQVwBoihJ5b4n0RR66c+8CA=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.852f873c.0_1617340929131_0.05602775886731748"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.4a674a1d.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.4a674a1d.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=11.0.0-canary.24609b822.0","@material/line-ripple":"=11.0.0-canary.24609b822.0","@material/mwc-base":"0.21.0-canary.4a674a1d.0","@material/mwc-floating-label":"0.21.0-canary.4a674a1d.0","@material/mwc-line-ripple":"0.21.0-canary.4a674a1d.0","@material/mwc-notched-outline":"0.21.0-canary.4a674a1d.0","@material/textfield":"=11.0.0-canary.24609b822.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.4a674a1d.0","@material/notched-outline":"=11.0.0-canary.24609b822.0","@material/ripple":"=11.0.0-canary.24609b822.0","@material/shape":"=11.0.0-canary.24609b822.0","@material/theme":"=11.0.0-canary.24609b822.0"},"publishConfig":{"access":"public"},"gitHead":"d4f9464090813f45495113dfd52201f8c86bab3f","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d4f9464090813f45495113dfd52201f8c86bab3f/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d4f9464090813f45495113dfd52201f8c86bab3f/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d4f9464090813f45495113dfd52201f8c86bab3f/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d4f9464090813f45495113dfd52201f8c86bab3f/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d4f9464090813f45495113dfd52201f8c86bab3f/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d4f9464090813f45495113dfd52201f8c86bab3f/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d4f9464090813f45495113dfd52201f8c86bab3f/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d4f9464090813f45495113dfd52201f8c86bab3f/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.4a674a1d.0","_nodeVersion":"10.24.0","_npmVersion":"lerna/3.22.1/node@v10.24.0+x64 (linux)","dist":{"integrity":"sha512-hSRuwTQtKm2mqq00ZgUPdDklFxOCMCaykRil8Ik9qv1xZbhGBZlmR315DCwgLkAKgaBqGsVcmEgzM8wVi2uA7Q==","shasum":"bb258a6214b3612d3421442b4838de8953a9b206","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.4a674a1d.0.tgz","fileCount":13,"unpackedSize":204812,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgZy3GCRA9TVsSAnZWagAApR4P/A2jfsuoUwKq+DUcP/Dr\nEIqBMwKpXFfowFblIWGmjB4heJRu4lV7GA3YVCGfQPPZBcHdQlMGUsustYW0\nWGho5lWTEzNkbg3CgAgK56EcVb+i9D1D5d19h3GsDz3R9ElCQpPwin48uUfb\nqTYNUzm07ddEurzOdDxzESIbi4MQY5+JY2nJn/7wIh/MVfwMiXLhWKfayBof\nECE5XQvpAVmmRJEY42+3lcdR/fh/tWtgDAsUkLBWPjjmR5YnFUCKALdFfu7k\nqilhXR0U3kzA9EnS2e5ShtmtJgTwFH7r1EyO2+qN8vQYi0s4IYxBbwQzj/+9\nWW7ubklrSeKs5uEQIWVOpOXH5uMcDBksliKF5flcRczdqsZj0dnIoeDqFf44\n6ijOo6Tc07O3afJ5EG2LxPoNFNJWJejZfMKimph82EBFTOqgF7/yNCwspvPa\n6z7DTgVFAR4FVwtyFzjQzAoZ2UuRbxPdD3H2thKWLrYXqBQvmYfvOa9kJjAl\nTWpZYn3p2yXqecKxarY0Wt4INzF3JRxahL6WG/6xP2+knAhshyMro6ZXDF1o\npvt+DQgJA5iUK4RNM/G0/2qqX5Mn5gnDouGmswXOXX61nuA0Cpk47YBNhrQF\nFxMSRfiTfLH5bHRKXUr1h3W0OAwbDJAxV68pmOFWzAy8qv20IKLW08DjUzmb\nat/F\r\n=h2v2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDSx+OfpQl6pBW/xd4LJeesPn34veTOv3Dtuk0S6p+gUwIhANSta9YeTJbqOj54WJ1O2p3HBuiAbUlTiiNWrFqw4W8F"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.4a674a1d.0_1617374661588_0.6507508200509413"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.c5b29ff1.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.c5b29ff1.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=11.0.0-canary.24609b822.0","@material/line-ripple":"=11.0.0-canary.24609b822.0","@material/mwc-base":"0.21.0-canary.c5b29ff1.0","@material/mwc-floating-label":"0.21.0-canary.c5b29ff1.0","@material/mwc-line-ripple":"0.21.0-canary.c5b29ff1.0","@material/mwc-notched-outline":"0.21.0-canary.c5b29ff1.0","@material/textfield":"=11.0.0-canary.24609b822.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.c5b29ff1.0","@material/notched-outline":"=11.0.0-canary.24609b822.0","@material/ripple":"=11.0.0-canary.24609b822.0","@material/shape":"=11.0.0-canary.24609b822.0","@material/theme":"=11.0.0-canary.24609b822.0"},"publishConfig":{"access":"public"},"gitHead":"c1604e99ccbc76c92a4371c529c43a4997f78c3e","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c1604e99ccbc76c92a4371c529c43a4997f78c3e/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c1604e99ccbc76c92a4371c529c43a4997f78c3e/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c1604e99ccbc76c92a4371c529c43a4997f78c3e/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c1604e99ccbc76c92a4371c529c43a4997f78c3e/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c1604e99ccbc76c92a4371c529c43a4997f78c3e/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c1604e99ccbc76c92a4371c529c43a4997f78c3e/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c1604e99ccbc76c92a4371c529c43a4997f78c3e/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c1604e99ccbc76c92a4371c529c43a4997f78c3e/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.c5b29ff1.0","_nodeVersion":"10.24.0","_npmVersion":"lerna/3.22.1/node@v10.24.0+x64 (linux)","dist":{"integrity":"sha512-2lmU+I9JsY9WT0xD8euTLemnxPFJi9FnVjk7wpjg9x08ZJz2kOTmOfvIJ6tikMGy7px9NeVh/1DxT43pAihEXg==","shasum":"dff723a6b5e8c5457cdbc07d66bfd9692acf3c38","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.c5b29ff1.0.tgz","fileCount":13,"unpackedSize":204812,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJga03ICRA9TVsSAnZWagAA/1MQAI59MxIo37kb3iVI1zpI\n5IOVDIW/qdHT+09XRfXFqCmGhsZ0qIKnONUXEOGaziwdgDVZZ9Xt+nV3/qYM\n2Q4YYzQF3uFijPnGzj5U7QYbtMaRitVHF/D1L/O5VtS5rnlJJeKMAlLakTtk\nzwwrCtT9FS4sSUkJx8toxVFb7B2v0OU6a4DyuiyiNBHmChcWFNaYkarksqO9\n/OO/u18MTp6/r4r4hxt+CfDlelNEkez9wrepVB1p5QWwHj/M8P3dRHMuR6Qu\nfJaArOYPVfuHDhWdaJv9XEaHR5/sHBIv2/pcYefCWmI2N5bjwDjxluNze9xB\nHdSCttwKrJCc5ppCKwiw0x7HYPCQVkALfg/73PE3R3DqZHySRtdj5fbITGfI\n3sUQp/9lud3Wa5CHSpdsO/qfFh4FJajQa82L1hEP4i8RDrtXxTRDknQIpK7f\n4zBUm5NTll4Dt+pNTC1YhfVHwJeCd5x3Z7V2J7h8Jy6D4AonoB/yQ+hBIPkP\nkNqsvKm7vIkgAH7+L/3NpzV+qkjbEqnke1Z+0z0Y+KJdK0ZU5rPuV+GeyDhi\nVaK341fxDYz4DxbROeKIr2JGgd4pENC6e9d7wHo0nMuY4a9sXbMqMj7Xn7NS\n/jkWiwrsDLXT5/J1GZ0YO6eo9YU5UYPb0oxkH83d5eCqZ+F47+mA0EWpmhJA\nPleS\r\n=pEnH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQChRgiHqM8MRv5OU1lfETOonohrIiByqxpWWyYaPc6G0wIgEEOiu1cPjguI8wABqfv9sR6EKAc/JEqcEASXAtRzrIo="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.c5b29ff1.0_1617644999712_0.535655632141939"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.583644a6.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.583644a6.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=11.0.0-canary.94f50b260.0","@material/line-ripple":"=11.0.0-canary.94f50b260.0","@material/mwc-base":"0.21.0-canary.583644a6.0","@material/mwc-floating-label":"0.21.0-canary.583644a6.0","@material/mwc-line-ripple":"0.21.0-canary.583644a6.0","@material/mwc-notched-outline":"0.21.0-canary.583644a6.0","@material/textfield":"=11.0.0-canary.94f50b260.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.583644a6.0","@material/notched-outline":"=11.0.0-canary.94f50b260.0","@material/ripple":"=11.0.0-canary.94f50b260.0","@material/shape":"=11.0.0-canary.94f50b260.0","@material/theme":"=11.0.0-canary.94f50b260.0"},"publishConfig":{"access":"public"},"gitHead":"bf2f1c715105004d3849ec66e044434d48e08296","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bf2f1c715105004d3849ec66e044434d48e08296/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bf2f1c715105004d3849ec66e044434d48e08296/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bf2f1c715105004d3849ec66e044434d48e08296/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bf2f1c715105004d3849ec66e044434d48e08296/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bf2f1c715105004d3849ec66e044434d48e08296/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bf2f1c715105004d3849ec66e044434d48e08296/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bf2f1c715105004d3849ec66e044434d48e08296/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bf2f1c715105004d3849ec66e044434d48e08296/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.583644a6.0","_nodeVersion":"10.24.0","_npmVersion":"lerna/3.22.1/node@v10.24.0+x64 (linux)","dist":{"integrity":"sha512-JzZWV9Hx9PGjGHXBwMSMnZ7kAxdko+EbkfTK1C4u0B7mxUuFRnN3pnBXsH5AcZceyzhwvy7MKWvq8bf/qq2tTQ==","shasum":"515358026732548210cd539627be66de387471d1","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.583644a6.0.tgz","fileCount":13,"unpackedSize":204812,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJga04JCRA9TVsSAnZWagAAA0YQAJU9+lms3dP7ndRIgsIu\nYIy6qYz9Zseoy1jnDuBXTWQM4hIrlobUOXuAY5Re+jBYQYkbQRy0jAL0j3u+\nmdfQ+yNBRqtGXk/UI4s4WQtuQ2Jw1c5GduuKBbRF/OQnmXU/9GK1dGWOORdP\n7HjjA6CRVllLnrxaMaLhUizwCNwJ9jFg0YYCnciZwTtqFGXxDSTYOdJ/IIKu\n8LGc5qm045mYwEtT+P7rFEDJAn939fyJLOWNLfXolMkxqwwoSLX59nqcrq/N\n5iYckEAZEeAPtbQHXx/83HT5K+3vWA4uTykko7AXxl/VypWLF/H8ek8nOwrB\nQpPJFiAAOGEhDexQ20Q5DCprYSr/hFJATEO26bmzEJmdPo4UqQ9+sgxkKNYM\ntuHhmJUSNDEDRCoknPVrpCy8aJyM5ETDcYjX7TnjUzE5UM2VnFHl2j1ewQ2h\nujhqQa+imrNsEl21W6qTSss3QcgamESeaWmSHwc8Cu6a50cXeFhq/JbmpgTQ\nxxDhoK7S7Pc/8B60CUcJEUfycnJg3/16v0Z1XJvflhwY0z8zFkVsNIgEXKmx\n+JSYr7WkVoOine8vW7iTyYOn71QYMCX07UgBveJwHYRmT0X5jvIli8MWVvBQ\nSyfMDmP16xt0BsHE9jaVhTAZZZC95clUZPSWyMfEkfnf3+zr4CX7Sx3PnGhM\nGD4/\r\n=1bjD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCuWqcrFTZJOmIqVFrR6GJkjhs9Ed+gC63FdI4IMDm3EwIhAJUSiJgzMj91CRyc5I1TMevseX1acEN5pHqMOmoh5rrM"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.583644a6.0_1617645065054_0.24407292188480612"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.02ac1e6b.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.02ac1e6b.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=11.0.0-canary.15604bd0d.0","@material/line-ripple":"=11.0.0-canary.15604bd0d.0","@material/mwc-base":"0.21.0-canary.02ac1e6b.0","@material/mwc-floating-label":"0.21.0-canary.02ac1e6b.0","@material/mwc-line-ripple":"0.21.0-canary.02ac1e6b.0","@material/mwc-notched-outline":"0.21.0-canary.02ac1e6b.0","@material/textfield":"=11.0.0-canary.15604bd0d.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.02ac1e6b.0","@material/notched-outline":"=11.0.0-canary.15604bd0d.0","@material/ripple":"=11.0.0-canary.15604bd0d.0","@material/shape":"=11.0.0-canary.15604bd0d.0","@material/theme":"=11.0.0-canary.15604bd0d.0"},"publishConfig":{"access":"public"},"gitHead":"c6e525b215b6043eb042d3feb1f6066bd536bd94","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c6e525b215b6043eb042d3feb1f6066bd536bd94/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c6e525b215b6043eb042d3feb1f6066bd536bd94/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c6e525b215b6043eb042d3feb1f6066bd536bd94/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c6e525b215b6043eb042d3feb1f6066bd536bd94/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c6e525b215b6043eb042d3feb1f6066bd536bd94/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c6e525b215b6043eb042d3feb1f6066bd536bd94/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c6e525b215b6043eb042d3feb1f6066bd536bd94/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c6e525b215b6043eb042d3feb1f6066bd536bd94/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.02ac1e6b.0","_nodeVersion":"10.24.0","_npmVersion":"lerna/3.22.1/node@v10.24.0+x64 (linux)","dist":{"integrity":"sha512-44BC8E6XxE1EESGcM4jO/YIZ8KLvLVVSZdYhDn/ADFytJrbwGvVUOWrEhKHGUv1oEwvYvaLOu5uqL3Ki6qohDA==","shasum":"aeaff6d370ee974e1fb2896870c9eaf70baaf4e5","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.02ac1e6b.0.tgz","fileCount":13,"unpackedSize":204812,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgbKolCRA9TVsSAnZWagAAoGQQAIPIT2RrdOZDWDQS6NsQ\nDCWvh7ks51yJJzgWZ4GEZjtowmFydw2a4exyadU7c4qIGQP4iMOoMxxUzmZn\ntUr8KyVPRmhaMOW+Z+zMOcK/waklJpRfRGITZJvY3CXXz5Xcu7IZzq0L8Ctm\nwoyT7X+IsFx2Kq0R7jiNm0H+Btlm3VAlaOIt/Azkhb3RvPrVSe4Xf2IkBpK+\na8oZT5NGTlGyUjaEkgi5fs86huv7dUtOG2B51jqsDta78dZeBwcV5acxQEMu\nRgfzhr66d44nkaCrRoXVZ+hPmcSlnIZFJNYMtY+f7nQJVAKgbxL3PyCJ8Q/n\nM9Xln3cf1km2qUk4KyId/Aq/6ljNvomXisBTcVLWpytKNpG5G4KGVhL6M1yC\nHkpYoG19X5aCBtd6PkKYyygNcST9FwuPH4+yNv1MRy5K/wL8jQcEUXWCtRzZ\nMfNQBswFAnAIiipD8fX7Cx3wN6by6ny+ywKFD08ORGz0yD61lg6pa/Yu7KEx\nutV3V+DSpaotTto6L/3jqJAtXv5AvI8urzNN/o/+R9t0KpCLhFBB/hwFxF9H\nos8v3ubc1KG7UTchcC1vIQzZZ9eDVNbFzSPZmDsTzQOYeXaeDJ2eGsjnCKQr\naqXYCA1bVpBnJm+PLV3p3Nah3bRPF2iQ4rdXqUgQ8hp/5PJjxZDvE3wSJUxE\n2JtY\r\n=hivd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDBG7lhMSVqouEV7RZW2zKs6it0KQyZox5AIKDCUNh+9AiEAslIigiJBK2iZxELFOaVwyiT7fS7Ng5OpK1o8+OA9CVU="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.02ac1e6b.0_1617734180976_0.6650940965312773"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.5ac5856e.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.5ac5856e.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=11.0.0-canary.15604bd0d.0","@material/line-ripple":"=11.0.0-canary.15604bd0d.0","@material/mwc-base":"0.21.0-canary.5ac5856e.0","@material/mwc-floating-label":"0.21.0-canary.5ac5856e.0","@material/mwc-line-ripple":"0.21.0-canary.5ac5856e.0","@material/mwc-notched-outline":"0.21.0-canary.5ac5856e.0","@material/textfield":"=11.0.0-canary.15604bd0d.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.5ac5856e.0","@material/notched-outline":"=11.0.0-canary.15604bd0d.0","@material/ripple":"=11.0.0-canary.15604bd0d.0","@material/shape":"=11.0.0-canary.15604bd0d.0","@material/theme":"=11.0.0-canary.15604bd0d.0"},"publishConfig":{"access":"public"},"gitHead":"66f695ff77b118469a93aac22c76e5e558c242a7","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/66f695ff77b118469a93aac22c76e5e558c242a7/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/66f695ff77b118469a93aac22c76e5e558c242a7/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/66f695ff77b118469a93aac22c76e5e558c242a7/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/66f695ff77b118469a93aac22c76e5e558c242a7/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/66f695ff77b118469a93aac22c76e5e558c242a7/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/66f695ff77b118469a93aac22c76e5e558c242a7/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/66f695ff77b118469a93aac22c76e5e558c242a7/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/66f695ff77b118469a93aac22c76e5e558c242a7/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.5ac5856e.0","_nodeVersion":"10.24.0","_npmVersion":"lerna/3.22.1/node@v10.24.0+x64 (linux)","dist":{"integrity":"sha512-br4Lp0Ac5nxLOJEhbzN706bMjnlr070/ldG4QXLkQcb+QPYVuKl75kpb0T1EVzwiom2x2J7klk7IfdJVahDmHg==","shasum":"9799118668061856e3f6930869e966aed2dcc587","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.5ac5856e.0.tgz","fileCount":13,"unpackedSize":204812,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgbKufCRA9TVsSAnZWagAAMfgP/2+IiKiiwxD5BLoZOg5o\nQ7XCZyvJi2CGB3tXw7aZPSGJSYy4o+w6lYwtfZHsnAmTzMoHbAYpsr2z22UC\nm4B+7lgtsKbfUwtjb7AlVqoqMXmJff6c1pHCB7G4joaRdz2FFVtYD+psFGY6\nZzR2f+ISfUoTvWE655EIFBh+LF610x8opE4lSUKDjx80kQgymzV+lEvJaiK2\nPCHtr6SpKAzGB5T0pFLG4vrjfzLNfWk/VfqGUQgUo/P72HlY9Xf4kzf+f1lq\nvjJOR4HNJZXkb6lbVN4y0glOfEGE532RLxNvUcMK0Q/upvNyswku1HEeyTag\niEb6/KL00zuT10VyrckqfvvpzXo8ISKwFtf+35qE4L0fy8yilKYzFk83K6I6\nBBXFpXZ/eQ6VEPysHM0/9IDDzrKDewYVYdnJwp6xj504MSeTR874vxcgXqOl\nGosZCTJgg7Tz7Ovdh/CltzGI6cVh7fIOQMy2mH4lyV4OGPaUMfBIN5YbsPjP\nitkSkD0ZCe+qJix9Wn4J99JG+UIEdbIg+0KZURPD4ODzzJLuBZoQKi/0DD9/\ncPDMQdD1GbbTNvgu6dUqlWFFp8KPdcaXOrsekxX/PwYpsv4RC9IctkMaX4Ys\n4AdK9GLXRdwhcfxSRi6kx4+cFc9tzJnL2tOMT3sWFalkmL2I0x//BsB4fFO/\nYfwf\r\n=L7wq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEJwdK+e40d6YBb+UFMoKr+nSwts2rr1O33bc4IYbBZGAiAjM+2IWTcbrPvhdVn+RUtM7mPVgcIU0uRzWbGONezG/g=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.5ac5856e.0_1617734559122_0.2821908345968833"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.bb23dbc4.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.bb23dbc4.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=11.0.0-canary.15604bd0d.0","@material/line-ripple":"=11.0.0-canary.15604bd0d.0","@material/mwc-base":"0.21.0-canary.bb23dbc4.0","@material/mwc-floating-label":"0.21.0-canary.bb23dbc4.0","@material/mwc-line-ripple":"0.21.0-canary.bb23dbc4.0","@material/mwc-notched-outline":"0.21.0-canary.bb23dbc4.0","@material/textfield":"=11.0.0-canary.15604bd0d.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.bb23dbc4.0","@material/notched-outline":"=11.0.0-canary.15604bd0d.0","@material/ripple":"=11.0.0-canary.15604bd0d.0","@material/shape":"=11.0.0-canary.15604bd0d.0","@material/theme":"=11.0.0-canary.15604bd0d.0"},"publishConfig":{"access":"public"},"gitHead":"42e5f906ec61897cd0de7e0e19e686d807408d70","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/42e5f906ec61897cd0de7e0e19e686d807408d70/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/42e5f906ec61897cd0de7e0e19e686d807408d70/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/42e5f906ec61897cd0de7e0e19e686d807408d70/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/42e5f906ec61897cd0de7e0e19e686d807408d70/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/42e5f906ec61897cd0de7e0e19e686d807408d70/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/42e5f906ec61897cd0de7e0e19e686d807408d70/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/42e5f906ec61897cd0de7e0e19e686d807408d70/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/42e5f906ec61897cd0de7e0e19e686d807408d70/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.bb23dbc4.0","_nodeVersion":"10.24.0","_npmVersion":"lerna/3.22.1/node@v10.24.0+x64 (linux)","dist":{"integrity":"sha512-GNU/Qqb8an+MiD6vFJVCTjHu4jDFD5YOyG0Ipsql1lS6xOh4o1S8k/ZXMCHjwlIkAfBLYUCf2UBKSIFQ21FOew==","shasum":"390de1a9a6659009e9256beb5f4be49e5ab3682b","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.bb23dbc4.0.tgz","fileCount":13,"unpackedSize":204812,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgbiLmCRA9TVsSAnZWagAAul4P/jrIoNL04dZe14cpAdNC\nTduYUVhEBViOxOvTU094H2iPATzJhOZeSoO4Wz1BUBRNAPHchd7Vw5QmdcF9\npQU0vbBF0wEQeYXIO2d7m0TXnj/z+tnH9VkcxRee3CXKxFmWkeW+ARD+Ze/5\nYXJuuinSgYaV53m4Ir+mPSscH0ja6l/yIeCHBY1gXAyW+AaZMseMFXFUKniw\nHJ4FUKaFpUd6d7C9ZzvrwBX2ly0hytY0Ulw8PBc3ofP8XZGLHkKwfvtYravE\nt274y1Un8k9RLfQMvcFvPz1muMjm9RuLCnC3rUDjeU4RYn01NUWTwZXbjV3V\nzraGa5COXBVLpvP2QeN7JD1wYoEZRB+OhETZE8WHEsPv8yu52zO8F8i487IJ\nZ9E/7rEC3fAxoMB8HDJcREXgEMZQsFlF7QvWlqTlhozdlpwJrn1PIMf4k0lL\nGCR1Op5RjWTwTe8G+0fMx5VPhyAseaNqNz8uOl05ZuYWrKawueJW+dfiuY4n\nwWZ9Itt6ICFvPPWRCcvr1sQ0TMF2vvceCxQUwxmlvlsD+6fUqj84dadBLtCT\n2pNgYvdwY7O4vojbOGEwlpDJkZ33YnvZ4ivOTYH7uul+Nvr54ss8az4NWQR3\nFiGc5AdZ6Dj55ubDMJ16p0j7QsZXoymiLzOyvP2gvUUnji/v9gXc3OC9SlJQ\n1A9X\r\n=m9Cu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDpSv443ZqxiZDMuua5fSQ4fawPN7Y+/7/u02dbDQ5EGQIgKjFde4chdaqRfi1KhVjxgrYQ5Z1FiOiRdRkQSJ2jLJ0="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.bb23dbc4.0_1617830629544_0.8076441379208936"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.e539904c.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.e539904c.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=11.0.0-canary.c91e8d141.0","@material/line-ripple":"=11.0.0-canary.c91e8d141.0","@material/mwc-base":"0.21.0-canary.e539904c.0","@material/mwc-floating-label":"0.21.0-canary.e539904c.0","@material/mwc-line-ripple":"0.21.0-canary.e539904c.0","@material/mwc-notched-outline":"0.21.0-canary.e539904c.0","@material/textfield":"=11.0.0-canary.c91e8d141.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.e539904c.0","@material/notched-outline":"=11.0.0-canary.c91e8d141.0","@material/ripple":"=11.0.0-canary.c91e8d141.0","@material/shape":"=11.0.0-canary.c91e8d141.0","@material/theme":"=11.0.0-canary.c91e8d141.0"},"publishConfig":{"access":"public"},"gitHead":"0522583b3f6a950dde45ae308718f06d90d40a84","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0522583b3f6a950dde45ae308718f06d90d40a84/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0522583b3f6a950dde45ae308718f06d90d40a84/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0522583b3f6a950dde45ae308718f06d90d40a84/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0522583b3f6a950dde45ae308718f06d90d40a84/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0522583b3f6a950dde45ae308718f06d90d40a84/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0522583b3f6a950dde45ae308718f06d90d40a84/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0522583b3f6a950dde45ae308718f06d90d40a84/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0522583b3f6a950dde45ae308718f06d90d40a84/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.e539904c.0","_nodeVersion":"10.24.0","_npmVersion":"lerna/3.22.1/node@v10.24.0+x64 (linux)","dist":{"integrity":"sha512-VaHPAYbU9QCDJzdTc1sQKJqbNDYrHQCX8o7+cNIxN6Y2XgCBhlvUHCertrPV0ll+C9wYR6j3ILAaf+HRzqwh6A==","shasum":"2b949c27806f17866d44c831086c10431faa2c2e","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.e539904c.0.tgz","fileCount":13,"unpackedSize":204812,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgb0UZCRA9TVsSAnZWagAAOd0P/izHWMkiJODAF0sk3Hfj\ngTE2hFe+GcD2u0xImJ3BhRDvzDCBl7AUc5+XdX8FsicST3h4yxadE15dpxl0\ne8xLBactngPWDr6m8aCuwWRgL8NLnVj8bhFcX0ZGeB+Lw+/cl7zQhyPz1BMd\nvtTN1HCoXdBgG3l+mZoQHeuzQm2vER7Qd1v54aItSs00Y1RZgmPQUiN6DeqK\nEmzSEtAVa2qwoL+CPcnbzsSU0DMkC6dE7/o86CrQMN8atr3+Ys5xfyKmBhfA\nke3j95/nWB+/JeWMOnEO6XLYuIVrRdnb4ZXYL5KDz5xk8HT5l0Ig9srYzd8M\nwOTzIpo4s+dZuAVQ5cb3ocddrG1jKCU1PVv9arbppXJxjA0IaUv/oXM7MdEJ\nwLEVsU6H7w7dETg07Yk9KNAd5gGqiizTpoPcDjv+/TwHTlrTuuaQ+aqtnMBT\nlnrWJzfuLU3LdyeYbcvd9RKsiwX3KgCI9iOaY5ovn7TSIu8MiwgDxkG7Z9n1\nqTnq5I9yH0hEVXqpmyvPWN9KbaqZZ/oSuO5/oSoqE6o+N8IXA9adpQfsmOCr\nEgEGBfpo/H1PEIjOMV8HLPsjhqS3Ma18Te6f2rKus5qqdtzSNCbS4R515yki\nPs20qg9UJv6Ir/CILvj0nUy8+SAgE4K6/pQ5VeyRwKALt6w+okaG7PL4qGd8\nUI0X\r\n=Bsmw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH4UJWasaiqq8LzGYfkw5zGiOmKSmWrrTMXxFXQ/TgUKAiEAq/Af2vDvepH1XMSzD1tK3im5e5e7NCKeIlDEmTFLUvg="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.e539904c.0_1617904920600_0.3490968802786778"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.a93ae333.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.a93ae333.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=11.0.0-canary.b2fa996a1.0","@material/line-ripple":"=11.0.0-canary.b2fa996a1.0","@material/mwc-base":"0.21.0-canary.a93ae333.0","@material/mwc-floating-label":"0.21.0-canary.a93ae333.0","@material/mwc-line-ripple":"0.21.0-canary.a93ae333.0","@material/mwc-notched-outline":"0.21.0-canary.a93ae333.0","@material/textfield":"=11.0.0-canary.b2fa996a1.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.a93ae333.0","@material/notched-outline":"=11.0.0-canary.b2fa996a1.0","@material/ripple":"=11.0.0-canary.b2fa996a1.0","@material/shape":"=11.0.0-canary.b2fa996a1.0","@material/theme":"=11.0.0-canary.b2fa996a1.0"},"publishConfig":{"access":"public"},"gitHead":"31a1d0d94dbc7ba9d8611ebd62d41024f6fa88bb","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/31a1d0d94dbc7ba9d8611ebd62d41024f6fa88bb/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/31a1d0d94dbc7ba9d8611ebd62d41024f6fa88bb/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/31a1d0d94dbc7ba9d8611ebd62d41024f6fa88bb/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/31a1d0d94dbc7ba9d8611ebd62d41024f6fa88bb/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/31a1d0d94dbc7ba9d8611ebd62d41024f6fa88bb/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/31a1d0d94dbc7ba9d8611ebd62d41024f6fa88bb/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/31a1d0d94dbc7ba9d8611ebd62d41024f6fa88bb/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/31a1d0d94dbc7ba9d8611ebd62d41024f6fa88bb/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.a93ae333.0","_nodeVersion":"10.24.0","_npmVersion":"lerna/3.22.1/node@v10.24.0+x64 (linux)","dist":{"integrity":"sha512-WHKF5pR+vtou3DLdNhmN20XmYe3CHJm7zC9Yqwqex4UyQ0McxTCmYJQcVFkwHeLwr9ixeGCxiEyAjYTRRab8cg==","shasum":"fe0dd778fa34756dbf216b58107844362424dd30","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.a93ae333.0.tgz","fileCount":13,"unpackedSize":204852,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgcLTwCRA9TVsSAnZWagAA8XsP/R9sdLsfrCdsQ+WEtTfL\nhBritwsed+jxuZn4GB9U2S7KjO8ving0zIUvgPrCnh7pZFji7hIqN85FMZpv\nNP3YohsaywZzEtxOoqx4sP+jgdGOcOnRopFokb1KRt7Z8kWczA6EEHXnx9t5\nDji8QiNUXurk9mfptVITt98XArJ2YD0C/RNQX0uZDbMrnKCYMuQb8F1k0GIQ\nSIOa28bCUpW6/n6X4xqmZneQdTKiMfUdhSgMm60zlqo+iZ/FAZUx3DDK5J1F\nXhm6NZc2cEDNZWnSiOTi1WOI1BeeqDGqmlXVivCAnQfcZPKalSE4Ig01mgPX\nAWici2FVvj+5//I5QzI4MrNhAE/nlDEyMJ7jhX2FNsW6VtAamQVjT3yMN4O0\nJHq4IHj8qjCeyFQ5tA39Xbg6vRdn7zC6QPy5jql3k5DCescmsSfl7QVzn6QP\nox9bZsBWOPmnupnKEo3X7A+BhwNhuoMvfPaes/tIuD9yfd9IVzi7u3sx8I91\nz8ujPIIoIzXjfB9HBce/nqIqUZno4u6+BUvRcBQy70lC1yIew5DUHzHyk8c2\nuTA0jhi6NMUmR+FvmHejkwuPA24+jFUr6W7BVK+GgBrwuTkNPaBxhGsd6KpZ\nK/oWgnsNJxmxEsdz1S6Q6KwnY/r6A8tKtRSK1TQCHLPTQL4GMXrAIFdJtEP1\nyw1Y\r\n=devw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCg52ZflE9HaIK4etvxv2teePVFFFABNwPPFjb0M56FEwIgdFsNKFJZ/m63o/eh0iuU4KcFdVWWYk9esAzeuxDL+m8="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.a93ae333.0_1617999088357_0.31447578892174977"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.e142c144.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.e142c144.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=11.0.0-canary.b2fa996a1.0","@material/line-ripple":"=11.0.0-canary.b2fa996a1.0","@material/mwc-base":"0.21.0-canary.e142c144.0","@material/mwc-floating-label":"0.21.0-canary.e142c144.0","@material/mwc-line-ripple":"0.21.0-canary.e142c144.0","@material/mwc-notched-outline":"0.21.0-canary.e142c144.0","@material/textfield":"=11.0.0-canary.b2fa996a1.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.e142c144.0","@material/notched-outline":"=11.0.0-canary.b2fa996a1.0","@material/ripple":"=11.0.0-canary.b2fa996a1.0","@material/shape":"=11.0.0-canary.b2fa996a1.0","@material/theme":"=11.0.0-canary.b2fa996a1.0"},"publishConfig":{"access":"public"},"gitHead":"135f2f0e24347fef74904a437124ccf8978e20b3","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/135f2f0e24347fef74904a437124ccf8978e20b3/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/135f2f0e24347fef74904a437124ccf8978e20b3/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/135f2f0e24347fef74904a437124ccf8978e20b3/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/135f2f0e24347fef74904a437124ccf8978e20b3/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/135f2f0e24347fef74904a437124ccf8978e20b3/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/135f2f0e24347fef74904a437124ccf8978e20b3/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/135f2f0e24347fef74904a437124ccf8978e20b3/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/135f2f0e24347fef74904a437124ccf8978e20b3/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.e142c144.0","_nodeVersion":"10.24.0","_npmVersion":"lerna/3.22.1/node@v10.24.0+x64 (linux)","dist":{"integrity":"sha512-/qh55bcLi21pfC7G+yFlJoTLmiiXIXW8Sb4LG3vepvNv69hewDFq5wGpxWFwbvFWwDn2nYLu8Wh1bwWo5P8+sQ==","shasum":"018eb3da71048593512f9a8b8a895c84f43bfa2c","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.e142c144.0.tgz","fileCount":13,"unpackedSize":204852,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgdF48CRA9TVsSAnZWagAANhMP/0/5pVXwjZgO1s516VGm\nd4YoEPVt2mdJIcx8iXLmpKSmd9rBVox8NgH92hu5vYRSxwpkKSMe1fSQ7LbB\nztP5Zy61gVnto5hxBfto5Fm1I5vMfewNPtz8Lt/16zOsAIEHgQBZmagXZeBa\n9cjyuLTAoVyeZqA2WPftKdHA18eFMVJ295I3NO643ReTObnGPPYUjsdSRWLT\nMXpmOmBOzO45Hax/GHcT8e+rW8TXSrWKWYa2qadt/A9EzSijaQ1wI/IN389n\nAkH/G7FiqA8smSzY2HpGvd42xblpj3Tzv0rk3uUtwbZVlS8E/Ixg2qToy8FR\nDAOBRHA9Ju5GijQUe+Jh8UGS16JS007Cb7js5+c/d8rXVkImqz3COEYW5mN4\nUxtNS7Bq9M/fHb6CPRODq4boGMfYGQqkXy1Y9m9FFsetM/2aM/ejQkTHt2HS\nW4Q4rxpLa4mjLE2Alc6z0BWtkogcB6saOfKE0/jS1wLEB/P6uZxlT1lR4Q3o\neQgfFzjTXGtKeKW08KvWa84xz0g4jupN/+No0xDn+bHggIQ+cbpMXcpp6QV/\nP0ve/cf+P6XmXKj9BPLrcONXxRJS1cAO62Y5KZZ7u8XhsL9qOG5xzMX2Zxhk\n0fWcvN2na9pgWUn/FTSXu/WZ4aT1iUTZ9DmhZ9PDRDGlBO6mjMryUUPd0Sa1\nin5t\r\n=ACm0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBdesxhphi0lqTGuzHSL8yUaVBMhV8RWsxZMJfIqR3tbAiEAuiLzCZ4fi55O7eQSPyrPIm4XVd1pjLrQa3QaZY8f8Hg="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.e142c144.0_1618239036179_0.6082631227995756"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.382d7eb0.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.382d7eb0.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=11.0.0-canary.b2fa996a1.0","@material/line-ripple":"=11.0.0-canary.b2fa996a1.0","@material/mwc-base":"0.21.0-canary.382d7eb0.0","@material/mwc-floating-label":"0.21.0-canary.382d7eb0.0","@material/mwc-line-ripple":"0.21.0-canary.382d7eb0.0","@material/mwc-notched-outline":"0.21.0-canary.382d7eb0.0","@material/textfield":"=11.0.0-canary.b2fa996a1.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.382d7eb0.0","@material/notched-outline":"=11.0.0-canary.b2fa996a1.0","@material/ripple":"=11.0.0-canary.b2fa996a1.0","@material/shape":"=11.0.0-canary.b2fa996a1.0","@material/theme":"=11.0.0-canary.b2fa996a1.0"},"publishConfig":{"access":"public"},"gitHead":"22f558ec852007036c1b01f2d052ff4512cfb420","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/22f558ec852007036c1b01f2d052ff4512cfb420/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/22f558ec852007036c1b01f2d052ff4512cfb420/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/22f558ec852007036c1b01f2d052ff4512cfb420/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/22f558ec852007036c1b01f2d052ff4512cfb420/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/22f558ec852007036c1b01f2d052ff4512cfb420/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/22f558ec852007036c1b01f2d052ff4512cfb420/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/22f558ec852007036c1b01f2d052ff4512cfb420/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/22f558ec852007036c1b01f2d052ff4512cfb420/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.382d7eb0.0","_nodeVersion":"10.24.0","_npmVersion":"lerna/3.22.1/node@v10.24.0+x64 (linux)","dist":{"integrity":"sha512-4TbKAznKHUhNDqDsnPhxu5le+CUEpIbfqKwhdShJB+sSsymwVbrS93qrFFoPOoGEC+TkLPBLj1uiYlKqyd/xbA==","shasum":"d7fa74f154748cd1ab2a12411eabc62556596b39","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.382d7eb0.0.tgz","fileCount":13,"unpackedSize":204852,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgdMQpCRA9TVsSAnZWagAA4oYQAJ1masXH0B5M+MEWqRP6\nRDkfTL8ZehatJNuIiyWjTgQj8ycQcH24JBOWM3mY38vg4tZyt4oG8QCDYNwN\nOMBi51BhGG3GEX+1pDAfCJFTyFXAdMZSN6kqZwmTbPTrAoE7jf1b257EO79y\ngbJiXYixfGlD+od96+W1VaTJ8iK4h9Cg4nE5mEjB5FH1CwxHRgauE5A5WgdK\nf+nHRPmsQ7xvVYOa9B+FD9tQoOg8Q127UDau2TEkO1WMHpXg0QFSAF+xyYek\nfNOUsc2AKUkce1u5v5ae8QHACGXCDEkDY9hsgBvjg4QG297UBIDv69JgPfp6\njIvSFAOLqNZHDuGNIee0x9ZzGH8BnnlkhjleMVJDAHXft/lzTEc/tSrFJNGA\nTI8VETC+cdhagQMFpeL9ZH8Xc735NPuDRP3lTzyYLBQK9eitGw9etiQK6MjR\nWEqev/zY4w29oSiMGIIcTmS2bM3sumb0MbpIzNnwGJ9ufBmkUcRjeosJINZq\ngCxlRACLijqsZNSqa2kUgpfwNLXuONPeYtsbjGoHcjwi9pSbPvNbLkrfi/ZB\nQhdZA9jzIPXyYGDjaep0IRCoMI5Y/wGM1Td/IXY2wscBmsWia8KemXiBpED4\n124WKpxpZd2m3dZeApsGQUjO+boPdd8CsDSgqnhO+RiQCUMf7qqYokPqIOPx\nbmVb\r\n=a04X\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDlmBXp6dOdMtftkPxNozXg9B0TrfYJDoXE9VkPF4LR5AiEAq6D0ohim99Hf+Ndd1R88oBXZHkzliMeSPkFURYtq2Eo="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.382d7eb0.0_1618265128913_0.22395141190469658"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.b16c7885.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.b16c7885.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=11.0.0-canary.352b295c1.0","@material/line-ripple":"=11.0.0-canary.352b295c1.0","@material/mwc-base":"0.21.0-canary.b16c7885.0","@material/mwc-floating-label":"0.21.0-canary.b16c7885.0","@material/mwc-line-ripple":"0.21.0-canary.b16c7885.0","@material/mwc-notched-outline":"0.21.0-canary.b16c7885.0","@material/textfield":"=11.0.0-canary.352b295c1.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.b16c7885.0","@material/notched-outline":"=11.0.0-canary.352b295c1.0","@material/ripple":"=11.0.0-canary.352b295c1.0","@material/shape":"=11.0.0-canary.352b295c1.0","@material/theme":"=11.0.0-canary.352b295c1.0"},"publishConfig":{"access":"public"},"gitHead":"effabeb19d8128aa03c36be651c6b4eb98d15e9a","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/effabeb19d8128aa03c36be651c6b4eb98d15e9a/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/effabeb19d8128aa03c36be651c6b4eb98d15e9a/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/effabeb19d8128aa03c36be651c6b4eb98d15e9a/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/effabeb19d8128aa03c36be651c6b4eb98d15e9a/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/effabeb19d8128aa03c36be651c6b4eb98d15e9a/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/effabeb19d8128aa03c36be651c6b4eb98d15e9a/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/effabeb19d8128aa03c36be651c6b4eb98d15e9a/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/effabeb19d8128aa03c36be651c6b4eb98d15e9a/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.b16c7885.0","_nodeVersion":"10.24.0","_npmVersion":"lerna/3.22.1/node@v10.24.0+x64 (linux)","dist":{"integrity":"sha512-q/6e2abph3he0CrITnxQobmgDRsGID7XC3UpdMhaeU0fG0QSrIsbKZYElvoM7yAa+crUrRsNDEyXicz4nUWHlA==","shasum":"3af768e51cb837e435f971c113d9c2e7cb18dd60","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.b16c7885.0.tgz","fileCount":13,"unpackedSize":204852,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgdMwNCRA9TVsSAnZWagAAitUQAKEV8cwaapgEOR4hPF/v\ntnendf9CIzIArsrAb9jUUNLZN8aLR5M+F6ATfVGHhg5BHzjGVjOpVuKQerPs\nMKbgXmJtwMVhNvnmbOlkuiDsDLYb/Ster7A2fACrsSaF9oV208hljaUlVTTO\nDAsxHYPTap2b+RTs2EWtziw0A9w45fe1n7TA9ef2/Ibb1gl3JrQBpFAhpqXA\nysIjvevnamEgk4mEVzzd/xoboMAWssauI1eTcsAAP/6ssQvG99Nwmc6fqKKv\nlYMHyTBYXuD1iRgTm5u9jW+ONtth61rLJpjA6pyw4ETc8rW8clvA5ZKFoA6Y\nfNJ/WuvlzF6/V+3fAro9dyZL+KWaY6ykRxuIZW8PFdIdRDgbaLIA3u+bXNgk\nzg0MK0y+mqyAbYbBnQszTgVwiFceBVSYPuadITckvH8oGANdq9bmSsP1yHAT\nUuiOdC79U+SogUsPGRapyF8IVP7XGXU0kwqRdbJ1vxhJCiv19KgH9lvD/h70\nrLdAOsJwdC1fKOjw3iSTMXF1+T9q5vq34+fwLIjOVYnPIUNYS8bh2ceEsPIR\nupoSaQ7v94c5L7Y8JneQTM1XJHHeidHsUHdUvq4ARK2RoKK5+oKDo9ghvsB/\nuqbgO5+IqKSnTiTikvC5IFztLOirafUH16OFXYdJs+hgZfa49xtM6UuUfXUp\n/8lt\r\n=jOdh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD8ZQ3hAqcp+iX2CGKbA8ZMtdaMC8MZR9ZBY3b32Mkj3QIgPQULdQHSJxb16T3LTzpLemke1kx+7zzpF7HoKEWESN4="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.b16c7885.0_1618267149180_0.9061323344093781"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.0e92782b.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.0e92782b.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=11.0.0-canary.352b295c1.0","@material/line-ripple":"=11.0.0-canary.352b295c1.0","@material/mwc-base":"0.21.0-canary.0e92782b.0","@material/mwc-floating-label":"0.21.0-canary.0e92782b.0","@material/mwc-line-ripple":"0.21.0-canary.0e92782b.0","@material/mwc-notched-outline":"0.21.0-canary.0e92782b.0","@material/textfield":"=11.0.0-canary.352b295c1.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.0e92782b.0","@material/notched-outline":"=11.0.0-canary.352b295c1.0","@material/ripple":"=11.0.0-canary.352b295c1.0","@material/shape":"=11.0.0-canary.352b295c1.0","@material/theme":"=11.0.0-canary.352b295c1.0"},"publishConfig":{"access":"public"},"gitHead":"7c46ee6728f96c896cbcb981be39309e7fd3f60b","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7c46ee6728f96c896cbcb981be39309e7fd3f60b/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7c46ee6728f96c896cbcb981be39309e7fd3f60b/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7c46ee6728f96c896cbcb981be39309e7fd3f60b/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7c46ee6728f96c896cbcb981be39309e7fd3f60b/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7c46ee6728f96c896cbcb981be39309e7fd3f60b/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7c46ee6728f96c896cbcb981be39309e7fd3f60b/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7c46ee6728f96c896cbcb981be39309e7fd3f60b/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7c46ee6728f96c896cbcb981be39309e7fd3f60b/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.0e92782b.0","_nodeVersion":"10.24.0","_npmVersion":"lerna/3.22.1/node@v10.24.0+x64 (linux)","dist":{"integrity":"sha512-Pi4Hxz+nXANFM91ek9twNblwEm61NnNt3kbF3VjzXP6RyV94DZlEupzn6VfiEVYrWU0BIqQB99zV/J6bFDPlgw==","shasum":"de366b49a402bbbea591d4953d6ab4aae78e88ba","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.0e92782b.0.tgz","fileCount":13,"unpackedSize":204852,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgda2vCRA9TVsSAnZWagAAGxIQAIALH98fHyMuCEy9mpB4\nQDQmZ7P2PiR4jlrvg+1VaZA8DluPoq1i9Z0Susj5jlx5hHv/ooNPSvZwx5Az\njJJLyL+gOdQKOWe8dEjB01wtMxD+j7bwz/fS/Bwt17VPjWqnUXJjFxbZdL7e\n/xo3zxzjHr9ZQO6r5zOUX0r6bdLisVbcS6e8RN1r/PDK6KpGsDn5QOYtIWov\nVYxjpXpMakNfvhnpX3k6IRpPiJnRe6Aki50xuu5XxikCUUYPjS59T2obTnTF\n2rJsFUtuditN47h7SoehdSXco6kCs1F6WadgeOd+Xv+DuCXJSqycLyrjUyYh\nZ2sggell2RvCtj37xzHO4P772jwh+B6lHSaB5VM+bUXxxDK8i+mHVohBDCSs\n/S4Nqn5EuFQvB0AQUktMZFz/40z1SXrNkPp1pfUTsG0z9bhXDLJzYptDXWC8\nhnw1q4M7d2ioTetQcnKwhJbTJyD9gNLIfkQwEAsDUsH2fi8gqoGm5sP0NJn6\nyXIC7W1xTJhbCHKzEDpCQssQMqzaj8QBCzDzg20NJ5oBSRj0XPdLNoy2pqxS\nbGgpjGsMOdW5bVP7xdaifjR3pbzUhV0eMlQtvWZ65/UWAYcGBmAW/E5Qdv90\nEKF9BEm+t+z1/K/1R2KOpFIuAM/NmD0212sTofe64n/2lUUw8bHEOVdIGIAQ\njeLd\r\n=ZZpN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIADIY0cPrpWiHxr6buO/0ZxUnkWgRsXy4Ekj1mSqk2z6AiEAxVnBjRm5P9k+P+cpaULBxEQqwPpoBoR/J1K2JPBRmwM="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.0e92782b.0_1618324911209_0.7298394829556598"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.70b3a072.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.70b3a072.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=11.0.0-canary.352b295c1.0","@material/line-ripple":"=11.0.0-canary.352b295c1.0","@material/mwc-base":"0.21.0-canary.70b3a072.0","@material/mwc-floating-label":"0.21.0-canary.70b3a072.0","@material/mwc-line-ripple":"0.21.0-canary.70b3a072.0","@material/mwc-notched-outline":"0.21.0-canary.70b3a072.0","@material/textfield":"=11.0.0-canary.352b295c1.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.70b3a072.0","@material/notched-outline":"=11.0.0-canary.352b295c1.0","@material/ripple":"=11.0.0-canary.352b295c1.0","@material/shape":"=11.0.0-canary.352b295c1.0","@material/theme":"=11.0.0-canary.352b295c1.0"},"publishConfig":{"access":"public"},"gitHead":"12958287de673f6ce0eb511950c61be3d1a28235","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/12958287de673f6ce0eb511950c61be3d1a28235/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/12958287de673f6ce0eb511950c61be3d1a28235/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/12958287de673f6ce0eb511950c61be3d1a28235/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/12958287de673f6ce0eb511950c61be3d1a28235/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/12958287de673f6ce0eb511950c61be3d1a28235/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/12958287de673f6ce0eb511950c61be3d1a28235/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/12958287de673f6ce0eb511950c61be3d1a28235/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/12958287de673f6ce0eb511950c61be3d1a28235/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.70b3a072.0","_nodeVersion":"10.24.0","_npmVersion":"lerna/3.22.1/node@v10.24.0+x64 (linux)","dist":{"integrity":"sha512-Ek7ULBgOrzS4wJ1hyqvLhvzsTzsDjPi1/sh92MV3/SuxtXeBZzY0IV6yJcS7Mz3QO1l/b0AHhAj5YJyYDhyR5g==","shasum":"ca40720b3e700abfc6e937e7adc6eb31c083c555","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.70b3a072.0.tgz","fileCount":13,"unpackedSize":204852,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgd2wHCRA9TVsSAnZWagAAhowP/ijJuFkIouCmR3Q8wX8V\nERKKnISs4M32r56hThhxeNX2er0ugg7zZKdQ4HfXnxXkawTekaU72NEytKCI\nhFlpOYbyGWpS1AfkT886YK+XPvx4BkzhIUzM8SU8VQDjl8j/o3xe4L9rSxvn\nY/jSzQKmIY/LO+ZTpxe5q0VvTewlcfwsKy96rrTd67MImbIOmvQq8Hul+JwP\nKxnTjpQVFnTEJVUGtZx9Q1D994LQTmBZewwLZzVSAdQXv8H0CEsLM6hNEGrU\nlcIkVOCJ4qYvHOXDda9VEacHmkcj1Xb8svmS0fzk0gKPyCEKuwrACKGPdWgp\nI1plQ8E2Gnr5MSMyLKtbAkyNcgOk+elJyOfNCJY8oUijB54Hw0Hu0wnJ0Tne\nkyfcrln3CWmSSHsbT9IZ586EaZ0WnMj0N5Y7kvdd0sdFeMeWT9GJAKnWOn/J\n2b8XFnN088tM5iphUvVgZC5n7EHih+UVu0WqPv56Iyv2UBOHPw23AJKvkBpm\nHbkh2w5tefFJtQK8iQod9IFF4NKXMFITisqvhRrBfpTSH69PNqFBClhNsm1T\nvwXya5HuihNtug7uvZwwtuFFPoQDNzjUxSLrPqYZ1zVnZUgQPNpMDAABt67D\nv8DGZtw2Sx3CJIF+F7XPZmJUIeCdRhBuqLXNiSVK7a/K6pIGVvjgVwpVD7Mn\nQBQA\r\n=u2Lm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEMeArhjXsoDNx7OnQDdh4cCSKrMAZH4XKVidfIb+4BvAiEArZ8ZavIpwzfa0bWUFGCG0jlx31JoRBeRImLDTeyR5G0="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.70b3a072.0_1618439175146_0.18597777006229554"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.ff79b092.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.ff79b092.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=11.0.0-canary.3793a3143.0","@material/line-ripple":"=11.0.0-canary.3793a3143.0","@material/mwc-base":"0.21.0-canary.ff79b092.0","@material/mwc-floating-label":"0.21.0-canary.ff79b092.0","@material/mwc-line-ripple":"0.21.0-canary.ff79b092.0","@material/mwc-notched-outline":"0.21.0-canary.ff79b092.0","@material/textfield":"=11.0.0-canary.3793a3143.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.ff79b092.0","@material/notched-outline":"=11.0.0-canary.3793a3143.0","@material/ripple":"=11.0.0-canary.3793a3143.0","@material/shape":"=11.0.0-canary.3793a3143.0","@material/theme":"=11.0.0-canary.3793a3143.0"},"publishConfig":{"access":"public"},"gitHead":"88513d2e247534891581014622ab048f4f2c52cf","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/88513d2e247534891581014622ab048f4f2c52cf/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/88513d2e247534891581014622ab048f4f2c52cf/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/88513d2e247534891581014622ab048f4f2c52cf/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/88513d2e247534891581014622ab048f4f2c52cf/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/88513d2e247534891581014622ab048f4f2c52cf/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/88513d2e247534891581014622ab048f4f2c52cf/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/88513d2e247534891581014622ab048f4f2c52cf/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/88513d2e247534891581014622ab048f4f2c52cf/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.ff79b092.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-8cMUe5TSExtyq6een/rgw/jJz7DKnkqQcKes5/E/1Oz9m0A7PoRGBlMTM5uHz08G4Jq+82HMRSyMUkTx1xyXBQ==","shasum":"15772309927f28aad84f69dc53459faefa34ffdd","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.ff79b092.0.tgz","fileCount":13,"unpackedSize":204852,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgeI0pCRA9TVsSAnZWagAAthQP/1qBBIx7PAhupDA/hssa\npTNw/9rpNMYwMTGDJmDy92iP9sxUbXSiCa2cwbdQaW+neKOIRx5TEmcavE3l\n5prWoPadBvuNWqpVqbcjAE9OzPv1IcJbwm163qUlA7Ldkbp1Fh6WG5w1Hleg\nBNUNQbRQpD0fWG61vjnlw8e8e52QYKdgZBBCS3srTF0k21CPJxctPTJ9gTFS\nGQ4XYCnBsyGYsapyJEtmCVxSMYAWI2fuK3NAv9HpVz4S528NaLqzpY7dti0U\nX0h2UqPSdG5IZOp2D47QI4/iKCca5bmnCJIelbqHwQmp1vmm8JXJd/LCCj4+\nmCwD0Qc/tPnNqQvC5AjU3wNGyQmV2htCCS80EJP1KTGpoFG4F32Tv7imz9HP\ntVh+BvGWLXwg5aNs63FInEEUFzxWletM+rtDokFre3iXBINAJvkFjfEcrSlQ\nnHYdAEHRvW3UM/AqjWmslSCG5V/5Gk0LrtwiboxI9hYQpas3VhROeMWP64tr\nibwf/9w2PFPC7MNfkXRkkjQa+PFsJv5rr1Hlcbv6N92YQCZdwQElZiV7Tp/G\nqDojzHdAykjt5ASNUU4rXsAf4ZxOljg/TvHT9dsWtuH6LwxOihByZRAFUiIu\nvt8CCtfxY6Ah2/zc+2aWgLIJxAUFKe+L4N6cEYeE2uQcbAHxhZyCvIgz3H9K\nVvQ9\r\n=Hosb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBl7qoFtZA0q48GIPIaH+SmNsi9NNaiIKQ2UdMLY62snAiEAuHQJvJU8vqyHMu7vqWAcYnxTkpvZuDYyCj8CXcuUNos="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.ff79b092.0_1618513193282_0.49439056481539456"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.f35b2fd7.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.f35b2fd7.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=11.0.0-canary.3793a3143.0","@material/line-ripple":"=11.0.0-canary.3793a3143.0","@material/mwc-base":"0.21.0-canary.f35b2fd7.0","@material/mwc-floating-label":"0.21.0-canary.f35b2fd7.0","@material/mwc-line-ripple":"0.21.0-canary.f35b2fd7.0","@material/mwc-notched-outline":"0.21.0-canary.f35b2fd7.0","@material/textfield":"=11.0.0-canary.3793a3143.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.f35b2fd7.0","@material/notched-outline":"=11.0.0-canary.3793a3143.0","@material/ripple":"=11.0.0-canary.3793a3143.0","@material/shape":"=11.0.0-canary.3793a3143.0","@material/theme":"=11.0.0-canary.3793a3143.0"},"publishConfig":{"access":"public"},"gitHead":"2b12bd76b8558ed1f827fb23b46af6854b404f91","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2b12bd76b8558ed1f827fb23b46af6854b404f91/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2b12bd76b8558ed1f827fb23b46af6854b404f91/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2b12bd76b8558ed1f827fb23b46af6854b404f91/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2b12bd76b8558ed1f827fb23b46af6854b404f91/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2b12bd76b8558ed1f827fb23b46af6854b404f91/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2b12bd76b8558ed1f827fb23b46af6854b404f91/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2b12bd76b8558ed1f827fb23b46af6854b404f91/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2b12bd76b8558ed1f827fb23b46af6854b404f91/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.f35b2fd7.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-1bAT81thLyllBHHT7ww1KIv/0USluylB7OFobVupWb+OWJaNFqRB2gEf4Wkm6o7WdzNvEa/xeJC0C+lWIz/qHw==","shasum":"22a1844b606d85c41863dc95ea056aee6e60331e","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.f35b2fd7.0.tgz","fileCount":13,"unpackedSize":204852,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgeI+bCRA9TVsSAnZWagAA9cUP+wXpvW8kcXTixZDD6DQJ\nVfa+y0JQWi9W6sS41WYX2EVeZOObeeb1AMgWj34Qaw6o+Ll5a5QjErU57cOM\nPqC1Nd6xj/H2KRNymsmO9WlGTRoPr7Fxqmxb543U5//n1H9pZ3mF9RLR8NSS\nS0C2oN01aoPkIWuIKSubWmhRmJGWABVn3JqcwUMiT5DWzjlXAOBE2vG1GvrH\nojmT9LIF08wuymOk4JEazZJ9XPAtKk2qimdieWfnIrjMc1jSAGGPednxNQsJ\nFDehQUSZdxv3Ir2Hhb93vtCul8GJkuUCPW5N3CaMCt2AeP9DOZT1zuoEhd0N\nzqL0fFmMtSlqKLN7Rn+0vEEqLcw3x6JQJznCiSnMrBmOe4eiy9DDIPG1+pp2\n3MDD4APw5NgCcFpi1nDAnN2MJm2RXMh/KT5H5CuWxqVPyHXNPHeOmKHCNW7z\nSDg3gbX9dLPcbuMa1Cmssf2NiWn8pRLqc3MrlItNMUVSb4C2rW3o+xwR7lIb\nBzlCBTvx30UFsijHPwvHtP2j3imIPFn7Yzqlp209cWkcyOMaRYjcpyGo9uNB\nRNi5dq3HtUnNLc1Rq8MRSFMNgNAVYzugvAWboxIcxRMCZWpnhHbzimG8bTdw\nIVQgRkxIJV6yrDSIxtjWEO9cRr9Z9Uzt4gxv+bN16py/hsvvvRFYbsEkzT0N\n1Rn8\r\n=Amzt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCjjZQQHyLUs01FehTmOU3dfgEIROdRk5WWsNkpBKFZKwIgXWmyBPJlEOajAxCbGkzjB1Sl3ZeLREj2qMLn/y3Qtmc="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.f35b2fd7.0_1618513819389_0.5299290918587614"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.11977cac.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.11977cac.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.3f342c3f4.0","@material/line-ripple":"=12.0.0-canary.3f342c3f4.0","@material/mwc-base":"0.21.0-canary.11977cac.0","@material/mwc-floating-label":"0.21.0-canary.11977cac.0","@material/mwc-line-ripple":"0.21.0-canary.11977cac.0","@material/mwc-notched-outline":"0.21.0-canary.11977cac.0","@material/textfield":"=12.0.0-canary.3f342c3f4.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.11977cac.0","@material/notched-outline":"=12.0.0-canary.3f342c3f4.0","@material/ripple":"=12.0.0-canary.3f342c3f4.0","@material/shape":"=12.0.0-canary.3f342c3f4.0","@material/theme":"=12.0.0-canary.3f342c3f4.0"},"publishConfig":{"access":"public"},"gitHead":"30cf21833b011fd8946bd6853a20341579b79c96","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/30cf21833b011fd8946bd6853a20341579b79c96/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/30cf21833b011fd8946bd6853a20341579b79c96/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/30cf21833b011fd8946bd6853a20341579b79c96/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/30cf21833b011fd8946bd6853a20341579b79c96/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/30cf21833b011fd8946bd6853a20341579b79c96/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/30cf21833b011fd8946bd6853a20341579b79c96/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/30cf21833b011fd8946bd6853a20341579b79c96/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/30cf21833b011fd8946bd6853a20341579b79c96/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.11977cac.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-bgKoPRKPNWs8q87XyfPA7AIgYo9OmbxFtmnB8YVV6IfJ0H6H4moQhOls4Uo6ezzLFG+GI584Q0QXyAAX0dwefA==","shasum":"ef68d42e1f1f515feac4063306082ccc1ba769e4","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.11977cac.0.tgz","fileCount":13,"unpackedSize":204852,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgeOEaCRA9TVsSAnZWagAAkKYP/2Wcs86vMhoxaBlZObGA\nvBmw1Rb6EfFadT/Mjy8eI+iUQwOuRDpDaq+TyJnLq4IdSYGRyFUxVRt6Mo0c\niFlqxAz/WJP1JWoxff9VZDs2yhwba4ngxFCVpKgtPLrNMENZwSUiBLr3ba8P\nR98BWoOJGBU6IbOBp5KSmswbgEB43vLxzs5ExYhlUK/0QWJOnDPdVu8Bhgi9\nQ5BfZi61BuIJaX+SELXFoJLV4yRytQg0AogJxQPYonwuDTw24V+JSGLvALZL\nTeU+st1TLejw4/9Sn+DMHas7zDrKMkqvmXKs1PB6uh8d0r0gbkK46pCz4cDZ\nl48n8wQygq/K2VvvIVsIIOu32bqGpY3qZu5oBAGueMqDdk3pnQru7JMbheE8\nyNUMura7hSFv+mofK6JZYeyx9oCZ5+Pxs/l29o7UGAHl3cuE+BYjDnJ8XngZ\ncSizyw4D61x4N/cePPbSZ3D0mhLfDq01ZtBin/OQZv0oM6QNkyW9ZDMlTi39\nSh5sFhz5toQZPzeCleNkS01eNaBiakhOMg6oNZYxaXcQo85vHA9Hya3nQUYB\n6nOgLCQrYNh4mmwdml5sCm3K4UYwj+MQOAXjupHWoHK1JyMptb/5Uq5Shiby\n30pMziBM/2rQBHdrz1Cc9HS8u3NBe1uNWanJWikbEh/b8pxn6H5cwiyPlRAx\nQGwo\r\n=z9+/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC2fU5dBYSuaJHxTLt3+ZVRxM93rypZNTp+5zAIYaAd8wIgA3yCIU9Cb3PaIxSLT8Tl3sZaQKuCS95nKRpq35QiYiw="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.11977cac.0_1618534681730_0.838130809634692"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.018ff45e.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.018ff45e.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.cad489689.0","@material/line-ripple":"=12.0.0-canary.cad489689.0","@material/mwc-base":"0.21.0-canary.018ff45e.0","@material/mwc-floating-label":"0.21.0-canary.018ff45e.0","@material/mwc-line-ripple":"0.21.0-canary.018ff45e.0","@material/mwc-notched-outline":"0.21.0-canary.018ff45e.0","@material/textfield":"=12.0.0-canary.cad489689.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.018ff45e.0","@material/notched-outline":"=12.0.0-canary.cad489689.0","@material/ripple":"=12.0.0-canary.cad489689.0","@material/shape":"=12.0.0-canary.cad489689.0","@material/theme":"=12.0.0-canary.cad489689.0"},"publishConfig":{"access":"public"},"gitHead":"4ac1a4ee2a06e36457a8412629422eeaa91183b6","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4ac1a4ee2a06e36457a8412629422eeaa91183b6/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4ac1a4ee2a06e36457a8412629422eeaa91183b6/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4ac1a4ee2a06e36457a8412629422eeaa91183b6/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4ac1a4ee2a06e36457a8412629422eeaa91183b6/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4ac1a4ee2a06e36457a8412629422eeaa91183b6/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4ac1a4ee2a06e36457a8412629422eeaa91183b6/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4ac1a4ee2a06e36457a8412629422eeaa91183b6/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4ac1a4ee2a06e36457a8412629422eeaa91183b6/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.018ff45e.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-gCXNYyOrti1PKMhQ1rL9KLUc/rgglAWJtUPszPy0BZWUHGYf92k2jLB1F77E5tqQ6uz9Fg4VxowJap++e2biDA==","shasum":"786f5c0bca3f70eb966826ff7a18b0ea30b14d11","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.018ff45e.0.tgz","fileCount":13,"unpackedSize":204852,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJggf3TCRA9TVsSAnZWagAAm90QAJIKDkQI0kl1ugJDUrb3\n39KEotQZ+l+gcdbH9QYMA8riMZxvPf/zLdUqRbAVJvdZhrZ2X/5KRweMJqbC\nHOSYabBWPD1/7rg0veETo5iFWEwjpsHlxcx3KpeJGcqPeuuTWy1wH97p9sAW\n/Q1QXx8qS95DUHnjmMTZ9qD3er2h28rFwjRKOQzmGVx3/pfmDwEd9XvTgbm1\nTjJODk//U1Ts2joVffuNLs632bCIfTO5BatXjwhygMCaXyiT4u86d3KXx4n5\nlyrrPxDpnDFCMNF9vLYkUs9uVjkwHIfJ7DF+pq7FLt9+1IqSRu252HxfOpI7\nK16NylpV70M/mbY06B2C2ePh7bQt3SgbrrGdr+/ohaeVBdWZPS3P5ofoT2Xe\n5PHTaQZYclr5mRrNXG9svqYGX7tv9YMxV5CMDYoAzx11ijzKV8FozLjxQkuZ\nwxDOvIEEWO84JjwR4NCqGX6fUyhRhSma80reP577KvFCnZlfOio1/bMugmZx\n9Uq+6kdpcoUo4xiljWPALXkiCeYrUIhBON9+0YJ08/O95jMMZyuV85LwIhjw\nAAsMIg7471dozxnoAzxQDySB63DbE852Ug+OjnqHtvfumSMkxP9TRgO6CcmM\nxTkiFxSg22P4R9XBgQggAlwjDv2aU+ZEoX2KRF3K/mHy2Ex7Xr4ZJch+R9zl\nA8Kk\r\n=j6gx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDYyU8hKafU8WGuRFpjR6M/ziOUXm4fLmrboIj3pS/hugIgVSPsPrQ+41Ni4U4l3crjSami5Z+bb3hq/fcgQS/Cf4Q="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.018ff45e.0_1619131858919_0.0037288170267455456"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.c99d1fa5.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.c99d1fa5.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.197f64fa2.0","@material/line-ripple":"=12.0.0-canary.197f64fa2.0","@material/mwc-base":"0.21.0-canary.c99d1fa5.0","@material/mwc-floating-label":"0.21.0-canary.c99d1fa5.0","@material/mwc-line-ripple":"0.21.0-canary.c99d1fa5.0","@material/mwc-notched-outline":"0.21.0-canary.c99d1fa5.0","@material/textfield":"=12.0.0-canary.197f64fa2.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.c99d1fa5.0","@material/notched-outline":"=12.0.0-canary.197f64fa2.0","@material/ripple":"=12.0.0-canary.197f64fa2.0","@material/shape":"=12.0.0-canary.197f64fa2.0","@material/theme":"=12.0.0-canary.197f64fa2.0"},"publishConfig":{"access":"public"},"gitHead":"890b4e4cc8e4f275054b5ddf4b3554d0a36ad82c","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/890b4e4cc8e4f275054b5ddf4b3554d0a36ad82c/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/890b4e4cc8e4f275054b5ddf4b3554d0a36ad82c/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/890b4e4cc8e4f275054b5ddf4b3554d0a36ad82c/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/890b4e4cc8e4f275054b5ddf4b3554d0a36ad82c/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/890b4e4cc8e4f275054b5ddf4b3554d0a36ad82c/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/890b4e4cc8e4f275054b5ddf4b3554d0a36ad82c/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/890b4e4cc8e4f275054b5ddf4b3554d0a36ad82c/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/890b4e4cc8e4f275054b5ddf4b3554d0a36ad82c/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.c99d1fa5.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-DIcXW5+BS2S4s+0/Mf7F+zq7x2NV913Fa0i4sofeGh8DuplJOzNnVwjqjPNXHE5LnWb0VEvAL/IaMIh7GYjzpA==","shasum":"d916948297553b25abea78221a5ae7bd3188d701","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.c99d1fa5.0.tgz","fileCount":13,"unpackedSize":204852,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJghxibCRA9TVsSAnZWagAA7vYP/ApsAUKVCWv1V6Jig2y/\nXYVFfWcskAqZ2/NwBy1UOoA2a2C/nrKLVZ+XUGJNQU4Sj7hWjeg5yQauvkUd\nfJ+lqyen3jM47wB3dvy8GYzMwVJeiP9oH3M/nPTJKBJNnjFEbsgrufZ5e/Si\nbH7DHXRpx9H74grdC7EgE6iTXFFx8fKdlNqZJa16yaaVdy1tLvGrCMq2JTVY\nOibpx5O3IuR3mhrHVFhNDuXvThEI6zBITqPtmsX1B31j+TIPSx+BCIV93PNh\nRVLr0Rgl4ZMPnTWw00nlMerSUktX+H3oPS/Qat5oAwbi7hcfdEdjtX2apQD9\noxEDZHDCIBAfihq3foPR0I/o3o1CeEgden0mjgte6RL3L27l+I7SfoD37mIC\nz0/nr9mJAuu2zG24ia+6FayqH2/bEfNgMZfG4ty/waxZ6I26xPa54giY4bQ2\nA6/pQ53hPLW63kAJCCKzvBmR61O1uJOQyuLPadyAVfsnNHZ4m/de2FLnizJc\nTDjTz6oe0VF6+FpLwhitu+k+HPADQYk6LLTFieMIDl2JRiH+lqMAYqXLRkCk\npsOKCnHh8vAFF1c3LshfjyjwHDzphNsF6i40nc8ba1LrpbkUyKx3V2VWHSdZ\n1RgsadyK4rspTgTB7BF7cPyyNDHibgEDtT3NpC2IT3B4ppzXYT0YL04+/Bz2\nvab8\r\n=xusy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG1AM3bo59DxVLdyHDnxbZbr2tpK66v6ESakEkaDCucDAiEA8lqjwl5OAmBok0HlQZRkgFACbdMF3nhVt0a4oZcRyNg="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.c99d1fa5.0_1619466394561_0.9575480605265951"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.eea9b304.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.eea9b304.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.197f64fa2.0","@material/line-ripple":"=12.0.0-canary.197f64fa2.0","@material/mwc-base":"0.21.0-canary.eea9b304.0","@material/mwc-floating-label":"0.21.0-canary.eea9b304.0","@material/mwc-line-ripple":"0.21.0-canary.eea9b304.0","@material/mwc-notched-outline":"0.21.0-canary.eea9b304.0","@material/textfield":"=12.0.0-canary.197f64fa2.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.eea9b304.0","@material/notched-outline":"=12.0.0-canary.197f64fa2.0","@material/ripple":"=12.0.0-canary.197f64fa2.0","@material/shape":"=12.0.0-canary.197f64fa2.0","@material/theme":"=12.0.0-canary.197f64fa2.0"},"publishConfig":{"access":"public"},"gitHead":"5446efe110704f4464931aec816f98b15640db03","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5446efe110704f4464931aec816f98b15640db03/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5446efe110704f4464931aec816f98b15640db03/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5446efe110704f4464931aec816f98b15640db03/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5446efe110704f4464931aec816f98b15640db03/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5446efe110704f4464931aec816f98b15640db03/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5446efe110704f4464931aec816f98b15640db03/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5446efe110704f4464931aec816f98b15640db03/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5446efe110704f4464931aec816f98b15640db03/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.eea9b304.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-uXXQsBTdEuTI6mmzDz145Fu4VVwQdWUKPE/zrc1tnKWrudTGokI5ZzeJ1sUF6ESejorinnstZz0srLejzJMXkw==","shasum":"681bede10a4ecdce831af9945aead92d3cb5cb97","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.eea9b304.0.tgz","fileCount":13,"unpackedSize":204852,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgiJXTCRA9TVsSAnZWagAAg3IP/A0E7Bz71Y0cMelagGbg\n93O4Ffs9c4FComxGijgYClM/yf0pPIftIFN+uhwFtIjGrumNVprCtEPl88JO\n+k1457QbMXVACnVTfASQSSFQlJ+S2TttTVol7cBoiXt+sY55G1yWoSw1HTjo\nzErYwIPnHvalYIhWqtAHqi3Mw3AC1vHtyG+Bh7U9eGendyjopVXhoOP326wD\nnbC4G94m/xDTANRcgIAeOncSwbCswKMKPvpYt001WczVoUM6IJn60FjUvlJV\nwb8cvcVlx+SHfkX3FR+qDrNOHtPxmudI+eBDdxgsbOGwvckD0OdI3TX+JllO\nl5ufVC7yZTfQkeiXwfzlC0MSSGV5RMed1zyS/5G+D6hKrO7wDiuLppB4ATxi\nuxMOVITpJSUYax2VJlG3yuP14KlEVdRrJHuWZTmOcPLe56WucDy2Fd4cVs5R\nA13KxQiNQ3/hh2v0XO4wCk9QgtLOfMSX/ZqRBZMdRhcrHKh9YQVVJzi7hXUg\nna7mMgb647OflyNtPS4/Dd59jScvF9fiKcKUA2YyWMd+gcOp5QNe42OteagP\nFxlz0AXBNd7929gz8oU27m4g4umLeN1qFQmH4P/878GmTNKlSORx+C4BG45+\nZcqlam6orRcDJsCvWPQq5JriGXz/BWOcKqdxz2mAIG35hM85TupM6wJiVOXP\nntj8\r\n=HegM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC1rtY9jKn071L2nvrLr+ne4hzAHUlgQQKv1JubV96eWQIhAOQpNCW3YLY0yQIvZbmusjQvxGClXVXSBDoxpoxL9Mdi"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.eea9b304.0_1619563986633_0.8930052343911694"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.5dd85d0c.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.5dd85d0c.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.197f64fa2.0","@material/line-ripple":"=12.0.0-canary.197f64fa2.0","@material/mwc-base":"0.21.0-canary.5dd85d0c.0","@material/mwc-floating-label":"0.21.0-canary.5dd85d0c.0","@material/mwc-line-ripple":"0.21.0-canary.5dd85d0c.0","@material/mwc-notched-outline":"0.21.0-canary.5dd85d0c.0","@material/textfield":"=12.0.0-canary.197f64fa2.0","lit-element":"^2.3.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.5dd85d0c.0","@material/notched-outline":"=12.0.0-canary.197f64fa2.0","@material/ripple":"=12.0.0-canary.197f64fa2.0","@material/shape":"=12.0.0-canary.197f64fa2.0","@material/theme":"=12.0.0-canary.197f64fa2.0"},"publishConfig":{"access":"public"},"gitHead":"87fa4ee3a285fecb598e3c37e03178de68d79f7d","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/87fa4ee3a285fecb598e3c37e03178de68d79f7d/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/87fa4ee3a285fecb598e3c37e03178de68d79f7d/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/87fa4ee3a285fecb598e3c37e03178de68d79f7d/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/87fa4ee3a285fecb598e3c37e03178de68d79f7d/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/87fa4ee3a285fecb598e3c37e03178de68d79f7d/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/87fa4ee3a285fecb598e3c37e03178de68d79f7d/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/87fa4ee3a285fecb598e3c37e03178de68d79f7d/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/87fa4ee3a285fecb598e3c37e03178de68d79f7d/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.5dd85d0c.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-ba/vgXuzfBlyh/4kSsvCyQMXwLZ9CdByl4Jei06T+4B1C2T/G2e+A/ZXNXAYPmD42cm+NNA/kIIpsQkLWEFiow==","shasum":"90405a69a44dbd3302c21c6d87e9579a17954c49","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.5dd85d0c.0.tgz","fileCount":13,"unpackedSize":204852,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgiKe4CRA9TVsSAnZWagAAU48P/2UCwjERLsRciSBHRN4y\n0FQc9kgb/oDTA/mbyhPpkSBuIFx9CLYQQiASLMO5GOXTlK9Vq5wEt4k36EZv\nA6PhGzYy4bp4j26tS3J1nmjzDVzDmK1TWZaYV2K0qjLRGpMRpB/p2Ix4gORg\nauu9+PAtppm+VEqv0wjNfWr8xgB3jx5k+F7giOdDOSK8eDNYxRydKSX488/j\nvD8bvsgXxOjYqsbGQM4J5GeGLkBq3m6KOJNL1R5VpTVMcy9BD6OOxQo8dxRO\nQrcC+mNS/4PO8Z3Xp0SMvrMNdCl/FrsfGmv0hmcMk6azMBWngNFQuAWVD8RQ\nhFfd2FbFD6+SO5T/oZL+UO8govp8/gkS2XZlbmYFzBdfTeXR9jUNGAQppOlD\npgaiUCGC6u42rhEQMVQKB7qMgyugt6n2oRySxHXh1LCQ+7lfxhZScz/aH19O\nWXswEz/m8YiP8PYXUJnFQr9T6kzEks8qaXIhh/PcIO/2IKy2xCPRTWL5BFb1\nIQzNTq5QrgLz3yurHjz/SNtyMGpzRIBy60BVHnLpeKZbQul3CuGhCAgk/aTb\nOn+Y57Avy5iKrxiDQAFY0YcTkXSanLIhzpUHh5G4vJ5GaOvACyB4fwPad08T\nEd8YNCv71ZLpFhXXjvmEFSmEYWELVfJylh8m2WNlvXTUfFBOTiWTejI2Y8g7\n+tzW\r\n=o9LE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE465nameG9QGiN/PlXH0BpiXyWrm8o0P16MFW0uSSoLAiApYCkVlPPik0QBAYn6nKkrsb68UJugi3KTYuqIZEywnQ=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.5dd85d0c.0_1619568567703_0.21228367655081892"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.cc813cff.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.cc813cff.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.197f64fa2.0","@material/line-ripple":"=12.0.0-canary.197f64fa2.0","@material/mwc-base":"0.21.0-canary.cc813cff.0","@material/mwc-floating-label":"0.21.0-canary.cc813cff.0","@material/mwc-line-ripple":"0.21.0-canary.cc813cff.0","@material/mwc-notched-outline":"0.21.0-canary.cc813cff.0","@material/textfield":"=12.0.0-canary.197f64fa2.0","lit-element":"~2.4.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.cc813cff.0","@material/notched-outline":"=12.0.0-canary.197f64fa2.0","@material/ripple":"=12.0.0-canary.197f64fa2.0","@material/shape":"=12.0.0-canary.197f64fa2.0","@material/theme":"=12.0.0-canary.197f64fa2.0"},"publishConfig":{"access":"public"},"gitHead":"2505c49d16e9b978469aef456cb53e6d6b265758","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2505c49d16e9b978469aef456cb53e6d6b265758/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2505c49d16e9b978469aef456cb53e6d6b265758/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2505c49d16e9b978469aef456cb53e6d6b265758/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2505c49d16e9b978469aef456cb53e6d6b265758/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2505c49d16e9b978469aef456cb53e6d6b265758/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2505c49d16e9b978469aef456cb53e6d6b265758/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2505c49d16e9b978469aef456cb53e6d6b265758/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2505c49d16e9b978469aef456cb53e6d6b265758/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.cc813cff.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-PNEBNgdMRl1qJMX5RSK0xYjBgCnBUqDvolNMknf5W8kRuQS9giMGvhQZjfXEbv7O+Xwo+dDHt2cHabvFduPe/g==","shasum":"d45ebd013c47d7bcd73e7db6d78247424f06c976","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.cc813cff.0.tgz","fileCount":13,"unpackedSize":204852,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgjHRUCRA9TVsSAnZWagAA2HsP/iymvkyjr7/h6/fmakn9\njtOP+zHId5GLdZIe3wN8eE0Q+nkEtyi4+lJvqjhq0PNzD+oe0lEqefCU99K0\nkY2kI4ZGRpIS+IyBu8SoRjihVwNRUBTgChSGhMIapgAXqv+lDVdCLUSbhEv/\nL7/CfKrpC/poIq/Cio/jvFKX7SCRutHzWCN7Pka34Yy/5zEiemjHCNceqs42\njpKUWLVdmhuwPvIq1CBRFKS2rSMY632j76RZHyNq8W2u8ta1IF/GKUlAzl2N\nQ18q3WjrdmjT1XR2WYDIt5qiutagBld3cLxKMpvT8fMOe013vFRn9mBv+9Su\nbZztd+VxOD6ZpR3VRqCzdgbumDnCJ+jJy6oJTlpltw+sIUGimrGJaQOfPRPV\nbeYot+ph44yNqOjaGmWjM/cXkOAoO6gMqz45g18EONupIkgzi6ibW5xtDlau\n8Q20tBwhv5XDvjUD/9n/kITX4s7JNVjNPob8ai1qGnqn5YXtPT1fVdVWBiCy\nNry2VMg2MGngclBtrqSNqyRVsHHf2eO2as/kDJ5VVsNh4K+VcsCg0Ezq1U4/\nN+oQL5wNTmQUafPZ0mGLUQ+kV4D5O0t+AmxobRbd4K0PhOMUscn4VkF1kCVz\nsvriq4R66E4TQPaX38Q0d+bO4hbkx2t1Mlcml8jDsEWC40Qo2r4qbbsFCU7M\n770J\r\n=CK+b\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDr71VN/3EKNws6aXhIBbpRX+CFhHh3AIk6saV9v32e4AIhAJOnFdBub43wBrNCgzX+dftzYhUp+8TxH6jXxoYycjwY"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.cc813cff.0_1619817556078_0.6806387987617286"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0-canary.0875e898.0":{"name":"@material/mwc-textfield","version":"0.21.0-canary.0875e898.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.197f64fa2.0","@material/line-ripple":"=12.0.0-canary.197f64fa2.0","@material/mwc-base":"0.21.0-canary.0875e898.0","@material/mwc-floating-label":"0.21.0-canary.0875e898.0","@material/mwc-line-ripple":"0.21.0-canary.0875e898.0","@material/mwc-notched-outline":"0.21.0-canary.0875e898.0","@material/textfield":"=12.0.0-canary.197f64fa2.0","lit-element":"~2.4.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.21.0-canary.0875e898.0","@material/notched-outline":"=12.0.0-canary.197f64fa2.0","@material/ripple":"=12.0.0-canary.197f64fa2.0","@material/shape":"=12.0.0-canary.197f64fa2.0","@material/theme":"=12.0.0-canary.197f64fa2.0"},"publishConfig":{"access":"public"},"gitHead":"d5ea3c745b8a267546c8a9f9ff3e491bd41a8f2e","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d5ea3c745b8a267546c8a9f9ff3e491bd41a8f2e/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d5ea3c745b8a267546c8a9f9ff3e491bd41a8f2e/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d5ea3c745b8a267546c8a9f9ff3e491bd41a8f2e/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d5ea3c745b8a267546c8a9f9ff3e491bd41a8f2e/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d5ea3c745b8a267546c8a9f9ff3e491bd41a8f2e/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d5ea3c745b8a267546c8a9f9ff3e491bd41a8f2e/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d5ea3c745b8a267546c8a9f9ff3e491bd41a8f2e/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d5ea3c745b8a267546c8a9f9ff3e491bd41a8f2e/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0-canary.0875e898.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-M+q+884LssdgSf7ZylgemZaW+5TpH9N7kiD/02GtesXOU/MCYry8AtPn8iHsDUzvqW+sYR7S7tj7t5v8cDoOcA==","shasum":"ca606b0fa08fd289149b4d28488c0219a13d67db","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0-canary.0875e898.0.tgz","fileCount":13,"unpackedSize":204852,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgjHY+CRA9TVsSAnZWagAABzYQAKOihD2lQVlBd9pmh7A0\nmDQfavr6DlSd1S58/SnqPlTI2VpgYeEwhTjZG7PyOkNw8ysZL6qR8Qv1EYNz\nhzuLpGJg2G5WpuoD2AaX8PFK5aE2irle0ZGSpSKyCOtDLlEHBK5r1cfgZkJF\n18jsN+O2xvxa5n/3crA33ZG0L9Yv7NGqJVAb5aSD3SyoTrsOl4PamM1aXviF\nohNxtMtIvilNaHGOQNHhTEAndj5Ljk2bODkMeDlbnAtpvdxkOKVuIBfA+UkT\nj8RRhe10d81h1+90CYA+YTh6TaabsBe7hrcvuN9uW/V/OA5pJwXxvIOKA9f6\nb0+ZIXhx+ED/HIJdLLPuSPN95o92RY+zFJbmyHtYFZ9yi+sr07NV5mTy4sI8\nr6LBNPHMk5M3q2m8jjQdQCbcglZrCLXUXKDK6x/CTurx8aaEhFXg68Qzw34H\n+CFoq1xb4gGdTQnSmemzAfdBEE1yL3rFmlL9K4s7gsan2AyFrRuzLM9f1DMp\nryzQiF8NdgYFnF/iUq4toacsbRG2kOSFz2iOqBk2wggk87abdkpX4pg+oe0z\nS6DESjAZz6xJdnYXCYcOkNTSNyZW5DQUtLLAZQ+ieL/PrSDdunL/FyNuBcsy\n4QFT4XqX/nrs7nXJ3fgtmBLgEBkF5H1v2VHw5dTt816j5mdzHRaGDRiS2jv4\n8U4d\r\n=OD3S\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDhJ5cuiv6oMPAEOAitQ0QBNCQh6dVCJZqY/opXKlvApwIgffCuAV9eWDRt1Xb3ePuPGrdloCRuifPM/7B30xqRbOw="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0-canary.0875e898.0_1619818046547_0.3491649690759484"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.21.0":{"name":"@material/mwc-textfield","version":"0.21.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.197f64fa2.0","@material/line-ripple":"=12.0.0-canary.197f64fa2.0","@material/mwc-base":"^0.21.0","@material/mwc-floating-label":"^0.21.0","@material/mwc-line-ripple":"^0.21.0","@material/mwc-notched-outline":"^0.21.0","@material/textfield":"=12.0.0-canary.197f64fa2.0","lit-element":"~2.4.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"^0.21.0","@material/notched-outline":"=12.0.0-canary.197f64fa2.0","@material/ripple":"=12.0.0-canary.197f64fa2.0","@material/shape":"=12.0.0-canary.197f64fa2.0","@material/theme":"=12.0.0-canary.197f64fa2.0"},"publishConfig":{"access":"public"},"gitHead":"8f1e7e1b886b6c6820c18c8cc26cce7b15fd2c98","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.21.0","_nodeVersion":"12.21.0","_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","dist":{"integrity":"sha512-Ft8GHuHkES6EGNnOV/tYDiSKdaLn5FP0BkcQcNebfmmXG2v35nbx3AmSuQhI6IGk7O+wulYTVubNfp+OkKro7w==","shasum":"ef67961869044735c97d76b2779fad039568b45c","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.21.0.tgz","fileCount":13,"unpackedSize":204749,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgjJmSCRA9TVsSAnZWagAA+r0P/0wAJ0ONUvlBlJNrd/2/\n9g/Jjfq2EH1Clh/Sfrb1EWe+voRwKvP4Z0lPZO8O2xBp78oLplrYrTATWJAb\nYR1n5Pil8QEAd6XHimpqy25BvK32+FNVAtz+XDqn+ZSKjc8EaoJyksErkjGL\nSRNA4eRH+FKbijDQahaK4m335zVxxkPksMvJbhrbpp3xYrvRyPPmIqBm/lYH\nWwDTYNKWuR8zE6zh8Xxyvo6WCRTNwhaOWyFYsnbdwiTcG7weThKJd1jnZ2NI\nqFNqBCOiHThhqqt8nFSAeiI5Im6HXt2/5hKXCs5iB/JUsMz4awYeZk9BjRjO\nHffPlY1wN4A5NxItQJguj2nzGedBTaGTVy7E6Y6xeAOXZjFXAUP/8NNEY9jc\n3/ZtuuYs9lOmRpAgr6UplWsSDKpV0wOXg/UGrMRhUD7zzkvqrecO0P6FclZJ\nuYduSWjXtHVYaiGTatLocb2MWrRjWjjOArDEa95jiY2LXBnWeAxfTv4n6OVk\nMYXUyticM6vzB53tVwcl5yE+szcwlOeg7ifKEc1jCxiZdafxqeXLCKn2Ztsm\nWlI7SlOgqq9vwuSTOQ+JF8r+Ne677o1HYXFV5RrScJp/dngtWmpTBJ6QZT7M\nZOiRjlqY0I72ooQKJ/2Bc4/k2QNrtU/Ejr7rTRox+fX+7ZMo/WocQyuma5Id\nC9jH\r\n=4K6z\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDrRpKtCkBXlrw/NjBBa/XgEw8xn+n08m2NjsjACPDk6AIhALb3ZUJQ47BYlyC9hqUb3SeA46rAO4eiNmFc2soze46l"}]},"_npmUser":{"name":"taylorv","email":"brian.t.vann@gmail.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.21.0_1619827090121_0.7872280344828746"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.22.0-canary.8f1e7e1b.0":{"name":"@material/mwc-textfield","version":"0.22.0-canary.8f1e7e1b.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.197f64fa2.0","@material/line-ripple":"=12.0.0-canary.197f64fa2.0","@material/mwc-base":"0.22.0-canary.8f1e7e1b.0","@material/mwc-floating-label":"0.22.0-canary.8f1e7e1b.0","@material/mwc-line-ripple":"0.22.0-canary.8f1e7e1b.0","@material/mwc-notched-outline":"0.22.0-canary.8f1e7e1b.0","@material/textfield":"=12.0.0-canary.197f64fa2.0","lit-element":"~2.4.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.22.0-canary.8f1e7e1b.0","@material/notched-outline":"=12.0.0-canary.197f64fa2.0","@material/ripple":"=12.0.0-canary.197f64fa2.0","@material/shape":"=12.0.0-canary.197f64fa2.0","@material/theme":"=12.0.0-canary.197f64fa2.0"},"publishConfig":{"access":"public"},"gitHead":"346f8ec243ae13b28796324e6408721377829b39","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/346f8ec243ae13b28796324e6408721377829b39/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/346f8ec243ae13b28796324e6408721377829b39/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/346f8ec243ae13b28796324e6408721377829b39/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/346f8ec243ae13b28796324e6408721377829b39/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/346f8ec243ae13b28796324e6408721377829b39/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/346f8ec243ae13b28796324e6408721377829b39/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/346f8ec243ae13b28796324e6408721377829b39/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/346f8ec243ae13b28796324e6408721377829b39/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.22.0-canary.8f1e7e1b.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-+REtnLmGdDOTonWf3NjaS+VQkhdFaVLKye8ExHrH8wRzw7HoBcrdyj6dLazZSL7oXyw83GZKr8ov8+81l+tY+w==","shasum":"21a1d4cf05fd64a53795c12db9c0ba2f1f15c7dd","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.22.0-canary.8f1e7e1b.0.tgz","fileCount":13,"unpackedSize":204852,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgjJs6CRA9TVsSAnZWagAAD+cP/2LD/sIGtl6yLmUJ16+f\nyf3eiL9o3qDbFejrEywAz2WLre8gxHrbWDQauCYF0WP6KT6n4mo+fxMMDqJ6\nj8azwKcSEUGrMIIjQkPTffbRr9OzqSeqIeYblc8b9V3I9EnIMjnblYckMdU7\n1BhcyT3WiEhPcFBDviow+UBV1kVhwQRw4bDsgsUPfGu5YS4upVoj5+9MkPiV\nKdo6Ws53AjCjxCma77qev09dihMardlD/obgDYjMruh8uxJN4rnW40is4SB3\nmstto5dVmN2UEnD3Tp7qp2NlofvdMYJM6+GVQTKB/biVGSSVIiyvnWUrUyiP\nzwQkX2vEjpA1sVC+0jsnRYdsxLo3RnMnvJK2nqutEaskGVRY4TBSlhhBAYoa\n8eR0+sn11YEv5uJEt13tBI5u5WM+wmpovgxFqgaL/bpMDb4vuOVxvAH7xPcm\nXkxuR6kX35Tw3m7K6Tr/AOYCGVMnERffr3BPNJZRFh7uD8T/m1x8XxokOUZD\nCcDYo/lVTeb0qTMsrJ+PgHRWK88XHfSOOtw6Bgfi1o1DE7HgSnwhLkADDOgT\nJzGyDLF6ih1G7b7R37Q7NeDIJy09egbod4LKx0xQpdDcxSMllcsF2aHj6irO\nElmoTAo8t5jw//NSCbXHmQ7cmGgj4vevsB+0G7R+a1LAJIGPzMvsrT018Ut0\n+qDM\r\n=kE4x\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCii9f4wy8+PiqTRyJ0oW+9i8xCp6icNrOagS5L7+vjOgIgL7ncshSTKihAQB7FQ0wCUg3EPvNw52iUQf6adGmV5cs="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.22.0-canary.8f1e7e1b.0_1619827514503_0.5996411417890204"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.22.0-canary.deb0e792.0":{"name":"@material/mwc-textfield","version":"0.22.0-canary.deb0e792.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.197f64fa2.0","@material/line-ripple":"=12.0.0-canary.197f64fa2.0","@material/mwc-base":"0.22.0-canary.deb0e792.0","@material/mwc-floating-label":"0.22.0-canary.deb0e792.0","@material/mwc-line-ripple":"0.22.0-canary.deb0e792.0","@material/mwc-notched-outline":"0.22.0-canary.deb0e792.0","@material/textfield":"=12.0.0-canary.197f64fa2.0","lit-element":"~2.4.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.22.0-canary.deb0e792.0","@material/notched-outline":"=12.0.0-canary.197f64fa2.0","@material/ripple":"=12.0.0-canary.197f64fa2.0","@material/shape":"=12.0.0-canary.197f64fa2.0","@material/theme":"=12.0.0-canary.197f64fa2.0"},"publishConfig":{"access":"public"},"gitHead":"7b8ce494b86ceb69e799a5ec1a9f0148075d04be","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7b8ce494b86ceb69e799a5ec1a9f0148075d04be/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7b8ce494b86ceb69e799a5ec1a9f0148075d04be/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7b8ce494b86ceb69e799a5ec1a9f0148075d04be/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7b8ce494b86ceb69e799a5ec1a9f0148075d04be/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7b8ce494b86ceb69e799a5ec1a9f0148075d04be/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7b8ce494b86ceb69e799a5ec1a9f0148075d04be/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7b8ce494b86ceb69e799a5ec1a9f0148075d04be/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7b8ce494b86ceb69e799a5ec1a9f0148075d04be/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.22.0-canary.deb0e792.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-qjsioql6vwegCtgIUAfIV91Qrp/jmkcYc+qL+sx/z3c9ArBlLiRPPKdghw1N6fOUmMJJYlyYngAOf2Cm+dmX5A==","shasum":"2f643561e76e45f036e359c99525234011196110","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.22.0-canary.deb0e792.0.tgz","fileCount":13,"unpackedSize":204888,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkGxSCRA9TVsSAnZWagAA7OQP/Aw1NZL4eMV+Er9NKhDp\nvxCsONYsAjL7XW6oe3ux/m8CfZRe4fqym7V0pUw8bcF/hOCiufCFklbK3eGd\nOySE7AgAN3HI+1i7hbwMZGu/+tBRU8gyIzPR09SPHV2Br1dFxXV/Q27KsAOW\nn3HB/hlVy9SzwRSw4YvXax9m3xzABZ+nFBZOcN7KN0tnbq4bbdgBv2+Cpiit\no2b0xIxyZ7a0EG/QyLotloDTC5pi1dFFFcjTgE+osTggEb0Ez+6No6Gr8zbR\nocVRNf5yAd9rQEzdulPeRhFDVPBlZrsoMFHua7Pog31yUoOkIqleTCRfRuyK\nJWc5qUp0ohUhJKAcjCueL1pFNC74TPs4vy48m2eFpumfMYXSWjxns2Lvvke3\nTr7ZYB9sQD5+rxT1PxkGvgpUeu/LGvj6YZFEiasJoVep6ntzB//0q7EBqFmx\n3YDF78GsZpF8X+CfFk79IerKhjf16r71e0a/yW8VDKHGukjojnKSTw+hHfgF\nJYGWTnQipALOxARjlXIML68Ovi6gERXzyeJTBYxV9zYPTHvTBaeHVgsm4l9K\nJN1k/jTlDqF6FdtK8zEDsZjOM95BhXDgTWc5w8oCw0gZqQyaLOiDSvIk/xnB\nP/x7XMglT6rl3Y+LXRsQiEDEe7iBj7AsNyd7Q8FNOUuwiXwQmp6M6LFBXTsH\nNI01\r\n=gkNd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCvIV7TYgGSeskt9xFWNB1VU3GfPWNmLZeOBoPgMgh+PQIgWPWhzkKpaM7PdDgKfvYT8/KRrNSCsNTDRi/Y+o++Sd8="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.22.0-canary.deb0e792.0_1620077650203_0.15603594221311368"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.22.0-canary.a3ff615f.0":{"name":"@material/mwc-textfield","version":"0.22.0-canary.a3ff615f.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.474836ad0.0","@material/line-ripple":"=12.0.0-canary.474836ad0.0","@material/mwc-base":"0.22.0-canary.a3ff615f.0","@material/mwc-floating-label":"0.22.0-canary.a3ff615f.0","@material/mwc-line-ripple":"0.22.0-canary.a3ff615f.0","@material/mwc-notched-outline":"0.22.0-canary.a3ff615f.0","@material/textfield":"=12.0.0-canary.474836ad0.0","lit-element":"~2.4.0","lit-html":"^1.1.2","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.22.0-canary.a3ff615f.0","@material/notched-outline":"=12.0.0-canary.474836ad0.0","@material/ripple":"=12.0.0-canary.474836ad0.0","@material/shape":"=12.0.0-canary.474836ad0.0","@material/theme":"=12.0.0-canary.474836ad0.0"},"publishConfig":{"access":"public"},"gitHead":"1e819eb3a7930649e9ccc58d69e42d7d17e022ea","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1e819eb3a7930649e9ccc58d69e42d7d17e022ea/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1e819eb3a7930649e9ccc58d69e42d7d17e022ea/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1e819eb3a7930649e9ccc58d69e42d7d17e022ea/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1e819eb3a7930649e9ccc58d69e42d7d17e022ea/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1e819eb3a7930649e9ccc58d69e42d7d17e022ea/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1e819eb3a7930649e9ccc58d69e42d7d17e022ea/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1e819eb3a7930649e9ccc58d69e42d7d17e022ea/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1e819eb3a7930649e9ccc58d69e42d7d17e022ea/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.22.0-canary.a3ff615f.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-DuNDew+OjCzVHLPkyo4wDmu4dkblfYISen3rJDnO3FOF35WLZE9el9ytgp7L2qvD/+1A87PAM1yHo8X5FnF6Qw==","shasum":"26d9232657cffae522b791135fb7fc52b27c0165","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.22.0-canary.a3ff615f.0.tgz","fileCount":13,"unpackedSize":204888,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkHo+CRA9TVsSAnZWagAAnbkP/RXM8ewQAeflDGw8jVYL\ntqhVNxiGQgfAnxGmbzYhnZ4BGKJ/KkhNE623TCaMV2CQyKzzoDVS7EET/23L\nso0rwVpngKw/xUF00wEgSeWg2GYkDhPj2z6hPz0Sj3vmUuQwQ8tD/dk4vV7y\nSrBR5jb1zmz0g5tcD9mqZGT1EbbXTWNS8vei/sUhFW34p8dipvB0r5Eemork\nwpCFC2CyrVge9asrTnj/UtQ6oknNlN37BY9bVo5iWIj+Er+zL1HBbVEjzlJt\nfwbzbN09Blr8DiQna3QBxqdD6KObwmubxfd2twTB+AxmcLWvTl3h6yuQF2JG\neSPyaFfHVf/W0hF0G/VvRS79JL2r/Cky6BXv291uP2790/jYbBB3bDaOVNmy\nH32jgt+n4df6PGGr9Vafcex9yEg68+9uMMteHvlFEA5KaxwlU3angHoLi4RK\nTRqOC1avRqZxOQJWmK3Mgs6n9GA/WDnyyMc91A/530TfgTEozozW4iSZ5tDr\nTCvbxZGpZsiWP5S5JPRp+3Bs6n+vHA8pfavoWzHx7w5BkUpGtegGdkfxw10o\n71A3W3lIm+mejBIMdxgjogvENAfggJXLX+ylJpaX53JFfTnkKw7Hj6amnaLt\nuLghTD/cVpUrl3T8fh8IQomF47WWtd5rgRdeZL2iPdVo3FM7SfczdJ0t042t\nJh8W\r\n=sFjQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDzrSPoHbkfbvKVDuvRURI0dxWsJFPUHjJvq2RqMi9mHAIhAJ6Ki9umvkwVXzV6OnHVc2IReEchCQGvTLqR104rY1XO"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.22.0-canary.a3ff615f.0_1620081214192_0.0359067273379885"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.22.0-canary.948ccfb5.0":{"name":"@material/mwc-textfield","version":"0.22.0-canary.948ccfb5.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.474836ad0.0","@material/line-ripple":"=12.0.0-canary.474836ad0.0","@material/mwc-base":"0.22.0-canary.948ccfb5.0","@material/mwc-floating-label":"0.22.0-canary.948ccfb5.0","@material/mwc-line-ripple":"0.22.0-canary.948ccfb5.0","@material/mwc-notched-outline":"0.22.0-canary.948ccfb5.0","@material/textfield":"=12.0.0-canary.474836ad0.0","lit-element":"^2.5.0","lit-html":"^1.4.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.22.0-canary.948ccfb5.0","@material/notched-outline":"=12.0.0-canary.474836ad0.0","@material/ripple":"=12.0.0-canary.474836ad0.0","@material/shape":"=12.0.0-canary.474836ad0.0","@material/theme":"=12.0.0-canary.474836ad0.0"},"publishConfig":{"access":"public"},"gitHead":"1dd7576742ede6b9f763d391eaebd31ce501ea16","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1dd7576742ede6b9f763d391eaebd31ce501ea16/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1dd7576742ede6b9f763d391eaebd31ce501ea16/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1dd7576742ede6b9f763d391eaebd31ce501ea16/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1dd7576742ede6b9f763d391eaebd31ce501ea16/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1dd7576742ede6b9f763d391eaebd31ce501ea16/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1dd7576742ede6b9f763d391eaebd31ce501ea16/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1dd7576742ede6b9f763d391eaebd31ce501ea16/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1dd7576742ede6b9f763d391eaebd31ce501ea16/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.22.0-canary.948ccfb5.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-q2m4S/msA+VmYV6GeDtNCIrfG83AXOOqcEO+NbObN6VLV6CkxjnIPs27YWVj/xCU7ICHygwis4Hz+2eY2PS9ZA==","shasum":"1eece3be89ea588c7fa0c38a3096c44846e3b230","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.22.0-canary.948ccfb5.0.tgz","fileCount":13,"unpackedSize":204888,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkJD+CRA9TVsSAnZWagAAX+AP/jXZUcs43cvQ/TeMWSZ8\nP6mYxpTNo2yDSCwLoRUj9DAiwSy0kKJ35VhR9sZgQPvzGPItwWR/J2tGcojn\n9lVdyHTQgyB639o1UDUDoJ1SZo1KnEsN/TYq/DZtJwDhx+hGBu00d85zg1gR\n8Qz0mSv3asSSo16IlYSjB05BDyHin5/sIUSW9R0nu5Wifb15CHyU4JrxEElJ\nRbL9htHpE3nJ+CRwHl5VCDjBdbMk4IOPXdLzjvc5qlRBQIKEHbkwICceejQj\nmfFwX4ufOcDybYKn1L1Oo/1lfMuWsF3NrHsr4YafkZ5t2ZsBNpFQxoNZvCGi\naZbb6f77yH3DpHmkiM/uvtZ00Wu0sAHIZwjPT3RMm7y4264t3jjkDuAz0AcJ\nv1Y5HJdrPk4d6CeHGaFQO1v+YRnw5fy0R4BkVV0QifLYNEcB7/ZoLMtifmRb\np/C47UqTgS08kdBklCbuaxiTqG5vgGFQQjLIgwcVIUQQt41t1s7ZTqb2ACdI\nrq9nwL+mrAbomdZsuSChbAq9phW57Xh9ecUZw/VXjADm2bGVKolouxMLeZ1u\nyhilBX7SIQurIH4Jfnzn4fdV/WjFS2r20W6JffThVMLHGvdxGQxotcNHoeZ5\nKtzNa4di/vx7TU+jV33mFmc81R1hKULt8lPW8TypvrGx4BlKKDkMuLykbocd\nd7fc\r\n=w2AH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCZoqgJwri7D4LVPf7YtO/v0YPkjG8dfVz6RTFfZcpzIwIgTHgj5wl/xW4JZcHer4PdUR6qSdrDY/EOPcLmKSTwvcw="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.22.0-canary.948ccfb5.0_1620087037543_0.441844645307764"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.22.0-canary.9f8337d7.0":{"name":"@material/mwc-textfield","version":"0.22.0-canary.9f8337d7.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.be999eb08.0","@material/line-ripple":"=12.0.0-canary.be999eb08.0","@material/mwc-base":"0.22.0-canary.9f8337d7.0","@material/mwc-floating-label":"0.22.0-canary.9f8337d7.0","@material/mwc-line-ripple":"0.22.0-canary.9f8337d7.0","@material/mwc-notched-outline":"0.22.0-canary.9f8337d7.0","@material/textfield":"=12.0.0-canary.be999eb08.0","lit-element":"^2.5.0","lit-html":"^1.4.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.22.0-canary.9f8337d7.0","@material/notched-outline":"=12.0.0-canary.be999eb08.0","@material/ripple":"=12.0.0-canary.be999eb08.0","@material/shape":"=12.0.0-canary.be999eb08.0","@material/theme":"=12.0.0-canary.be999eb08.0"},"publishConfig":{"access":"public"},"gitHead":"c25dd9ae2c04ae380f41705f23786ddbcbe29456","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c25dd9ae2c04ae380f41705f23786ddbcbe29456/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c25dd9ae2c04ae380f41705f23786ddbcbe29456/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c25dd9ae2c04ae380f41705f23786ddbcbe29456/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c25dd9ae2c04ae380f41705f23786ddbcbe29456/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c25dd9ae2c04ae380f41705f23786ddbcbe29456/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c25dd9ae2c04ae380f41705f23786ddbcbe29456/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c25dd9ae2c04ae380f41705f23786ddbcbe29456/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c25dd9ae2c04ae380f41705f23786ddbcbe29456/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.22.0-canary.9f8337d7.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-bR/qeHI0bAikMet3HXNcqF0I0dpZwV0ogxJTh45AfsEqI/2QycJRpl/gXgLqTs6NAU9fhDjVBc1kpwKQw2c6sw==","shasum":"65f9057467c00c6bc7c8754ebe82616210a373c9","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.22.0-canary.9f8337d7.0.tgz","fileCount":13,"unpackedSize":204888,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkZRICRA9TVsSAnZWagAAGH4P/RtkePc7fts/30+dLbjb\nSsnbhceD7dF5eqajgcR3mqw+1KMFwGjYNQRWF5SZKs7W98g+yHhhnBOdKc/V\ntX4gBJw3FkD7Ftm4yw2HGliun1KKK7jEBiQPbEKanunJBNNzhQuSMvE06RiQ\n4XYbKWnOFZKbEeOqO5xRUogCpi2S1ih+iK4qYwb7s7YBmVg8NO0pruBVEUt7\nU9LAWxMkjr4+VGJmzXRckp8eubSkKg8ROsbuum1fRrXFAGQM3Jao7jV7u2eG\nnTDGkrY0Nke7sn6Eb+9RmyaFf7Y6BU7CH1QYGKI/mZugK8FyH0S6aK/xQYxF\nw0MuDvI5dMloLZgHmIunKWc0TzY0+YeVwNEhxBuY10Ik3BWC3/l5DqrmKX6H\nO9w3VTWLRs2pFZ8Rj1RwdIv6G158zLrsg4I8Vpprn3RBKgoUIqhsk3J5iY9L\nDIBa4zl+IV7YcII/+k+SfoWQzrwupf2cGfs5uednZNPGxAHXYStAUYwjR948\nxM+2TwqktkckWLnewrOGtoUXgkXxtn6Ww4J2V12be6J5yp/VIKy6fVcSPCjb\ny22KSruoO0IT0uarsZLg5mHOKadRVe/9nZ2DjVNyRPr7knJ5gpClfd6rdds8\nRxgMlO1zPIWpYC+vl81pyHvSJKSvZPAz/XWJYAKQevkSaCPrZ3QyPJB8NFSJ\nFKWS\r\n=HnsP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCxgtMu+7GbKmXwlTVm1VLDWc3GqT7Sgxv/6AW2hI4GlAIgLvAEguZWLc82/ItPivszU6K8zjUgj18RgXBrHi8CfuA="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.22.0-canary.9f8337d7.0_1620153415664_0.5846771695023207"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.22.0-canary.5813480a.0":{"name":"@material/mwc-textfield","version":"0.22.0-canary.5813480a.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.055d4f10a.0","@material/line-ripple":"=12.0.0-canary.055d4f10a.0","@material/mwc-base":"0.22.0-canary.5813480a.0","@material/mwc-floating-label":"0.22.0-canary.5813480a.0","@material/mwc-line-ripple":"0.22.0-canary.5813480a.0","@material/mwc-notched-outline":"0.22.0-canary.5813480a.0","@material/textfield":"=12.0.0-canary.055d4f10a.0","lit-element":"^2.5.0","lit-html":"^1.4.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.22.0-canary.5813480a.0","@material/notched-outline":"=12.0.0-canary.055d4f10a.0","@material/ripple":"=12.0.0-canary.055d4f10a.0","@material/shape":"=12.0.0-canary.055d4f10a.0","@material/theme":"=12.0.0-canary.055d4f10a.0"},"publishConfig":{"access":"public"},"gitHead":"293298dc0704d114f85fd245f98ee8f21a3ea348","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/293298dc0704d114f85fd245f98ee8f21a3ea348/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/293298dc0704d114f85fd245f98ee8f21a3ea348/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/293298dc0704d114f85fd245f98ee8f21a3ea348/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/293298dc0704d114f85fd245f98ee8f21a3ea348/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/293298dc0704d114f85fd245f98ee8f21a3ea348/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/293298dc0704d114f85fd245f98ee8f21a3ea348/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/293298dc0704d114f85fd245f98ee8f21a3ea348/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/293298dc0704d114f85fd245f98ee8f21a3ea348/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.22.0-canary.5813480a.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-6vS+FSf/bnsTJy7ZwUFwjzcfrU78tG2x92CBbHMSrD8sVOfD9rq/mOE3G7sSElOHjuvkwUsZKuyOp1Chbj/4bA==","shasum":"b8992017264023b796495b7fe4f0b1c3090f3f8b","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.22.0-canary.5813480a.0.tgz","fileCount":13,"unpackedSize":204888,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkuMSCRA9TVsSAnZWagAAHssP/RvobYm43x+W9jRDsqOq\nZ+bdv005SMJZ2hX8+tmFLaoJnvY6kVHtKa3GrYOMi7vY00p8SjW0ruDKNYn8\n4+yMrBpAqbQr/g8PtivQaSvIOXz8Z9OvbPOXkvKtCXSdvNjLaIQNcNM0hBFD\no0DeG1BAK1gY45gJlPCSvoSFyIHzJ1/7PNYANt41ji9zjTun08vOK13auV/g\nSyhI4cphtd+T+F+kXVa3jDyD9PUv5EoaXGXUk/6Ox+MAR8pOYUqJa/bhDYoh\nplM7hOqQc8gIbR7Ig+2bt/ErGGV0Kdx9YSZo9pSRATso4qm9G9WxV7Je0gMJ\n1+ZqByjLap/bpkC+Y1yc0gCg+8bu8TatL6qnuvQ2k3tQ6WNS3vsnXP5uD911\n0I91Fc4UBHo8xiZWPIsfIEBFZawiHTYtb288W9tWhSoMw02Fk+XkTNcmHzv+\n/8GuSeTr4TVjMKa069aWvY4APaYiO4Gr8EU43oKI19I+7wMJ59u+/KilQpd4\n7tXVtXaQZza9AaRuuXfACI/9f9VahScsVwI4dBrp2yDPESjII3W2wR2+Wzsc\nKD6G3svVOUYSQ5ufLnvmirbiB8qfOCdaRo92geaMZYulX2jV7nAqkhcH8IHJ\nPRKdyIt7h7yb0lemNH8WOsQ7M95E8LOEzCx4MtPMitGjasMBS3R2H3B82FAv\nH9/u\r\n=E8Q7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDnWw3L8VH+TRsiD/8QxN8IvpdlVsTWQ33Nax35x7F2XwIgIEdFsylD5HlYuNb7z1Xt6vqSp1ZPv0rGDL1Prjjjg04="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.22.0-canary.5813480a.0_1620239122149_0.8806963459480466"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.22.0-canary.ab7fc1bf.0":{"name":"@material/mwc-textfield","version":"0.22.0-canary.ab7fc1bf.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.03f525f9f.0","@material/line-ripple":"=12.0.0-canary.03f525f9f.0","@material/mwc-base":"0.22.0-canary.ab7fc1bf.0","@material/mwc-floating-label":"0.22.0-canary.ab7fc1bf.0","@material/mwc-line-ripple":"0.22.0-canary.ab7fc1bf.0","@material/mwc-notched-outline":"0.22.0-canary.ab7fc1bf.0","@material/textfield":"=12.0.0-canary.03f525f9f.0","lit-element":"^2.5.0","lit-html":"^1.4.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.22.0-canary.ab7fc1bf.0","@material/notched-outline":"=12.0.0-canary.03f525f9f.0","@material/ripple":"=12.0.0-canary.03f525f9f.0","@material/shape":"=12.0.0-canary.03f525f9f.0","@material/theme":"=12.0.0-canary.03f525f9f.0"},"publishConfig":{"access":"public"},"gitHead":"9aaddda989be6b623f728abc86d48adf169d6f69","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9aaddda989be6b623f728abc86d48adf169d6f69/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9aaddda989be6b623f728abc86d48adf169d6f69/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9aaddda989be6b623f728abc86d48adf169d6f69/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9aaddda989be6b623f728abc86d48adf169d6f69/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9aaddda989be6b623f728abc86d48adf169d6f69/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9aaddda989be6b623f728abc86d48adf169d6f69/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9aaddda989be6b623f728abc86d48adf169d6f69/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9aaddda989be6b623f728abc86d48adf169d6f69/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.22.0-canary.ab7fc1bf.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-9M5CGuIWODbkmH5GYPNKCkkjM0h9wfq2+oaf8u2M3T3ddKCUcJ5LAMPUFLHmPrKcFW8vqoaGAJC3P82yTbN/Ag==","shasum":"78753770ed1dc9752d2369f4d247506c94da7477","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.22.0-canary.ab7fc1bf.0.tgz","fileCount":13,"unpackedSize":204888,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJglC5sCRA9TVsSAnZWagAApXwP+wQuYY+9VhBVh8mrq1QT\nUHKjv+IKUkdpxNZzBa4A6KIiK2mEYDuahKaWKwJmxOoAxWlNZYnP3PoCYJjk\ncnIioEHo6J7Sw2vcIQcNPVyUrTEbIlIUAZp3LoieAGWXObmRoOWAFFI+iE8+\nQ36pXFo7LCe5U/0ncN7SXsQJ6blbZSQVvMQDmM6dEeHX9GMbKSQpwYODBiY+\nuLNfn4BATCCyxkmuBGS+xIhwNFtBLECyX5wfh9gQUrQOQHPHum6It5jZnalr\nhGyxo5J03PGNWM9uiQ6ignbrGdXCAvKOwO4tTh2osXqIC1F6x9RRlHCopQ5O\n9oqiCpR6/u7lDT1lywVIKqE3ubns4+a640fp3MFiFDIU1dmQnVHWj+j3teFV\nQB3dNvG9Q6TPOrOqglWEekjhHuOriPkAw7oYU8BbCojVcTQ5E5LkTf52chyn\nLQzIm5UHamOcXgcCKaxql7UZf1CXzQPwcs+dodcfMUROJuGaWwceUE6SpoKD\n4/DPouNiRk7kjPpTxSxtdzQeZSplCF9epJSSj3Nl5MjeW3gg6XJpdVQ19xqn\njcMbk7TU+R56G2RWEPkpLB5gl3/mnjvHXSTFGqGHC5PXOIFs2ivby/8CLMPT\nfBlEKuKYdMZ+R8LPstkm6ECCTol8Z+QD44Dc88sXAjs+CcTbakSzTus9v+qt\nGGJK\r\n=cQWS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDfjcppuQSeNcAhZodRY9kYqJFHgsHAxLNeHvhynMvQtwIgPWKHa8qGC3okpPYADpK9kvhyM/ofbeCFbepWDAu/Lfk="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.22.0-canary.ab7fc1bf.0_1620323948640_0.871813332764062"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.22.0-canary.25693d60.0":{"name":"@material/mwc-textfield","version":"0.22.0-canary.25693d60.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.869d890d4.0","@material/line-ripple":"=12.0.0-canary.869d890d4.0","@material/mwc-base":"0.22.0-canary.25693d60.0","@material/mwc-floating-label":"0.22.0-canary.25693d60.0","@material/mwc-line-ripple":"0.22.0-canary.25693d60.0","@material/mwc-notched-outline":"0.22.0-canary.25693d60.0","@material/textfield":"=12.0.0-canary.869d890d4.0","lit-element":"^2.5.0","lit-html":"^1.4.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.22.0-canary.25693d60.0","@material/notched-outline":"=12.0.0-canary.869d890d4.0","@material/ripple":"=12.0.0-canary.869d890d4.0","@material/shape":"=12.0.0-canary.869d890d4.0","@material/theme":"=12.0.0-canary.869d890d4.0"},"publishConfig":{"access":"public"},"gitHead":"89015755bc4d93aab59cd46274331e3a6c467896","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/89015755bc4d93aab59cd46274331e3a6c467896/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/89015755bc4d93aab59cd46274331e3a6c467896/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/89015755bc4d93aab59cd46274331e3a6c467896/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/89015755bc4d93aab59cd46274331e3a6c467896/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/89015755bc4d93aab59cd46274331e3a6c467896/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/89015755bc4d93aab59cd46274331e3a6c467896/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/89015755bc4d93aab59cd46274331e3a6c467896/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/89015755bc4d93aab59cd46274331e3a6c467896/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.22.0-canary.25693d60.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-ac1cquVHpdSno3Sj7SI1MZqzG3FxFL6UU4h+5/a56nh0OBp5UNotd6Oq3leVtph6uNGdMUdHhAcTNvnhgi8Qdg==","shasum":"1cb13fe878631cbd1ed2e676362b4b574b06e7f9","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.22.0-canary.25693d60.0.tgz","fileCount":13,"unpackedSize":204888,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJglbdrCRA9TVsSAnZWagAAuQcP/jRXlu7IWpAahwKkkQYU\n9cluEu5Y/M6reJsk2c0ORnxtwTSuvgYWhrCTjlQ6k2/lCqW1s5BBz0hgPTol\nx6X6N/LfDaezJ7GePFM5MIypAq96zi2M2CzLKnq88JxS1OVITkmOjLss/sOV\n6PioLs1YSZYX+771dS3Z9bZImXbmD6ggDmj5oSuigvJ1fXE3aiDEXfwDfz0W\nwBVr0Q7jL+eQuhUlh3FHrWVGonAWdO1I320wj92+vAE3OIm4TYI20DlBS2hg\n8G2WUf6euv6dVDw+McVKO+jYT9RrH7d6Iay49aHV4bcuv7ZuSQG7j+5APo4c\na08fPkIblWxS5TxxH0rcLfF0zzLw8lKRxWv4QmjiRSr3F7/3PoIKbdljK7mf\n9TF5/YtgfZCCqRdqFtVlEhLPaHypMv9JQlCNGlAENUB9BGAryI3ulkBEMnhw\nPSsX+QqvdzXld6ramzFXYCpvJXHcWfgJg5B/vn/tKyRBX5ECQf+4KtNXWPhH\nIegsYFYlrCs5eTRL58zD5QYpjHFGICqV0U6FqPotxrOxZycPCfAppQp2CwHA\nvY0gvlSCI5CyZBn4Wh683QZnQKgt/sdIItDaK0YRl7DYKsoIF7g9LbpOCUU1\nKfXqliqUy+6xIWM+noQwiIdcI4vpwDCSNoZf1PUWgxmURiBMD1EeEDLj723t\nQGd6\r\n=Wsia\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEabXwim1qmMMz/stK9GjwUG+tlmywFqaFLHQLycJNgbAiB0Daa+/VtmwgdWwzyt93djxqHptHmTRxPvOnNiLUz/Eg=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.22.0-canary.25693d60.0_1620424554610_0.33082690005769866"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.22.0-canary.c497962b.0":{"name":"@material/mwc-textfield","version":"0.22.0-canary.c497962b.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.869d890d4.0","@material/line-ripple":"=12.0.0-canary.869d890d4.0","@material/mwc-base":"0.22.0-canary.c497962b.0","@material/mwc-floating-label":"0.22.0-canary.c497962b.0","@material/mwc-line-ripple":"0.22.0-canary.c497962b.0","@material/mwc-notched-outline":"0.22.0-canary.c497962b.0","@material/textfield":"=12.0.0-canary.869d890d4.0","lit-element":"^2.5.0","lit-html":"^1.4.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.22.0-canary.c497962b.0","@material/notched-outline":"=12.0.0-canary.869d890d4.0","@material/ripple":"=12.0.0-canary.869d890d4.0","@material/shape":"=12.0.0-canary.869d890d4.0","@material/theme":"=12.0.0-canary.869d890d4.0"},"publishConfig":{"access":"public"},"gitHead":"be15d892a32bdf28e42617b44e38b301b0ea590c","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/be15d892a32bdf28e42617b44e38b301b0ea590c/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/be15d892a32bdf28e42617b44e38b301b0ea590c/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/be15d892a32bdf28e42617b44e38b301b0ea590c/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/be15d892a32bdf28e42617b44e38b301b0ea590c/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/be15d892a32bdf28e42617b44e38b301b0ea590c/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/be15d892a32bdf28e42617b44e38b301b0ea590c/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/be15d892a32bdf28e42617b44e38b301b0ea590c/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/be15d892a32bdf28e42617b44e38b301b0ea590c/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.22.0-canary.c497962b.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-lX02p9vKmMbPOBP6KqcynkoXvUF4OrFrYpDS7Aiw7URTPLgZn9NQzWhFCyytA8LVYHTOmqkxBIh7h8GOcQEibg==","shasum":"3d7aca2cb695d396bb6a62dd7d21b43a649b65d4","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.22.0-canary.c497962b.0.tgz","fileCount":13,"unpackedSize":204888,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJglb0ECRA9TVsSAnZWagAA5wQP/Ry6ygnBTjdkV2jA9urA\nVzKAjck1m3LDFDFBYn2XlwNNvJBDjtUdsduRGPG/i25CTbucACn+zVGcYqnU\nkcq52jeeaDm8aXATrGdrYP8vcUo47Ut8vHbXDVAE8SHxYyEakaW7heiR50Vp\n2dayuoUWeXPJ0aNPUxpeX4lhXWyhQJqdkjUD8aRKrGNwBQHusBTCuUEHZV/0\nYV1Sr+bjq9jJObC1fqdDeePrl+JNC6omgxEhyyGNiMyfOg/9iGfBesWO4dhB\n23+EDsvIsJgcKfR1CgziDRgFTLrm1wnA26mWeXdAbESi7GkScsKv9VIbQcoK\nOud6fyA8qew68mTfBTNHIagBNw9urRFwISON5xdmvbu933AA5GwlcrpAOLaR\nCAldiObTwH0thb82U8NHfxXCQXNMj8FK0lF0mgUIiet/bD9Rl4hvcVBzvekn\n1XfFoV5BXOVzZES1EvKowoxtlcpbQEsxEL/bktaIUL6QdJXbKeCqR/mNAdDE\ne/1If3PE7MhCtjog0GOzlfHP07lBwV7Czj7b8vLR+taN4NF7eglXKVWidcqY\nBVHO85XimkoYs89VdOaZhlSMu1ATcAX/okdPsk2z0hEKd7OlHx8G0p262Oau\nT3W+ETieM11iROOlyRQxAbBX2d02cGnJdZfOdVNl6xTK2IYK94QtNgfiaYxR\nth9T\r\n=XhZB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC5pw/tJ+3mSClj0/gH/2Eec0YiASx8VtwHz18VO3x8EgIhAJCABgDu2QX1elaVNnydohxAC5wtaw3YnwysDccprmW3"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.22.0-canary.c497962b.0_1620425988286_0.8892150506430998"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.22.0-canary.e300688e.0":{"name":"@material/mwc-textfield","version":"0.22.0-canary.e300688e.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.869d890d4.0","@material/line-ripple":"=12.0.0-canary.869d890d4.0","@material/mwc-base":"0.22.0-canary.e300688e.0","@material/mwc-floating-label":"0.22.0-canary.e300688e.0","@material/mwc-line-ripple":"0.22.0-canary.e300688e.0","@material/mwc-notched-outline":"0.22.0-canary.e300688e.0","@material/textfield":"=12.0.0-canary.869d890d4.0","lit-element":"^2.5.0","lit-html":"^1.4.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.22.0-canary.e300688e.0","@material/notched-outline":"=12.0.0-canary.869d890d4.0","@material/ripple":"=12.0.0-canary.869d890d4.0","@material/shape":"=12.0.0-canary.869d890d4.0","@material/theme":"=12.0.0-canary.869d890d4.0"},"publishConfig":{"access":"public"},"gitHead":"94ee5e4aa5987e14fc749785fef3b65b73185c74","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/94ee5e4aa5987e14fc749785fef3b65b73185c74/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/94ee5e4aa5987e14fc749785fef3b65b73185c74/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/94ee5e4aa5987e14fc749785fef3b65b73185c74/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/94ee5e4aa5987e14fc749785fef3b65b73185c74/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/94ee5e4aa5987e14fc749785fef3b65b73185c74/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/94ee5e4aa5987e14fc749785fef3b65b73185c74/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/94ee5e4aa5987e14fc749785fef3b65b73185c74/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/94ee5e4aa5987e14fc749785fef3b65b73185c74/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.22.0-canary.e300688e.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-A550O1hXFhnJCSIGXps61SCUDohCI6dD6JKHO6srI18B0z8vCea2LEdLj3VmIVSnDiG3cJAEdhn9ucZZ+y9pqw==","shasum":"f60eb8006ee75556d88bb17807dcc572975bf19f","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.22.0-canary.e300688e.0.tgz","fileCount":13,"unpackedSize":204888,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJglb4RCRA9TVsSAnZWagAAmcsP/2kPpknIq/S5GIr+bCHu\nF+NVKSGjBOpvmEIiFwwCuTPoj/TwD5m0BVS0gv2pYezvOcFhmQvfii/+pcqW\n7ShDmXk7M19TGUbUv/iCrFn2HhZQvTpTeWtGhTXupFtZbsccd/j+0cX+AzQk\n/T03tq5Vl2KojbCmPJxRVTT/85SwjUuoXLV/5cbprGLVQ9jYGPLuj9RTIVqG\nrdjbxDNGvhHNKCBqY9yENYAzjWsIZy/FC7RT02SaNCzGctxT6k07xfTVnq5y\nvvPa0fy2TZ7uGAuAUkzt6PECw+NHY7ycbElCl3ESp7vfB/KuFMYBUuXMg/y7\nXI9pA3yZBpvGfVPeVAoijzwTwNFS4vjdoYA19vFGtAKXZoQuq+91//VnU8yO\nGRhie9s9IjVU9yeBk8AvS3wnMrhF1ISVT+e68TrnG+VSEEFHMiafM1aZ6QAk\nHeLCMtVR+FCYG2+zLtQfXYibIYJz4kKEaAmoCJrUtWk/8sY0JUFNua2t+cNm\njNmdVt1N803a2E8Aah4W9WkBHA1jsSzRpyfNoSwn1ESoPtj07YHKwBo1ktKm\nSu3FXBb4ENlTyKUo+NfSMoPtChmyzW1wJQbj68CZVeOfv7wJIrhgJ0+FJsmS\npBtrhkQaZYRdkU5fSGeWggFAkPFeAcimo89pDuSRJsenu+8IQa72SO4QSfeV\nUFTj\r\n=JR9s\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDLFLgX/1Y0hwKPMVkbugygQu5qCg/W+zdX2rjGecTWfwIgDSBciN9bG7m1ranRpyQsb9gjdN+zE1XfH899Cf+SHr0="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.22.0-canary.e300688e.0_1620426257292_0.8229352104377423"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.22.0-canary.d70287f2.0":{"name":"@material/mwc-textfield","version":"0.22.0-canary.d70287f2.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.869d890d4.0","@material/line-ripple":"=12.0.0-canary.869d890d4.0","@material/mwc-base":"0.22.0-canary.d70287f2.0","@material/mwc-floating-label":"0.22.0-canary.d70287f2.0","@material/mwc-line-ripple":"0.22.0-canary.d70287f2.0","@material/mwc-notched-outline":"0.22.0-canary.d70287f2.0","@material/textfield":"=12.0.0-canary.869d890d4.0","lit-element":"^2.5.0","lit-html":"^1.4.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.22.0-canary.d70287f2.0","@material/notched-outline":"=12.0.0-canary.869d890d4.0","@material/ripple":"=12.0.0-canary.869d890d4.0","@material/shape":"=12.0.0-canary.869d890d4.0","@material/theme":"=12.0.0-canary.869d890d4.0"},"publishConfig":{"access":"public"},"gitHead":"17a229885fc92f311534b89a9df6549e9b78c204","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/17a229885fc92f311534b89a9df6549e9b78c204/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/17a229885fc92f311534b89a9df6549e9b78c204/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/17a229885fc92f311534b89a9df6549e9b78c204/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/17a229885fc92f311534b89a9df6549e9b78c204/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/17a229885fc92f311534b89a9df6549e9b78c204/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/17a229885fc92f311534b89a9df6549e9b78c204/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/17a229885fc92f311534b89a9df6549e9b78c204/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/17a229885fc92f311534b89a9df6549e9b78c204/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.22.0-canary.d70287f2.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-Bicdjz7q8g0yPYNowIHjgu5v2SMHS6jaFF1PosjE7p+Yc17K7vCa8mCQBFWC3qSliG5KMhBDNmF5NKMHPdX9QA==","shasum":"f7368b2c1b62703fafcf92b6fb0f27d28c9adce8","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.22.0-canary.d70287f2.0.tgz","fileCount":13,"unpackedSize":204764,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgmYmICRA9TVsSAnZWagAAooQQAIUyFCZM0XYprTt4D0mZ\n5FCr7vs3avNyy6SkwIfWPJE+L9fcVvIH0pLYuHvRtloYrkJd0k2F/XZiiV7U\n69ziqTFawH/al0rVfkhlBkn9qd0y8BJO70BfSNVNjMZpnAFiihDJk9lM6GdA\nuY+57+kolf0DzC5v0foKyDXABe/HjxDeOmdj928Xiy7Ktnzt5ZbwZ1b3L+sL\nht6HyPpjFqdmF2mzXxwEG47FxAmt0GfO+iM149BMpAgrYGbe/Rak10j1Z5hK\nnHhiyAmYCcBpgvWD1ZaGXWDBP+KfZscnNk+gLAfJ4ePtrOJO9wl6UXER2tsd\nduaiTbB7aicz8l75wXlSPvYi2bRWAggV7AYIUm5yMEktQ0n/G/0zbe70utI3\n6qvB82W9vHT0+9qZMhXH8+Vxi50zRQZjGuUYUnkfPmIuVf8F5o913Jnqrk5g\n/FWgkGarRRwDZFSbzCYvpkJjrSUr23ggnSFKbcWh8PehlAvXUX+DAn1JVyud\nHjSCJwjqpxt5pJLJARVqAc+Rlfs8PkFqzKjE8OOuYdvyyd9eiSLqyIke4MGU\nsm1oEbUt28YUjfqReH7tbENQzjQ7uboN5k85vTnFQvrFbXm2SUBUFNYqRZwU\nMRobMVzpoQV9Wo7J3nD7kPp2AlhgeExRi5HA08URWgDsNHEjp4SqQiyZqeHa\nbxdx\r\n=kSpY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDqsOLBMCxIWpUDXEBhCVdLVKVatwdmmSYCEkDMLILV4AIgXSTfqxvH3POMSI8llYpqN6VaiGBYE9iZfUB3GAMms1k="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.22.0-canary.d70287f2.0_1620674951691_0.6340747293823965"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.22.0-canary.02e841b2.0":{"name":"@material/mwc-textfield","version":"0.22.0-canary.02e841b2.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.869d890d4.0","@material/line-ripple":"=12.0.0-canary.869d890d4.0","@material/mwc-base":"0.22.0-canary.02e841b2.0","@material/mwc-floating-label":"0.22.0-canary.02e841b2.0","@material/mwc-line-ripple":"0.22.0-canary.02e841b2.0","@material/mwc-notched-outline":"0.22.0-canary.02e841b2.0","@material/textfield":"=12.0.0-canary.869d890d4.0","lit-element":"^2.5.0","lit-html":"^1.4.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.22.0-canary.02e841b2.0","@material/notched-outline":"=12.0.0-canary.869d890d4.0","@material/ripple":"=12.0.0-canary.869d890d4.0","@material/shape":"=12.0.0-canary.869d890d4.0","@material/theme":"=12.0.0-canary.869d890d4.0"},"publishConfig":{"access":"public"},"gitHead":"10f49288fa74318f178daebc0299b7da22137eae","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/10f49288fa74318f178daebc0299b7da22137eae/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/10f49288fa74318f178daebc0299b7da22137eae/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/10f49288fa74318f178daebc0299b7da22137eae/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/10f49288fa74318f178daebc0299b7da22137eae/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/10f49288fa74318f178daebc0299b7da22137eae/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/10f49288fa74318f178daebc0299b7da22137eae/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/10f49288fa74318f178daebc0299b7da22137eae/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/10f49288fa74318f178daebc0299b7da22137eae/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.22.0-canary.02e841b2.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-Pm3BzRT7wN/iqq+38KJFp4cbNhJP/4n+ARWY1fXRIdS3Vbc+BhPHhWbfV92D+JM95/iRAGZ+zjulzGL/M6ZdlQ==","shasum":"e68b490bfefff1ea9f47141a97bcdf5af3149e8f","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.22.0-canary.02e841b2.0.tgz","fileCount":13,"unpackedSize":204764,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgmZjSCRA9TVsSAnZWagAAgAkP/1/6vjAJMw2Uta/IwHxm\nFo66b9kJOm+EhMmtLlWPu0fdUugfn66zQt6Rw9W0Yaf/Q5IVLDwLP7XWVLLq\nh35i/ljAhyXd4Mc8iXLCljgDSkdZEbKP0oO25JmJ0tnCHWovhgJRFULi20e7\n8emNoa2OVg3qLGGprgWxF3Jqpf3m3pz0rYU2WgwwNyio6CgQDMASsCIhagGy\ni+HS/pOeH7Cx3+xoRqT9p+nNq9Lwq/n9HtOMbCBsGVs9y5y3GytJrE5RUGJ7\n+sQta6pyApcNVVRB6Zc7xhAg4hrEkItgWvfVKNAbs+j3YUYX4pUDZiLMZI9H\n1geuIvMAQgFuj2xoz1K42cUZOGyDal4dxrMf0RGebcDzG4gnJObT7W3aLCRC\n0UJHUV01puWRq9Dsd3kgsip9KhGeXQOfeoBEjN94uGziSGZdHsHlYY2B/suy\nN1RQ/KX5FuUNxypCUxYzMbubdd2x0+anGvamJbdxmEOkTUwPMkM6jQ6ULdHi\nGyq/bJ3amPt1EyhFCQ36MOI+nrFjVIFY0bw1MIzit1F7syydK6yOcvbuvU+9\nz1v7vmUPwlp93lEHO382yhEH8xADxQdE06ec5TmhdJtb71vpEHIWjnRITYN7\nMau39jXrAVF8aVPRTNtS9EnatILsUBClB9/kyG55tJBU0rh0giSySBV6GMtL\nFuQl\r\n=gHBh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICKUChLh/v4IF65N0iLxq28hkMzWq4LasOEkwoCWDY1aAiEAu3N+2Y5z+mrsYR5RXQWtWS3AwUS4ma74Pekuso6TUms="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.22.0-canary.02e841b2.0_1620678865666_0.7337396129722691"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.22.0-canary.badda2f0.0":{"name":"@material/mwc-textfield","version":"0.22.0-canary.badda2f0.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.ec22e1da9.0","@material/line-ripple":"=12.0.0-canary.ec22e1da9.0","@material/mwc-base":"0.22.0-canary.badda2f0.0","@material/mwc-floating-label":"0.22.0-canary.badda2f0.0","@material/mwc-line-ripple":"0.22.0-canary.badda2f0.0","@material/mwc-notched-outline":"0.22.0-canary.badda2f0.0","@material/textfield":"=12.0.0-canary.ec22e1da9.0","lit-element":"^2.5.0","lit-html":"^1.4.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.22.0-canary.badda2f0.0","@material/notched-outline":"=12.0.0-canary.ec22e1da9.0","@material/ripple":"=12.0.0-canary.ec22e1da9.0","@material/shape":"=12.0.0-canary.ec22e1da9.0","@material/theme":"=12.0.0-canary.ec22e1da9.0"},"publishConfig":{"access":"public"},"gitHead":"961b6b76093a7229e8b8672e9dba3c2f9af0e61b","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/961b6b76093a7229e8b8672e9dba3c2f9af0e61b/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/961b6b76093a7229e8b8672e9dba3c2f9af0e61b/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/961b6b76093a7229e8b8672e9dba3c2f9af0e61b/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/961b6b76093a7229e8b8672e9dba3c2f9af0e61b/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/961b6b76093a7229e8b8672e9dba3c2f9af0e61b/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/961b6b76093a7229e8b8672e9dba3c2f9af0e61b/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/961b6b76093a7229e8b8672e9dba3c2f9af0e61b/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/961b6b76093a7229e8b8672e9dba3c2f9af0e61b/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.22.0-canary.badda2f0.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-ibJmmKmxQIXwEmpo+nHvu8uf02UrnGrGkAjJobN6saB2GfjSQ7NvDO97rORvGfsfJV2Bf0Y9qAAmcFreFOBy/w==","shasum":"8389332bfcbf6f1af9b08c1554bedc8945ea26f8","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.22.0-canary.badda2f0.0.tgz","fileCount":13,"unpackedSize":204764,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgmdEaCRA9TVsSAnZWagAAgK8QAJiZI4Ejl5pIe6KegeAE\n9bLW3QxKSckd2LlngSUREQElYE0VN6e6qNdYDJooUMLGLQhnbMsVDLhtKE1N\nfqUg2YzEOrghd1aNEvdbhZvE5NkFG+wH8pT5aJieuUDryypL9ZfrQohVcgLl\nkah5u4Ok6pV5bxaVKyf7yZillijvsltG4ytoi+8obuGY6qrATRvkUxoIz34n\nDtpn02YOJuUJqLSiQuCWPjQXTMfeXDpNLQExftTxhQSG7WKDPqkqi7ywLF9i\nEV0VPB6OT4t6eC5zA/iAI6p0xJiY+FkXcH0nSEGEW5AxIDguul//WcIrlHyk\nZcxpq8+jxRCPsp0JpbPxMRjESMqMS8Ye3gSaKX48keY4oU4l16ILD9HCKrs6\nrZn8sW6Qm4RA+EDBL3ZKHb4Bgq3kHZShLfHVXw5mLl0NlquwhyIuunRrfh4M\nAerkvQ+c1/1ha4qsC3rkU9VXMy50dhTysp/UQTmUlnsC0S8IQV2c9azGuMIH\noUg1XWCgTms2LdUWFOYDP7FzncZ1VMZ5W8I27zEgJTTe785OyBcFu2rZmypg\nAd2bVHugkKjz/YkCRxzel/1qP08eN5nEzrQ/XaqYHghX5aocv8xjxVT0QB1b\nEvfUM8WryZn+V8DA5OGOBtod7uAG0AsQg4OLk3gjeAVwwQRCk6M6KY18k/I8\nazRS\r\n=AHVZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID7dujLqwXW76iuQkbweg3zo01My4N4bwIJ4XA8Rn1yLAiEAtJvgWZ0lLJMUf5bMLK7r+ZVibDJYhRAaFH4HjUKtfCo="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.22.0-canary.badda2f0.0_1620693273630_0.5936762286587967"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.22.0-canary.004aca62.0":{"name":"@material/mwc-textfield","version":"0.22.0-canary.004aca62.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.ec22e1da9.0","@material/line-ripple":"=12.0.0-canary.ec22e1da9.0","@material/mwc-base":"0.22.0-canary.004aca62.0","@material/mwc-floating-label":"0.22.0-canary.004aca62.0","@material/mwc-line-ripple":"0.22.0-canary.004aca62.0","@material/mwc-notched-outline":"0.22.0-canary.004aca62.0","@material/textfield":"=12.0.0-canary.ec22e1da9.0","lit-element":"^2.5.0","lit-html":"^1.4.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.22.0-canary.004aca62.0","@material/notched-outline":"=12.0.0-canary.ec22e1da9.0","@material/ripple":"=12.0.0-canary.ec22e1da9.0","@material/shape":"=12.0.0-canary.ec22e1da9.0","@material/theme":"=12.0.0-canary.ec22e1da9.0"},"publishConfig":{"access":"public"},"gitHead":"3c20c30c670567ff3483811cc2d47a795de96151","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3c20c30c670567ff3483811cc2d47a795de96151/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3c20c30c670567ff3483811cc2d47a795de96151/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3c20c30c670567ff3483811cc2d47a795de96151/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3c20c30c670567ff3483811cc2d47a795de96151/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3c20c30c670567ff3483811cc2d47a795de96151/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3c20c30c670567ff3483811cc2d47a795de96151/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3c20c30c670567ff3483811cc2d47a795de96151/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3c20c30c670567ff3483811cc2d47a795de96151/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.22.0-canary.004aca62.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-+1EQ+Lh9kZEa3oH7t2pgG/6tctNCccTESruxXmm6BX4V9OcyHeQ1RhEsIN3Eq6XOcU3xz/eMGORXwJm97Yz6VA==","shasum":"f6060d25717f9c08a014a569dc7b0932133679e0","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.22.0-canary.004aca62.0.tgz","fileCount":13,"unpackedSize":204764,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgmseXCRA9TVsSAnZWagAAhw8P/1gpdRSdZXpnHycq9pMY\nbUq7xYX/qeiWyl/mVFu5e+f+YvVY7YzEBI6aoZWUxc9wY+rB54V+NKUHPFbi\n9pNDPZ6SY6XEmFbIK7S6mJUCbv5W1xJAzXelR0raedyTXsj/HKot83ugDSue\nMMP+ECL7JmtbAo/9qtfz07JSDKgb9qROO9DgwFTi7Sk0VXhflwdotu7uwbHh\nclc/WNLqg++h8AW5Xio3wWBRL/hSsTSYLvkbauWSD+Hmkt+U/qoMs0tx4lIB\ndH1yQq4/xNDYrLIeBxsZf20DcLsRHZLiTk7EdHq5FVXmmdreDGJUdmzyT8ui\nJIU/SLR/4ay5LnrpDu/G6D3LTajg1CUD5vJKLC5cJApDcgmUmnLtIb8wYJJC\nAN4u7hoiSOV4oa+6C2CHoYY2RG/zpazQL5DRGKUylGG8lfGrHoTlnZaW/KFs\nBlB+XmMOF82ca/H8hFiaoSixaLcWD465QwmlgOrOtexA4K7GfCtl2BQmS9/+\ndE6Cgby8X6chVbDdg/vnRawo57TPU9ZtqoAZfZHtkDfx0Zu0Ki9XqcCB75Y+\n7ExeA0zMRXdSDugpZwJVLg0Yvg1JyuV4Mxp6VvV7Ch/tztGJ7yQXEyF01mWV\nx1/X4lzzO4ErTWzYw0VdI7OCWXDTx/tdqE3rlSKWfjlsUTiuT73WE36FjXHZ\n0/MU\r\n=vBHQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFWNq+68lq5/hA7PVbk3cHZBVqL7HQVdUwYkzJtAd5W6AiEAtUM4WXD7NpjHhO1nMDkIt9B5IiQRhqb5ykj/uU2LPOE="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.22.0-canary.004aca62.0_1620756375128_0.6704984697334264"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.22.0-canary.4af17446.0":{"name":"@material/mwc-textfield","version":"0.22.0-canary.4af17446.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.ec22e1da9.0","@material/line-ripple":"=12.0.0-canary.ec22e1da9.0","@material/mwc-base":"0.22.0-canary.4af17446.0","@material/mwc-floating-label":"0.22.0-canary.4af17446.0","@material/mwc-line-ripple":"0.22.0-canary.4af17446.0","@material/mwc-notched-outline":"0.22.0-canary.4af17446.0","@material/textfield":"=12.0.0-canary.ec22e1da9.0","lit-element":"^2.5.0","lit-html":"^1.4.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.22.0-canary.4af17446.0","@material/notched-outline":"=12.0.0-canary.ec22e1da9.0","@material/ripple":"=12.0.0-canary.ec22e1da9.0","@material/shape":"=12.0.0-canary.ec22e1da9.0","@material/theme":"=12.0.0-canary.ec22e1da9.0"},"publishConfig":{"access":"public"},"gitHead":"8065f1d05fae5a2ca4f95b50302cd5d56d43ea4b","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8065f1d05fae5a2ca4f95b50302cd5d56d43ea4b/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8065f1d05fae5a2ca4f95b50302cd5d56d43ea4b/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8065f1d05fae5a2ca4f95b50302cd5d56d43ea4b/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8065f1d05fae5a2ca4f95b50302cd5d56d43ea4b/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8065f1d05fae5a2ca4f95b50302cd5d56d43ea4b/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8065f1d05fae5a2ca4f95b50302cd5d56d43ea4b/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8065f1d05fae5a2ca4f95b50302cd5d56d43ea4b/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8065f1d05fae5a2ca4f95b50302cd5d56d43ea4b/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.22.0-canary.4af17446.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-87TQXcZzA0kcHu8aEJUiaQfZ+zgJnWc1WXkHKcwooaCyUZkmD4/ruwrcMGrDmoc0CBqqp7yZG0RxyIMlTjsWfw==","shasum":"5a7bc03197acc75b32f659eb2cd492ca8af4c75c","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.22.0-canary.4af17446.0.tgz","fileCount":13,"unpackedSize":204960,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgmtDrCRA9TVsSAnZWagAA+LwQAIZod2/JcP0OBt5I1JsJ\ntzsUdqVQ2FnnpI2+Zu70zHcXkDEntMtUjcWIfBKBSRm2bqJm5hsiVmrDsTKk\ndFWzLeWpQNojifRJqNKUho2DXLX3ny/8dtms8nZbLTG77xeWxIbHGAO0dnZp\nxdZdyIpuGG/V4EIYNyWspiSYVrT2ozG7ptdVWto2LlpSvMGiFPIxmhKffCSY\nkgCqxombLzVfTmzc8yUYoHC3XO0aE24nn2ec73ENI+AF4a4seMXRJbLM2ndI\nwgVcHAe+P/23XZ7p1tpvaD5qFts1geOeKGsGJg5k6KSshDmsXnb5+SkkHbRo\nyQyLiuBum+V300TlxjcgziGejUuQIrOeruCra2xApY9OJKntQUZfUBFXChNK\nwEKkuzNi/dNQAcfeD3vnHGNT3GeF2Vwr/mzGkKh70o78u6Bn8EKAYnOSmgbX\nR8+zPHM+SLreCrftUJtTMVGStU26SL/3FzybqlyILN5YQYWTVFzXAqCBJmpm\nEqO85qGN6jm7tpqWIvdSAdqzGT256HfvAdscwNcHO7FGZsqCLorc7aZlOrUs\nUxn6/4I3UsP4VV9YhCssZGZ+dbRkuwugIB8B2rkI6uV9LkJ4OU2KoelkMCQG\nH4Sb172lKJ9qhmL7OKT6uT4YihaP3CHknQduB0miTvEPQ6IxDlZqEkmLSsbJ\nq+Fp\r\n=K0V2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDiQaaGCG2Te3hLJ/i0AHUrXzoEwds19oihJ3155kaAugIges5/W4Ddn0ZVU+nR/y7CUgmWhG71+8xuPlkcXii1QAg="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.22.0-canary.4af17446.0_1620758763285_0.9526044143632582"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.22.0-canary.b94d7187.0":{"name":"@material/mwc-textfield","version":"0.22.0-canary.b94d7187.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.ec22e1da9.0","@material/line-ripple":"=12.0.0-canary.ec22e1da9.0","@material/mwc-base":"0.22.0-canary.b94d7187.0","@material/mwc-floating-label":"0.22.0-canary.b94d7187.0","@material/mwc-line-ripple":"0.22.0-canary.b94d7187.0","@material/mwc-notched-outline":"0.22.0-canary.b94d7187.0","@material/textfield":"=12.0.0-canary.ec22e1da9.0","lit-element":"^2.5.0","lit-html":"^1.4.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.22.0-canary.b94d7187.0","@material/notched-outline":"=12.0.0-canary.ec22e1da9.0","@material/ripple":"=12.0.0-canary.ec22e1da9.0","@material/shape":"=12.0.0-canary.ec22e1da9.0","@material/theme":"=12.0.0-canary.ec22e1da9.0"},"publishConfig":{"access":"public"},"gitHead":"0b32af6d751df8cf58980e7badd64494f9396b00","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0b32af6d751df8cf58980e7badd64494f9396b00/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0b32af6d751df8cf58980e7badd64494f9396b00/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0b32af6d751df8cf58980e7badd64494f9396b00/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0b32af6d751df8cf58980e7badd64494f9396b00/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0b32af6d751df8cf58980e7badd64494f9396b00/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0b32af6d751df8cf58980e7badd64494f9396b00/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0b32af6d751df8cf58980e7badd64494f9396b00/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0b32af6d751df8cf58980e7badd64494f9396b00/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.22.0-canary.b94d7187.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-w4bo8nfh5Z5Rg0cna9FlOztIG48sj2qViFRSjEHfSUx+nr9D1pmG3k3WPWzP74MycPqeDwO0+tkjiWHw55mp/g==","shasum":"f615c50a812599ee01e67cd58169eab90aab0efc","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.22.0-canary.b94d7187.0.tgz","fileCount":13,"unpackedSize":204960,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgmtI4CRA9TVsSAnZWagAA78UP/17DaXwlnJrZrxZF9kKC\nufDSc4ha215TyKudiYfOJ9jIjO6DQzMCEsqcaeIWrpOMQtz8gIpuE40iSKx0\nRipAfPsd78wQD86p/HDLjTJj1uRAiwxcRPh6uoGeQ5hunCvKMI1ppNLZta6Y\n20LBV91/N3r7u7A+fQR+Va/yt1kpu7w5QU+9eBLLqkXex58gICmrUatjG+2i\n8s6C7/hQg8T6HYIXB9f1dy3m1aQnhI0HZmkWGElcwjnpWznO1aJhk2b4ejJg\njDr0Or/KrJRV9tdrc30dh2gOjp7ab1omxVi/Q+1TCb2RC+KBKBwAIh1UWl17\nPsHHTJ1ly6luwVeVQEYfyDT9Qdx4Mkv8zAYOzOoh9xcgwdi5u7cS6QUBeJ9W\nO7c/y2hGbV84+xs4G1SXwX+AydCe+cdZpMCfZYhPmvVy2vavaXDxXuG2QnZU\nFPzRANy2zXggne6+RF1KOmMYDnt0CFCWylksKTRjIyBrx+k//m1s+0E4kllb\n0peYjb90D+j7yuCQJerlrP8hG9jjCk6Z0f9N4wpa4U2fakwZVfliCcrlyiNu\ndzP4VOBxYIl0KMZVsWZRSzuXgtddIz5oE49HfdTOW7uCj8Ioh7/xbSO7P/Bn\n4OFnDQb4G/8823rGj2DN8n+s33EXTKGPQ9ffmPe5KQJ63sf7Qco5rO/Y/d5i\nNydO\r\n=gJND\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA1MMo8OepRR7xun2EU11ZycN/+9dS63/avVncRb+P9QAiBd9jPkQ5pR8nfo/jFiqwV6ksCccL2vHJK3OxLGldg4HA=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.22.0-canary.b94d7187.0_1620759095821_0.7967618084491133"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.22.0-canary.4021b2f9.0":{"name":"@material/mwc-textfield","version":"0.22.0-canary.4021b2f9.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.a23ecb682.0","@material/line-ripple":"=12.0.0-canary.a23ecb682.0","@material/mwc-base":"0.22.0-canary.4021b2f9.0","@material/mwc-floating-label":"0.22.0-canary.4021b2f9.0","@material/mwc-line-ripple":"0.22.0-canary.4021b2f9.0","@material/mwc-notched-outline":"0.22.0-canary.4021b2f9.0","@material/textfield":"=12.0.0-canary.a23ecb682.0","lit-element":"^2.5.0","lit-html":"^1.4.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.22.0-canary.4021b2f9.0","@material/notched-outline":"=12.0.0-canary.a23ecb682.0","@material/ripple":"=12.0.0-canary.a23ecb682.0","@material/shape":"=12.0.0-canary.a23ecb682.0","@material/theme":"=12.0.0-canary.a23ecb682.0"},"publishConfig":{"access":"public"},"gitHead":"535a4442352f807e1f7e655d0a135c6d12906ed7","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/535a4442352f807e1f7e655d0a135c6d12906ed7/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/535a4442352f807e1f7e655d0a135c6d12906ed7/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/535a4442352f807e1f7e655d0a135c6d12906ed7/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/535a4442352f807e1f7e655d0a135c6d12906ed7/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/535a4442352f807e1f7e655d0a135c6d12906ed7/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/535a4442352f807e1f7e655d0a135c6d12906ed7/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/535a4442352f807e1f7e655d0a135c6d12906ed7/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/535a4442352f807e1f7e655d0a135c6d12906ed7/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.22.0-canary.4021b2f9.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-ZCsA7ApVeMsTiixjBWhGf7AM/vKU+rqc+FuYEmu6eSKmM77ADWFsqkF+2y/OM4NezUiq0h/RxINLPpGzIyiXHg==","shasum":"b3b368da7859c207add968e89aa8f4d2b05ca14e","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.22.0-canary.4021b2f9.0.tgz","fileCount":13,"unpackedSize":204960,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgnE/6CRA9TVsSAnZWagAAuPsP/jb3Yz5gKljWEx1mmmaW\nwrbOAcBnfkgRkNgMxtLd410UnDuSnlkvl17pVc+OaA8QIAIoFuY7KdYx/fTi\nFA4O5BL6VCtnJ1sFSDN27+mQ3Z6Nj4ycEpy2IIyVzhdkRpxo13dopyfNzSJO\nyaMOILH92X6npZ3nm3YyI4U5RpnQvLgR1ssP8X/nN8ZW3hmOP1xfOCA1sptB\nZPkZ6txvXbrpPEOyN9X+rO0fbIdHUiL37jvRV00pcTZsGOMqF3/YuRzt9lrI\nNQaLhhsk+Ja91qOECoGn5LedY98CL3I+tLOZoGzf0X5k3K8PJfxZnGBPfltD\nZiw7GP4FVWEhVn2VTScQUlaiCtFongPug1/A7J9WPsyvnfKoNxxk8v2lBOye\n2kT35HCXiFFzJWGaOi6ydMbyR6qIqzeXMkA8ybuqV4K9V3aZa1HlzTYsPbDA\nBUjtDbe/bMQ9mckXV/YPrh4HXRg4KbaUu/Ke4/7aLIWcfftOgFUU92+BoTHw\nUH619ySp+oOChjJ44mEAvPdmicxN0zvo80bCGxQh/C3y7AsEQke4QUvA1RzR\n8a9lpxNfNieOeXyNmqB+psCObb3i2oYyIWikWE4kr+DT5tL5aZIg5tspYCq1\npG5zbeNfB3dMqSuZpcs2XRTibU6/WcredKjg+C5XcjTcBe5FRTen3K9ZddJM\nFlII\r\n=1lIm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDI6Wl3fbv7teTqT+ZHFqwRLNJzMoGq8Da9dacBGIFm0gIgYqOGGMh994syqfp1inc5ZsTMBxFml63Xh2cf3U59P1U="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.22.0-canary.4021b2f9.0_1620856825833_0.5653658861572102"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.22.0-canary.6a5956a3.0":{"name":"@material/mwc-textfield","version":"0.22.0-canary.6a5956a3.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.a23ecb682.0","@material/line-ripple":"=12.0.0-canary.a23ecb682.0","@material/mwc-base":"0.22.0-canary.6a5956a3.0","@material/mwc-floating-label":"0.22.0-canary.6a5956a3.0","@material/mwc-line-ripple":"0.22.0-canary.6a5956a3.0","@material/mwc-notched-outline":"0.22.0-canary.6a5956a3.0","@material/textfield":"=12.0.0-canary.a23ecb682.0","lit-element":"^2.5.0","lit-html":"^1.4.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.22.0-canary.6a5956a3.0","@material/notched-outline":"=12.0.0-canary.a23ecb682.0","@material/ripple":"=12.0.0-canary.a23ecb682.0","@material/shape":"=12.0.0-canary.a23ecb682.0","@material/theme":"=12.0.0-canary.a23ecb682.0"},"publishConfig":{"access":"public"},"gitHead":"1164d783391049aa2ff9412e519af87df40b5406","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1164d783391049aa2ff9412e519af87df40b5406/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1164d783391049aa2ff9412e519af87df40b5406/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1164d783391049aa2ff9412e519af87df40b5406/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1164d783391049aa2ff9412e519af87df40b5406/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1164d783391049aa2ff9412e519af87df40b5406/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1164d783391049aa2ff9412e519af87df40b5406/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1164d783391049aa2ff9412e519af87df40b5406/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1164d783391049aa2ff9412e519af87df40b5406/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.22.0-canary.6a5956a3.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-WmAyY3wje8t9lBloOl9ZuzDdtyecinKdC2tkilE+w20g+3/HPwKyrjfEM8wTG4Lg1eVttT1l+RjcuczS3/ScSA==","shasum":"fe0558e1ef287aea9b020c31dd14a7f688a330e9","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.22.0-canary.6a5956a3.0.tgz","fileCount":13,"unpackedSize":204960,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgnFPxCRA9TVsSAnZWagAABE4P/1BkQLlhuiJTG+naDCNR\n1pPHlKbNXIjNjshYYhcTb5e0afds4PTWZPmMN/utN87vUqH5STztNocrcEX7\neawROPNYGL6KTFfuadg4RSx+SsOZjyBgmNo2OsPb/nnOA1Pq3PMpUzgVsM9c\nZLu2XQZSsfszsiz83I6YtC+bLY7J4Y5xIXGyWhmBB5sYd/xlC/6ln1u3rGFJ\nKgJ6v/DAaANhTCgDpnCIeelqgLEltBGKTuUwMlq/2a3eyXFMCzen/41HkPVB\nj1FyNfCNm7d74CK4a9yyAPOHArz1RBQs+tjJlvwa64ZPD3RtA5eW2EsdPuQ6\n8Lx6bt77ASQrvlLQ3JwRnS17lFNlFxyISvOR1LAg8scbGCE4HHTYbesCwWkU\nf2woAdHvdj3PDfm/I4+h0rEqElbCkAfWpYt/Hcprb+pj2F1vCpNHBFeybj9y\nAdxcmQw/IOLmyA6slocxg5FZEGvZOW9XhPIZzxhY4pWFGh87vuWCXx2rTs54\nhxUWlOKJkhNgujv9eodW3j8pKpF9W2hqKTyYGIdB0Mr+XTiXcItvydwSE0UL\nGorsgkhjSwVOcDNvBBF6adplhR3L6HzFzbbVnOypG8bJqujl2tkbUc3RMB3u\n66F51sQVcvd2qW8cDhAcghQwfXR8Thw6l7w6jfNMm7oyB6RtDFCfYp6FfN6D\nHBfX\r\n=j7Ip\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEAnOXtFXHGA3CV18BLJw32pC1+uyTN5cbqhzPQGhiAMAiEAi9yFU7lQpYRh5sj7TgcFYCJGRH1TgLmZyoxS70MZEAY="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.22.0-canary.6a5956a3.0_1620857840926_0.7185355768454886"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.22.0-canary.b6e8a74b.0":{"name":"@material/mwc-textfield","version":"0.22.0-canary.b6e8a74b.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.a23ecb682.0","@material/line-ripple":"=12.0.0-canary.a23ecb682.0","@material/mwc-base":"0.22.0-canary.b6e8a74b.0","@material/mwc-floating-label":"0.22.0-canary.b6e8a74b.0","@material/mwc-line-ripple":"0.22.0-canary.b6e8a74b.0","@material/mwc-notched-outline":"0.22.0-canary.b6e8a74b.0","@material/textfield":"=12.0.0-canary.a23ecb682.0","lit-element":"^2.5.0","lit-html":"^1.4.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.22.0-canary.b6e8a74b.0","@material/notched-outline":"=12.0.0-canary.a23ecb682.0","@material/ripple":"=12.0.0-canary.a23ecb682.0","@material/shape":"=12.0.0-canary.a23ecb682.0","@material/theme":"=12.0.0-canary.a23ecb682.0"},"publishConfig":{"access":"public"},"gitHead":"09c41b7e9637c49faa75e5ac84cc73c8bb5f80df","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/09c41b7e9637c49faa75e5ac84cc73c8bb5f80df/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/09c41b7e9637c49faa75e5ac84cc73c8bb5f80df/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/09c41b7e9637c49faa75e5ac84cc73c8bb5f80df/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/09c41b7e9637c49faa75e5ac84cc73c8bb5f80df/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/09c41b7e9637c49faa75e5ac84cc73c8bb5f80df/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/09c41b7e9637c49faa75e5ac84cc73c8bb5f80df/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/09c41b7e9637c49faa75e5ac84cc73c8bb5f80df/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/09c41b7e9637c49faa75e5ac84cc73c8bb5f80df/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.22.0-canary.b6e8a74b.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-ykqRVeSqQHD85iyB0BDAcKUIvoj1u2o+qHItDDEesLNv2V0r9kRHaTasXXgs7V4U48nnyZVGaXnpdP9xVkhEhQ==","shasum":"c5d9402095a878d7addb1d6e5604d6b2ef3300df","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.22.0-canary.b6e8a74b.0.tgz","fileCount":13,"unpackedSize":204960,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgnF65CRA9TVsSAnZWagAAWDwP/j4S9jhzJdDU+9NJ05jp\n1sjvRLvO1hPookZynEPyvl1YBZYqZz9Kk90HH3m5Qzmx6v7v3vv6QpdiURsm\nx3qX2u0j8c1jp/3G5yo06GJi/I6OUPKx3EguynDPKBhWlEPQ4bQtQV+R7bDR\n6ODX7UMVnDIhI/uJAXZkheQV+5W+nL3Wk0ks4rYBwTpot5v1E+SYzhDotB8C\ntRFz/8viN+6NLXxRcNpYGQPtU3KweS2639Fli9fjJ+ppuUa1+U4UPEAVC36o\nEGu4+7XF+6ilYMyWSbFB/xs8qZ4vAO7/uNT02OLY9BzvvsyVb6nzB2ZJySf+\n4PI5fj50NoNfu2jQaXtgiVJASXX9V1jTy1hT4KDStjZAekMZk9EXwZ8k1Gx2\naoaqCu6/JEvlLaJBhPCTLV407rLl+w/jX4rtKfxJqaih6UoL1WhuLvKTzcWa\nD69IbWsacJ04exIyVwE1YK3gBBe2iMaN0Lo458m+7ckUfGl0cflvV4HpvSSB\nFhmv3mz4HKOLPMX3drB3j61AChrZKxxsskHR0Q32NQa/I+pi4R1Zs/mrght9\nL0hB5wS3/aX0UARq4SuAqrw7cExIuL4jO6FqShXbBCR6F0gK4DziNd6je34D\nDCpazL/NhUs9lvDoNQ1irNQnsqOpAQG4xuSLeUlmzsGtaXvefZBxQDABqM3a\nhGlE\r\n=qh6j\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDPRgwvX1MrN7jLSuOZIqYOS+IAutloUmRckDqsx1d0eAIhAI/rnZLjRG1ToHQgtqCHAjcZenKUst18GaXgKe31IHTC"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.22.0-canary.b6e8a74b.0_1620860601367_0.9765473678657399"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.22.0-canary.c94e1030.0":{"name":"@material/mwc-textfield","version":"0.22.0-canary.c94e1030.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.a23ecb682.0","@material/line-ripple":"=12.0.0-canary.a23ecb682.0","@material/mwc-base":"0.22.0-canary.c94e1030.0","@material/mwc-floating-label":"0.22.0-canary.c94e1030.0","@material/mwc-line-ripple":"0.22.0-canary.c94e1030.0","@material/mwc-notched-outline":"0.22.0-canary.c94e1030.0","@material/textfield":"=12.0.0-canary.a23ecb682.0","lit-element":"^2.5.0","lit-html":"^1.4.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.22.0-canary.c94e1030.0","@material/notched-outline":"=12.0.0-canary.a23ecb682.0","@material/ripple":"=12.0.0-canary.a23ecb682.0","@material/shape":"=12.0.0-canary.a23ecb682.0","@material/theme":"=12.0.0-canary.a23ecb682.0"},"publishConfig":{"access":"public"},"gitHead":"01e4fa09129b5963d59405355762cbd1962f1198","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/01e4fa09129b5963d59405355762cbd1962f1198/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/01e4fa09129b5963d59405355762cbd1962f1198/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/01e4fa09129b5963d59405355762cbd1962f1198/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/01e4fa09129b5963d59405355762cbd1962f1198/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/01e4fa09129b5963d59405355762cbd1962f1198/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/01e4fa09129b5963d59405355762cbd1962f1198/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/01e4fa09129b5963d59405355762cbd1962f1198/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/01e4fa09129b5963d59405355762cbd1962f1198/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.22.0-canary.c94e1030.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-qDN/yvcpjKi1yRbbb4AoixieNsEMoTQTw8xmHTuZXOtBsHEH1wxYH52RpzsHjRpeA0HQ2sjKQ9G+hgXYChRp2Q==","shasum":"da92719a76e7ddee0dcd9d0d1f64632c436e99f4","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.22.0-canary.c94e1030.0.tgz","fileCount":13,"unpackedSize":204960,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgnGAWCRA9TVsSAnZWagAAOtkP/0eDKE+uuTKEzpkmJVMf\nww+kPxXlsPSPVMLYo49Nz6gQCEDoPzhNSIkJu/KBV7W+gzhfDXxZ9xQze3yv\nphxDeu21et/abcQ5jkerwn/sUvnorqZTqrKBzOCsJg2yV2I7rBCgr0/u84P5\nFLrfVMyY+nfLZoadi9vmvRPU68TzADgyl2TtZwd66xr/HbQJVZC2O9IvjNrb\nvjcUQM1l0lGvN7qj+il/SvoXb7ftQD81TvoHYKRaNajq9egt8JVqNa746CGg\nnwLU6omZx74LCTkzsIJdQCn3GAuSMN/omK4tT3XqgAYJNg3rHopA9IMtDknI\nynvMatfaCvet8s0DdOAE5plia6OsgJbS/4inzeWgyav4vx6diVZyFbNyQGhQ\nFxXHIY1EHLQkmcySRbJHvResET8EDYL4BhVg5umtamyplmdAe3Xx+RBczj5a\nL6N77yeLS4Td3ofb7BSwh9Ei1uL0h9mR/K3rSgQuqIbguvkIJSZx/VvdOcfq\nAsFot9DHU7k+LzfxmDiNUHdAlbxJ2A6OK9Cp7bwrmMNioEksp+B8Bw6Unvu1\nEJseMV6TF/Vo7dsvcc13g1O0BilbXMu4We/v7Gf32RcrsLB/40TEzfTmtYIS\n9xTBky8M+gqMoHFjOW8Glxk5TxbaDcqqy/d+xIk0vebMNmVfFnThd5X8xmTX\ntOc7\r\n=mu/C\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIETvZtqGKQsvV4zuQyxJJHp4BhT7YQOUmRZaNawmLlfcAiBlr3Mu2csrVNhWR9r1cxk9MEuLjxXfukmvb4oFuH4rGw=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.22.0-canary.c94e1030.0_1620860950525_0.36476529786806755"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.22.0-canary.40a34e35.0":{"name":"@material/mwc-textfield","version":"0.22.0-canary.40a34e35.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.a23ecb682.0","@material/line-ripple":"=12.0.0-canary.a23ecb682.0","@material/mwc-base":"0.22.0-canary.40a34e35.0","@material/mwc-floating-label":"0.22.0-canary.40a34e35.0","@material/mwc-line-ripple":"0.22.0-canary.40a34e35.0","@material/mwc-notched-outline":"0.22.0-canary.40a34e35.0","@material/textfield":"=12.0.0-canary.a23ecb682.0","lit-element":"^2.5.0","lit-html":"^1.4.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.22.0-canary.40a34e35.0","@material/notched-outline":"=12.0.0-canary.a23ecb682.0","@material/ripple":"=12.0.0-canary.a23ecb682.0","@material/shape":"=12.0.0-canary.a23ecb682.0","@material/theme":"=12.0.0-canary.a23ecb682.0"},"publishConfig":{"access":"public"},"gitHead":"6cf3913b43a92723ad4d1144b964df3a8667ed7e","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6cf3913b43a92723ad4d1144b964df3a8667ed7e/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6cf3913b43a92723ad4d1144b964df3a8667ed7e/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6cf3913b43a92723ad4d1144b964df3a8667ed7e/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6cf3913b43a92723ad4d1144b964df3a8667ed7e/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6cf3913b43a92723ad4d1144b964df3a8667ed7e/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6cf3913b43a92723ad4d1144b964df3a8667ed7e/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6cf3913b43a92723ad4d1144b964df3a8667ed7e/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6cf3913b43a92723ad4d1144b964df3a8667ed7e/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.22.0-canary.40a34e35.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-fom+0rmoeeOyevzRYpUuv7ph9mHzLXy/t7CA2JVxa/Gx/vZ8iHSfIm15Ro62rrrn5GbrG07G1T2eHQO1m3Oqkw==","shasum":"e324b7584476ecb7e9f3adae89e01f16c5a939d8","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.22.0-canary.40a34e35.0.tgz","fileCount":13,"unpackedSize":204960,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgnGubCRA9TVsSAnZWagAAGEQQAKINwQFzWLPYB2bKtVS/\n5cjDYpuPpzcIP6X+tZB8AUkco2CWujqYpxLV0mUuR9BS5fvrzb3lwcluaRU7\n4VMQLWAGcykzfmOJL24/Wh6+cYXRKyG5ymcigv2qQ4Ji3yonLv4/p2TReD06\njiX+XxtP2lg47TLcwUFaEm+Hs9HOYB+5eTXlvRqlg5L9eRmJQQ94c3t45QFm\nTPxuhTBW9x64AioLMqVFQs+W06DHNBRZ91tX2/bsGOHwGoxxmtCQSjerYGku\nxQ4jD+bt72YhSeBbWkF6kfNpD+yVHnxMhlSbWdWzP4A5tw2RmnZahTTJI34H\ntA0IdBeeDCUnBbwdafuhqm4btd4N5KXO9dVb6ePO51IXvoyLNAeRKbkY4Tii\n8387+fHCSqE0M5DaE8y8pxp7wm5hh1kNEqpC8aYKUSc1v6SFY2zp+olCmQ8W\n5gihPRklHfpAS1HVCMh1xOz3D+lqRmMmkvHysUCQ71VDGGiUBRJ9vzXlgyUN\nJkzamNWezvL4mpcoRyHtobckAMMjg0Eg0o1Vr+Di1rHpenOYQsAfeNImcY6V\nInkUYw2DBGo/2RO8rebKLlrI0RpxlybngskZrRTbC425DTFPNEHa1+yNupsU\nPQyqiJzhn3bF3nSWlzEyPVpm3l13P4HROgcez/v5B9/VmdhEJcJKMjnq9kP0\nvvm5\r\n=8Fc9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD1In8sFB6L1mx2Sk1JekILxc9MrDievBqQNPAAmwzXnQIgYi+pRp7bv6nmTPBCEuKOgzh1zPAPrT9leGnqFsRsA1w="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.22.0-canary.40a34e35.0_1620863899423_0.15254550912514775"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.22.0-canary.1be14d2c.0":{"name":"@material/mwc-textfield","version":"0.22.0-canary.1be14d2c.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.a23ecb682.0","@material/line-ripple":"=12.0.0-canary.a23ecb682.0","@material/mwc-base":"0.22.0-canary.1be14d2c.0","@material/mwc-floating-label":"0.22.0-canary.1be14d2c.0","@material/mwc-line-ripple":"0.22.0-canary.1be14d2c.0","@material/mwc-notched-outline":"0.22.0-canary.1be14d2c.0","@material/textfield":"=12.0.0-canary.a23ecb682.0","lit-element":"^2.5.0","lit-html":"^1.4.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.22.0-canary.1be14d2c.0","@material/notched-outline":"=12.0.0-canary.a23ecb682.0","@material/ripple":"=12.0.0-canary.a23ecb682.0","@material/shape":"=12.0.0-canary.a23ecb682.0","@material/theme":"=12.0.0-canary.a23ecb682.0"},"publishConfig":{"access":"public"},"gitHead":"2fcf49467ff2fdbb2ab4a987563f556e6ff316d6","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2fcf49467ff2fdbb2ab4a987563f556e6ff316d6/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2fcf49467ff2fdbb2ab4a987563f556e6ff316d6/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2fcf49467ff2fdbb2ab4a987563f556e6ff316d6/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2fcf49467ff2fdbb2ab4a987563f556e6ff316d6/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2fcf49467ff2fdbb2ab4a987563f556e6ff316d6/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2fcf49467ff2fdbb2ab4a987563f556e6ff316d6/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2fcf49467ff2fdbb2ab4a987563f556e6ff316d6/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2fcf49467ff2fdbb2ab4a987563f556e6ff316d6/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.22.0-canary.1be14d2c.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-m3tiV8jTPpiLcpW0B9oQJDpjzIlByKpJAYxc/oa+NFRsPxN+RNtMYkqwnR9WSe7y8Ahkl/3j5NnOCmwt7IXZdg==","shasum":"d2bef041b22b93724fef244d4a05fd913f2c5def","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.22.0-canary.1be14d2c.0.tgz","fileCount":13,"unpackedSize":204960,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgnWbQCRA9TVsSAnZWagAAVp8P/AtDvXdItuLvnyYI1DXQ\njJ6ZNzInHx0uTQFdfluUhF1nsxGEaYPHt5qreKCnE6SjB+PZWq36jBRI+Ltk\nrfQrz3+FmyH386LO3ixk99RUfaNTMciSQ2f1Vmgcrb70YZhJp30RbiSgmKdC\nVP79U9MbG9+JMDsRD67+Ao/2FykV2IZhny/c3Q5eZIV7hMoEWeJnqJQ8TRXc\nUbvWbZyRkwk6SEd7mNRBu4Nr5bBdkf3ErbLDOl/9Br8wukhvSnSMq4hFqMKu\nmbUTYs2X///A+PTiHWSJ3/rJJMSUjxILAScDwhtiZRO0hWDPFuo45u/4rOta\nCDiA9cWwY5hBiqaBKAdbFPHxA25i3ELF1dPRP5DLnuL3HQ4w1nLChSXjxiBH\nQq1iIr2XnhQJS+S5bTyR0o51j9FsvDVRA8CFcIdFuG5eoMj+oZs1+3J4mn3t\nrG7BjH69ZRFw+yibuZ1vDbK12c3DheJIjNq9L4oa3XDC04UAfAbGP+ljSO5T\n+Ro7f3+7jz9i8G54DKoZc9tKZX7njMTkmO0QZVuq+DyyZziqgQYnO6f1Ko1g\n3FhTEB7I2BSpVKPw+rJvxfxsa9+LspL0AvrMtv9K9qzs9rqbheWTbQt4CYUS\nQYXJbfZUZp9tUnvGU8Ua+wv954bhwXO9WDS4GdvRJ44m0iaHgjtlA3bm45m2\nYuNs\r\n=IooC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAnFkyGBHvYx9K5il0MwkNVOwL1K11OuJBkztjZDQmBTAiEAq5CYbsHb1cSxzOQibsQ3+RaN36qLCrJa8bjP6uzY6LY="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.22.0-canary.1be14d2c.0_1620928207713_0.4695737064350822"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.22.0-canary.87dbd64f.0":{"name":"@material/mwc-textfield","version":"0.22.0-canary.87dbd64f.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.1a8d06483.0","@material/line-ripple":"=12.0.0-canary.1a8d06483.0","@material/mwc-base":"0.22.0-canary.87dbd64f.0","@material/mwc-floating-label":"0.22.0-canary.87dbd64f.0","@material/mwc-line-ripple":"0.22.0-canary.87dbd64f.0","@material/mwc-notched-outline":"0.22.0-canary.87dbd64f.0","@material/textfield":"=12.0.0-canary.1a8d06483.0","lit-element":"^2.5.0","lit-html":"^1.4.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.22.0-canary.87dbd64f.0","@material/notched-outline":"=12.0.0-canary.1a8d06483.0","@material/ripple":"=12.0.0-canary.1a8d06483.0","@material/shape":"=12.0.0-canary.1a8d06483.0","@material/theme":"=12.0.0-canary.1a8d06483.0"},"publishConfig":{"access":"public"},"gitHead":"5b6b91a042dd241b949278a5e56cf671221e6a5a","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5b6b91a042dd241b949278a5e56cf671221e6a5a/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5b6b91a042dd241b949278a5e56cf671221e6a5a/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5b6b91a042dd241b949278a5e56cf671221e6a5a/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5b6b91a042dd241b949278a5e56cf671221e6a5a/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5b6b91a042dd241b949278a5e56cf671221e6a5a/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5b6b91a042dd241b949278a5e56cf671221e6a5a/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5b6b91a042dd241b949278a5e56cf671221e6a5a/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5b6b91a042dd241b949278a5e56cf671221e6a5a/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.22.0-canary.87dbd64f.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-Xr5yA5DXQVFu2A7Q4CFrk9IfKbQqmZZ1tFaxM4I+EtmUTkIfz0cYIpKDlBCAtVoAVdFbzNvimoIY6ux1caFuFQ==","shasum":"1d7ea026d8e1c16efa6e6817c36d30f82aa0ead7","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.22.0-canary.87dbd64f.0.tgz","fileCount":13,"unpackedSize":204960,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgnuRxCRA9TVsSAnZWagAACdcP/3G9P/a/TZ2IeCEq8YId\nP1rxAslLjhRSeM3D8ryKdHUCgdGFbj2roTbsTwXxV+WqChr5cqrCRwGZSHtR\nKkGqwAa664wQiJlZhds8sIx29w13ITlBMNAfJV8zxTFtU/ZVjuZwMbIiAqio\nOXeKZ9epOM2AVZqdxkkAV9hrVASD4rO8yhnB45iO1U3Ekao4i4LC8kZXa1zs\n480LgZuhxO0e/iEzImPcojb1SAQYN84ZtOESdaTOvBnbMr4eheyGzWzTxcUs\n/PyZNQNApNL9beenvT0bMzRnb+wGXEb1YovLiwiTUHhR4FTRp7fv3eor9cID\nTqIRBoAhN65SzO3NGkHRLVR8oZK7eNlhxZ1sGuKRj/uuQOlKyri/+1b49R5V\n1u82HqHeNi9ohb1tB35s5i9I/bba6ttFyPX8uQ5SUHEF0GS8/8yRPiRDOfiH\nKTrYPNl1u53VLF/Trr/2uKyEya74+Azv34NFPKrF9Ab4Va/Y3ImmXJYGwn5I\nlt0fq6BrZpwqR+zhwrykxEeLGsVa5Iz+vwHEwoPI+7jrHnaE8L4gZ4VKu0OG\npTOfnaehkHsRWBI91OTYfQtaBkHeFnpM6GLuBZvCFVH+j8aIsl/vYN5GCqIg\n/Z9sHOslzzrg5rO8/m5HoJiWSjTEtBSUrMKM7+0nbqH2oI5LH5lW3EZagQEN\nLL2E\r\n=6kVx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFM//9j9U+G1/HhxYHUMDCBKcM5Q0HIgVQFQCSmyRu4hAiBFSWGK0YsI1d8+0Esj155nJvJSfYH5eMT5RClfddZzZw=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.22.0-canary.87dbd64f.0_1621025905384_0.4235975642337657"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.22.0-canary.c452e4da.0":{"name":"@material/mwc-textfield","version":"0.22.0-canary.c452e4da.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.1a8d06483.0","@material/line-ripple":"=12.0.0-canary.1a8d06483.0","@material/mwc-base":"0.22.0-canary.c452e4da.0","@material/mwc-floating-label":"0.22.0-canary.c452e4da.0","@material/mwc-line-ripple":"0.22.0-canary.c452e4da.0","@material/mwc-notched-outline":"0.22.0-canary.c452e4da.0","@material/textfield":"=12.0.0-canary.1a8d06483.0","lit-element":"^2.5.0","lit-html":"^1.4.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.22.0-canary.c452e4da.0","@material/notched-outline":"=12.0.0-canary.1a8d06483.0","@material/ripple":"=12.0.0-canary.1a8d06483.0","@material/shape":"=12.0.0-canary.1a8d06483.0","@material/theme":"=12.0.0-canary.1a8d06483.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"30c4701f29e4afdbe58f6529e947eda655b1b1ea","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/30c4701f29e4afdbe58f6529e947eda655b1b1ea/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/30c4701f29e4afdbe58f6529e947eda655b1b1ea/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/30c4701f29e4afdbe58f6529e947eda655b1b1ea/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/30c4701f29e4afdbe58f6529e947eda655b1b1ea/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/30c4701f29e4afdbe58f6529e947eda655b1b1ea/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/30c4701f29e4afdbe58f6529e947eda655b1b1ea/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/30c4701f29e4afdbe58f6529e947eda655b1b1ea/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/30c4701f29e4afdbe58f6529e947eda655b1b1ea/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.22.0-canary.c452e4da.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-uzE4EgBPRPdV88379E+GfjgMyL8HPfN+x31rfOX4VTkcX7WadQCfTP9BJKl54L+k+Iy+BFlwUPU3egwsR5l/Nw==","shasum":"38e0cce5aa83835867e9cdb8e8ea3a687d56137c","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.22.0-canary.c452e4da.0.tgz","fileCount":16,"unpackedSize":300039,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgovzwCRA9TVsSAnZWagAAaoAP/REgfCUiWRspmMF0qNN2\n01fcQ3eJ3Cy8LqpKkHgkaYhvyWnyZ8JmPGys2ImA3PRZbD+aYKqD3yGKI19t\narZ9qNdhn+Z79CAFQWlXfdYazZGzBHgmAAZDgEuYI5PWDVDEGP5CFVj9KT/8\noxQkScTFC+2/a8fOmHilRIbvbpGatmGBF5oAcXAkCPt5TwqC72zv0ZAtll8Y\nMLOcd+yLVb00iEzp+U9eH4ape4a2DRWo/5ac1xbINcU65UtLJS+SrqPO9RLn\nqI5QLOemHsDoZgkFbmcbmzgE9PtN1jN+dtsSdejzEgnzqLp9oZzIotEjMlLP\n6W2cBvw1ZJ3Ye6Pf5wf1VzB9EKgCuJQE8tAwxSKO0L80zX+xq8ej//Y9DqEw\ncpHYnxVjbvui1f9JG0WwB4esDep4bomspyIlO3nA/mnbL1yiM2vMVWYxKIkX\ntzw5gTNPMXXSz1Tj8vkiVlFYoFx0RPAq188JgPFlnuJScySMO2YJMm7e+uzm\nUgPlA6KyvjXwQu+MxJmfM2lDuM9Ihjp43vLtK9o0s2yduNATyjEF685HJLF3\ngAOdtsXd+qHzUfcVwHOZj19xc11RvVTv8WjisuzbyZ+s8fk8aI9V70Fr/wA/\nJnNutbhUCD5wKdQd4EMdMdx5c3wsGFWW8/eksJiPy8RBXiqJ+u0Sin4Dl6Ss\n6bl7\r\n=vjMh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICkJ5HpbiNXOXwTnvlD0GDJTFFsaYJy6oAdHMHPsR8rDAiEAlwA7kwKTqEDvmT2U2bXI/FNwm0g6CjbT8YChcaT2iVw="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.22.0-canary.c452e4da.0_1621294319889_0.5505002461230537"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.22.0-canary.2212691a.0":{"name":"@material/mwc-textfield","version":"0.22.0-canary.2212691a.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.1a8d06483.0","@material/line-ripple":"=12.0.0-canary.1a8d06483.0","@material/mwc-base":"0.22.0-canary.2212691a.0","@material/mwc-floating-label":"0.22.0-canary.2212691a.0","@material/mwc-line-ripple":"0.22.0-canary.2212691a.0","@material/mwc-notched-outline":"0.22.0-canary.2212691a.0","@material/textfield":"=12.0.0-canary.1a8d06483.0","lit-element":"^2.5.0","lit-html":"^1.4.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.22.0-canary.2212691a.0","@material/notched-outline":"=12.0.0-canary.1a8d06483.0","@material/ripple":"=12.0.0-canary.1a8d06483.0","@material/shape":"=12.0.0-canary.1a8d06483.0","@material/theme":"=12.0.0-canary.1a8d06483.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"8fba3dfbfa73868ebfc76e8070cb5d33921df0f8","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8fba3dfbfa73868ebfc76e8070cb5d33921df0f8/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8fba3dfbfa73868ebfc76e8070cb5d33921df0f8/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8fba3dfbfa73868ebfc76e8070cb5d33921df0f8/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8fba3dfbfa73868ebfc76e8070cb5d33921df0f8/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8fba3dfbfa73868ebfc76e8070cb5d33921df0f8/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8fba3dfbfa73868ebfc76e8070cb5d33921df0f8/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8fba3dfbfa73868ebfc76e8070cb5d33921df0f8/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8fba3dfbfa73868ebfc76e8070cb5d33921df0f8/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.22.0-canary.2212691a.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-Jp4n7gc0LNOv9+iPFkOxdzBeeIksBHash++Qvk4vSe7nN8NaZUeNo9P0ewJ3ANMXzC73MICPZIoz/1NY7phhNQ==","shasum":"5431ec21a0d04a7097250cded9ed84e47f52d496","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.22.0-canary.2212691a.0.tgz","fileCount":16,"unpackedSize":296480,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgowHFCRA9TVsSAnZWagAAUQcP/RapkxMjVXhCXXE1yf2+\nGObbJgyRlkzO+0EySVsL9Clo3oBZU6o2dBU/aZhSo9B9wInBWejfWnc7iBqq\nCQDx/qidT54Ik4rOeSILm+qGc2PYmcj4AjOmoImxbjHF29ZFNoipAyWmBB25\ntWHSk3uOwuPTFYzah5cszbuibGeurfUxmeyXtNtFthxcNnpf+HSgT/7TgWOf\nIBNKOg2V1Zx+TNCcHT9bCNYI7u+lRNnWvTP3Xx6Al7HD55FEbvIgst8/P7QU\nAqs0SwQPUFIUpZWM3C7IhiXCm1ydWf/miCse1MypAZiNKGksBgLoJ5uVM3We\ntWyUjUyTVFs57cny/ERFuToxedZ17LQJj5XKJrdqr1nj9/qczD2RehQVNSjC\nGVYUmiP/vFbuD155SB/WFsSBHwOzGQ4XDFpWUvzVdBmcml8I4fZWr8R3pFi+\nDJaW1ABovvk1pXvamrwKCQgdeMcR7qkcNIavHNvA5rNgFKk8LMiu5D1Q8haW\nt0jdrZzitylklX/qyQgWxPHML21WIhlBCGMJXn2IzCyXdyHvko6lmTjy7IKj\n8fNUbg8673sCa5xPjkqd8qWNjNRLj7xHMud5O6WDKWDPuEYm6ea5fgjbzFxW\nvu1bLiWT2TtEJmwRmu3rodI97GarkGRypijzA5TutMfOBGLx9Y5cxaTBm9Tb\nEXhD\r\n=njKW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDeAcAkk/BBAsoi/d1SI2d9e1P1KpHNjYurOPEOHTvnoAiEAg1QTxQMbD0QCVKoiko7aRggd/NoBUUuQtoc8TuDp5fc="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.22.0-canary.2212691a.0_1621295556932_0.09031335128782825"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.22.0-canary.f748ff2f.0":{"name":"@material/mwc-textfield","version":"0.22.0-canary.f748ff2f.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.1a8d06483.0","@material/line-ripple":"=12.0.0-canary.1a8d06483.0","@material/mwc-base":"0.22.0-canary.f748ff2f.0","@material/mwc-floating-label":"0.22.0-canary.f748ff2f.0","@material/mwc-line-ripple":"0.22.0-canary.f748ff2f.0","@material/mwc-notched-outline":"0.22.0-canary.f748ff2f.0","@material/textfield":"=12.0.0-canary.1a8d06483.0","lit-element":"^2.5.0","lit-html":"^1.4.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.22.0-canary.f748ff2f.0","@material/notched-outline":"=12.0.0-canary.1a8d06483.0","@material/ripple":"=12.0.0-canary.1a8d06483.0","@material/shape":"=12.0.0-canary.1a8d06483.0","@material/theme":"=12.0.0-canary.1a8d06483.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"a83c1c5ee60e398896831041769b5c22e19b4621","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a83c1c5ee60e398896831041769b5c22e19b4621/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a83c1c5ee60e398896831041769b5c22e19b4621/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a83c1c5ee60e398896831041769b5c22e19b4621/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a83c1c5ee60e398896831041769b5c22e19b4621/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a83c1c5ee60e398896831041769b5c22e19b4621/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a83c1c5ee60e398896831041769b5c22e19b4621/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a83c1c5ee60e398896831041769b5c22e19b4621/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a83c1c5ee60e398896831041769b5c22e19b4621/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.22.0-canary.f748ff2f.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-Zfv/ZXyUwl5rdt7ZIhP8JPv/5MHdPYkNBUiQoJh5T0wsVbsfGzgA67+1sJ/5ImhodnKxDFsLa37wuA4kCYLpog==","shasum":"7fe6b0910998153c229f3435ad4fd67832213406","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.22.0-canary.f748ff2f.0.tgz","fileCount":16,"unpackedSize":296484,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgowjBCRA9TVsSAnZWagAAd7wP/1pNxOIA/XPlfyPv8hW+\n8DX7GuueoJrw3+VBytOeuRDCETX25yBnP2E+v2/nZaJJSVC6um3u2tmmqYpZ\n0om8wvTEHjMM/LnzBn6auDxNj2g2Wrk1SxolIuh3yHIhc4oHkhJi8FegJ1vR\nMvoASk1lnqMgBtSVa4vXP1nXap5j6Jd3EqpVKn1FertS6PWf6523D16wLWRl\nsof+nBUqO41xKLc40KjDZrHswJroKfHvQgT6RufMthD6jlx07rc/jWd8sGpR\nztFoeu93L2WaE0oGTsJCAWbtuPSIkR5cXIzFxycStdUjVk25IQ4MM3LYTquA\n93TFIjUmkE5sfG34uj66TQXM3cvdedBvQ58gchkF9MbHEJkTr9gwzKwg3PN4\nbb3SHz16IiZ2ZOPxSzwHTFDx+gXHnFONucnf+ETEkNmmo12/mh6MNQ2mw+f6\ntb0HYLHeNrMc8ITqjgyKjC/xLiwvYr/udZ3iIG7jFIg7ItV8uFz7xLu46oqR\nmqjpCcfQNyS/6f7smRCV6zTdxhQKr8GGS7qu5K6oJVN4K6LtUDIQydi3JKJU\npcJpKOxWm3tF/A5UA4qkYOEBrbZiXnPUEaJThQwIcAo+DXbvqd2EYXxT1or7\nj2DvrKYi1i0oscAH7goYK9KrMVFuems7KQHwN+HoMQYO3nUQ16d69GNUusbn\nkU+f\r\n=VPEE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCmcG/vDDNomQ6bff0/t4J76o6BukRXW4hDRU+Z5BcjWwIhAMa2QMgl+0WqC5RRqB23B+nFtaz+0C5OlyLlFhEQLqTl"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.22.0-canary.f748ff2f.0_1621297345395_0.9540001189573051"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.22.0-canary.cc04657a.0":{"name":"@material/mwc-textfield","version":"0.22.0-canary.cc04657a.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.1a8d06483.0","@material/line-ripple":"=12.0.0-canary.1a8d06483.0","@material/mwc-base":"0.22.0-canary.cc04657a.0","@material/mwc-floating-label":"0.22.0-canary.cc04657a.0","@material/mwc-line-ripple":"0.22.0-canary.cc04657a.0","@material/mwc-notched-outline":"0.22.0-canary.cc04657a.0","@material/textfield":"=12.0.0-canary.1a8d06483.0","lit-element":"^2.5.0","lit-html":"^1.4.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.22.0-canary.cc04657a.0","@material/notched-outline":"=12.0.0-canary.1a8d06483.0","@material/ripple":"=12.0.0-canary.1a8d06483.0","@material/shape":"=12.0.0-canary.1a8d06483.0","@material/theme":"=12.0.0-canary.1a8d06483.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"b1fa7339fbd44ff5149f7f38e481e6b0b6fd048a","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b1fa7339fbd44ff5149f7f38e481e6b0b6fd048a/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b1fa7339fbd44ff5149f7f38e481e6b0b6fd048a/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b1fa7339fbd44ff5149f7f38e481e6b0b6fd048a/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b1fa7339fbd44ff5149f7f38e481e6b0b6fd048a/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b1fa7339fbd44ff5149f7f38e481e6b0b6fd048a/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b1fa7339fbd44ff5149f7f38e481e6b0b6fd048a/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b1fa7339fbd44ff5149f7f38e481e6b0b6fd048a/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b1fa7339fbd44ff5149f7f38e481e6b0b6fd048a/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.22.0-canary.cc04657a.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-oG+1zyJvetvIpTk7i4eHWMpy/SmjWdFNnA5HOgpaehpkrA61+qJ3+t/HX70UF/XXOOxkA9tfLmhBLLBGlJVwhA==","shasum":"5e6990c2f2e36894ad6cbc1ac2ee0035dccef678","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.22.0-canary.cc04657a.0.tgz","fileCount":13,"unpackedSize":200482,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgoxaJCRA9TVsSAnZWagAAZN8P/i16l8ap5Rd43dnpQSJ0\nNoYkeTpcoYTmfT7JBVJ+IU8P8GuUqkuFPgnOM6lootdo01ZdrBiQ9mp9yL0q\noBqTa+axCPGjG1ho7RexJAMXfCs0uNA7PcVbi9OrWB/UHp/i3YU9RCBdSrnj\nl4Sqw+v/vKux/aSH7f3Bwj6kAzvgr1VBaROM9pD7y+yD21a6+tYing7UwvYM\n1dMc8dRYdF8kLRT/MaHHhsA6x3hRVH+lGJuRmVmaAksD4EQ32Ei3zuTmqvN6\ncM8ER8nQcAvrtlNj+IXcrZuAVq4JTlBLB7I06XFQKaVswznGF+RhnuBeIdll\n8/wgN7XRghCvFK3on8gqYHiWGqZIPDmCqzwXfJhi+egzZcgNcgiqLljvAyrD\nz4GIaGPRJgddfbzMMxVSFLc25ET8wdqvnm3wNtClfbfk0CLpiRB9VRbZYQvy\ntjKddOW4jxtL5C8RhidEdaexyTDqPjCAZRtRz+9J3i5Ytb/oB8ov0O9yrMc2\nhPVMmKwyt6/jrV7w/SUWpBQDAY/5NTR5ejUVNwOMRC2mu1Rym6EUzLZgqZ5M\nvylJAotbLYa+fKjwFZfggRBBL3vo5vYgiYmkqLp6bd79s/Obok7gZ1SFFOIG\nJ4ZuiBn1MmI0QUad/KUMNjq2MlKRc9c8Rh2JiBYbei0lHPlZsRL2awNhdur4\nhaW4\r\n=aG5D\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCzrm/JdQSrQzS0OBwra/SzfJIAckon4Mg1R+FRoYE4OwIgFjy4p9HcT57ZPvsV9HeA6JU3vMHw/soHX6VNBFumjmw="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.22.0-canary.cc04657a.0_1621300872502_0.7799019147355035"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.22.0-canary.3a3114fa.0":{"name":"@material/mwc-textfield","version":"0.22.0-canary.3a3114fa.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.4bb5eea2b.0","@material/line-ripple":"=12.0.0-canary.4bb5eea2b.0","@material/mwc-base":"0.22.0-canary.3a3114fa.0","@material/mwc-floating-label":"0.22.0-canary.3a3114fa.0","@material/mwc-line-ripple":"0.22.0-canary.3a3114fa.0","@material/mwc-notched-outline":"0.22.0-canary.3a3114fa.0","@material/textfield":"=12.0.0-canary.4bb5eea2b.0","lit-element":"^2.5.0","lit-html":"^1.4.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.22.0-canary.3a3114fa.0","@material/notched-outline":"=12.0.0-canary.4bb5eea2b.0","@material/ripple":"=12.0.0-canary.4bb5eea2b.0","@material/shape":"=12.0.0-canary.4bb5eea2b.0","@material/theme":"=12.0.0-canary.4bb5eea2b.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"217bbc3c5105a7f3ed67d47f0169dc3b8269adc7","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/217bbc3c5105a7f3ed67d47f0169dc3b8269adc7/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/217bbc3c5105a7f3ed67d47f0169dc3b8269adc7/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/217bbc3c5105a7f3ed67d47f0169dc3b8269adc7/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/217bbc3c5105a7f3ed67d47f0169dc3b8269adc7/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/217bbc3c5105a7f3ed67d47f0169dc3b8269adc7/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/217bbc3c5105a7f3ed67d47f0169dc3b8269adc7/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/217bbc3c5105a7f3ed67d47f0169dc3b8269adc7/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/217bbc3c5105a7f3ed67d47f0169dc3b8269adc7/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.22.0-canary.3a3114fa.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-BOi1MjuzEPfbFqzW/swM79/azKYpsSRAXyod8kqA7sTWt420N0E0et8l19TSi6IKmrwaN06v4U2xw0F/mDYlKQ==","shasum":"8eec3b2370274b61c7ee08013595cccdf9a0c663","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.22.0-canary.3a3114fa.0.tgz","fileCount":13,"unpackedSize":200482,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgpaHaCRA9TVsSAnZWagAA34IP/3Ht5R7Z6VB9yXEI/CXD\njgaIxLThCZr8z9L+NeMRIXuwKzQudV8qktQjDeGZtqeGK3cSMQVIc77Hj9nn\nkfgGKVyb9nmL/1NNkWRAqoLWRqm5iemUb/9apdl4iw/tnga44aGhnLWrIygT\nxrQCG2lmECseUeHpH9jd9jfvlF9nJ4zviDCJFO+j4uNRH5BxhjChknhRZ0Ez\n/VVL5U331vPsbSHFlg3WkB2Sd4lVs3N0POn9kVx6+7Glw9tOzrBpogh3It7H\nNkBItEYU33JYeF9LTqQ917zStgwtGLw5Tam842KpR1ydyD0hyr6fC1i+bmYv\nJFL3ZW+XPp/kc6VtueDtwjV1zuzGSmiVAdWq6xm2mgRrSDA9MRNqIQBSZaJh\nsM56bkGN/ef8je6+r6wuCLopo/Jq7hk3pSpaVAqLt5XsOJWN+FF8y9Epdxyz\npwsf+nMo7E/JlWPWEvzyOLuz/kL0FBgmq0KgK18CH9+659qeP8BbCLaqt2X3\n6vj7szO/TPsRnRqpSRbbnUqs/yKRCw/ZAhuhPCrM3Jiop9YfRDACrVmO7N/H\n7xhjWhbqWRcT/nsZa4bnIKErgLA3cUDGikDYHdPB7ijiVj9ZgbCeeYbFjXwZ\nYLuUB9q4IvZgzJoYoNLmBgMqLeh9svSzaG6JzIGGu4u8Mq7zJlWvYXDgwTx6\n14w5\r\n=WG/p\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFWh2AyoX0LYfAv+orRGhlJmorhGs1VOjUxK/KZe7kyFAiEAvcRxgrW/CLtjIhaLC+zs+Ui5Rn21H3SP8yM1pVIecJg="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.22.0-canary.3a3114fa.0_1621467610301_0.1262362227548115"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.22.0-canary.b46bdf83.0":{"name":"@material/mwc-textfield","version":"0.22.0-canary.b46bdf83.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.4bb5eea2b.0","@material/line-ripple":"=12.0.0-canary.4bb5eea2b.0","@material/mwc-base":"0.22.0-canary.b46bdf83.0","@material/mwc-floating-label":"0.22.0-canary.b46bdf83.0","@material/mwc-line-ripple":"0.22.0-canary.b46bdf83.0","@material/mwc-notched-outline":"0.22.0-canary.b46bdf83.0","@material/textfield":"=12.0.0-canary.4bb5eea2b.0","lit-element":"^2.5.0","lit-html":"^1.4.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.22.0-canary.b46bdf83.0","@material/notched-outline":"=12.0.0-canary.4bb5eea2b.0","@material/ripple":"=12.0.0-canary.4bb5eea2b.0","@material/shape":"=12.0.0-canary.4bb5eea2b.0","@material/theme":"=12.0.0-canary.4bb5eea2b.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"9095fd5cb7570c346d2093f1eb444f3035718920","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9095fd5cb7570c346d2093f1eb444f3035718920/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9095fd5cb7570c346d2093f1eb444f3035718920/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9095fd5cb7570c346d2093f1eb444f3035718920/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9095fd5cb7570c346d2093f1eb444f3035718920/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9095fd5cb7570c346d2093f1eb444f3035718920/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9095fd5cb7570c346d2093f1eb444f3035718920/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9095fd5cb7570c346d2093f1eb444f3035718920/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9095fd5cb7570c346d2093f1eb444f3035718920/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.22.0-canary.b46bdf83.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-iPLPjgwPmKeEAIjARyHrtzsuXJxVMoNeUQ8BW08SlkKui9NVgPPdNtxZIxRF3ZrOgFqdVdEObrWjpC6L2p/Jyw==","shasum":"d16a15f9fafaf898ede8c19a12d4884d56adb4a6","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.22.0-canary.b46bdf83.0.tgz","fileCount":13,"unpackedSize":200482,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgpcCCCRA9TVsSAnZWagAAPYkP+wcJ8OwOr5KLaqLDQeQ/\nWtpvU0R2Yyw9HeafZ9BaeL9+LnWW+LTH7s7lWAiG14WpZk9Os/C4mUMSSSN1\na1XzM9+3c7UgAWLihpKbG0R8Y4wUySu6gVOe9YqAl5UNnCoKy+oy6KJo2Omf\n69MjcJHORcvN8o34Dy1mnhcfqaS0BNoDHYa/HF9MOLoPvTetES+TYAnonBID\nH4flyZPMr/Cpo290gMVRlhCbLUWMKh9rb6fw+Nfzyw68mg3qTuS/rlo4fCw0\nAHoC6R7T/dDtvp4SCqVC03jlnqcOOwJ9hjXJUEju0yKjQg64YTayFTkN85kd\npE7+2l6E0R59OhDVwSa9YyjD5OrIb1S3UQXEgSr11+5T+aahmsJuZtyYTBXe\niFG3k9yX7GEmA4qLNiY7RsLQtk/uzU1yG3M+N3m2PI+8GHOPQHEyFD0nc6Y8\n4qhzqs5pR8gcjY4Wsiu3/5POXN4/NUrxbreYl3gt+EnM5q+Lroij5gahYC5l\npq8mUUs++rAUUDgQ9JXbeM0WGbaMjdOCDYO6DgCzMKCX2a0gGxlt6vwIxMxw\nlVuzJ5bAxGr+K+tXQYbrjF0Gpn7hc1oi3PaVsWpPrpCOKh7cdJlNaWAiUwNr\nk2ZqxN77hdcHCP/cJ85Q2DxETe7FYW4AmlLL+odpbeRixniLOzT9zx3d1kQl\n8+08\r\n=cDF/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEhHmCjyFxT1IOfk8l4Vx0odn0O5C+wJnN8kMXrNJgS1AiAb0KKdXiuW9XVDr+PW0dANQe8EhRwNgWfRz04Uifz0+w=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.22.0-canary.b46bdf83.0_1621475458148_0.8552786974341589"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.22.0-canary.b401a081.0":{"name":"@material/mwc-textfield","version":"0.22.0-canary.b401a081.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.4bb5eea2b.0","@material/line-ripple":"=12.0.0-canary.4bb5eea2b.0","@material/mwc-base":"0.22.0-canary.b401a081.0","@material/mwc-floating-label":"0.22.0-canary.b401a081.0","@material/mwc-line-ripple":"0.22.0-canary.b401a081.0","@material/mwc-notched-outline":"0.22.0-canary.b401a081.0","@material/textfield":"=12.0.0-canary.4bb5eea2b.0","lit-element":"^2.5.0","lit-html":"^1.4.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.22.0-canary.b401a081.0","@material/notched-outline":"=12.0.0-canary.4bb5eea2b.0","@material/ripple":"=12.0.0-canary.4bb5eea2b.0","@material/shape":"=12.0.0-canary.4bb5eea2b.0","@material/theme":"=12.0.0-canary.4bb5eea2b.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"3f253eb320a1f9b9e236e2c6c0503900e63e2c6b","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3f253eb320a1f9b9e236e2c6c0503900e63e2c6b/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3f253eb320a1f9b9e236e2c6c0503900e63e2c6b/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3f253eb320a1f9b9e236e2c6c0503900e63e2c6b/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3f253eb320a1f9b9e236e2c6c0503900e63e2c6b/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3f253eb320a1f9b9e236e2c6c0503900e63e2c6b/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3f253eb320a1f9b9e236e2c6c0503900e63e2c6b/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3f253eb320a1f9b9e236e2c6c0503900e63e2c6b/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3f253eb320a1f9b9e236e2c6c0503900e63e2c6b/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.22.0-canary.b401a081.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-zM3G7G1Gs23XQw90QvajWh3mDLkLHNTjk8d9KxIa2wllfMGAejqGWk8DqLObPQoQr+wZCYHg8qH9HBolAodpug==","shasum":"d78d556177fc99982f2afd8d0cb047af73d8eb8e","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.22.0-canary.b401a081.0.tgz","fileCount":13,"unpackedSize":200482,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgqEDSCRA9TVsSAnZWagAAgR0P/iXSg+l9OnE2/uqWG+j9\nUPF5oiB6lIsa6PEQGz3baDv81nR2T+m4F8Yu5unWPke6vRnrVt0+s9LYhFQP\nwyx9cV9DU0HcWmXc1QHIheGMTQOOkArr+7y94Mtxnd2pY9iQPGumwu9Db8Nj\nrn48eKYVnMD7NAF57GJoLQCfo/ftzSkcIDDeQPMJAP8Ow1cwin2fS6J7U501\n4yf+3z3BkDlq3/nhIxb9oZzeMO03ImYAyG07GMP9gbJCdrDl5sEf+nY8a+kj\nP+0z0F6xyqlkpsi2XmizFbUd4Cf8pMgJ1EjPC1D+omGKffJxoQfcf8sAt+X1\nRPAOi1eJSrbXyo3U2/gPe2bxGP283hZkzc/L5/98qbI18APIkAb0Xl4yZ21E\neMhZCOvAiZ1hYx+X1qWxWfu5vq1teNOfHE+XfzWvVjDzT8dv27RF4YXWAwFH\n4v1Geh++SzrYo9ixHsRRUOCFiFuIC6KBdow7vjejPxQs47ErCM5ekcyOLKgR\nh4Flqe5Cj1Vr0tjVVVrbvT4eutAkJB4fAH6bJ8x/owK26EIaZUJhjY1UE4BY\nYVvn7qEcoqP/ovJnUbv2tXxX/mrN8TBcsDwEU1NaUpBSdZzd0Ho7JGjpSRND\nS69yfzc7saeiv3sxv5Gl5NnFp1KLQ/6zLQ/IpJTZ9jJz+NvgOyiFX9k3aH0j\nEWIQ\r\n=ADMK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAzpbtApbsRgwqQr5cEf+ZoBZFkHuDz7oWJ2oHpqdkjwAiEAnA/m3SvyroIiD6PnWpEmupZbgSAmaQpAC/20Z8ES1xk="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.22.0-canary.b401a081.0_1621639377711_0.9182931339063762"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.22.0-canary.012c8dc0.0":{"name":"@material/mwc-textfield","version":"0.22.0-canary.012c8dc0.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.4bb5eea2b.0","@material/line-ripple":"=12.0.0-canary.4bb5eea2b.0","@material/mwc-base":"0.22.0-canary.012c8dc0.0","@material/mwc-floating-label":"0.22.0-canary.012c8dc0.0","@material/mwc-line-ripple":"0.22.0-canary.012c8dc0.0","@material/mwc-notched-outline":"0.22.0-canary.012c8dc0.0","@material/textfield":"=12.0.0-canary.4bb5eea2b.0","lit-element":"^2.5.0","lit-html":"^1.4.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.22.0-canary.012c8dc0.0","@material/notched-outline":"=12.0.0-canary.4bb5eea2b.0","@material/ripple":"=12.0.0-canary.4bb5eea2b.0","@material/shape":"=12.0.0-canary.4bb5eea2b.0","@material/theme":"=12.0.0-canary.4bb5eea2b.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"7a0952c38da1624fb6d0653e07cc5ebf284120f3","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7a0952c38da1624fb6d0653e07cc5ebf284120f3/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7a0952c38da1624fb6d0653e07cc5ebf284120f3/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7a0952c38da1624fb6d0653e07cc5ebf284120f3/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7a0952c38da1624fb6d0653e07cc5ebf284120f3/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7a0952c38da1624fb6d0653e07cc5ebf284120f3/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7a0952c38da1624fb6d0653e07cc5ebf284120f3/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7a0952c38da1624fb6d0653e07cc5ebf284120f3/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7a0952c38da1624fb6d0653e07cc5ebf284120f3/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.22.0-canary.012c8dc0.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-+0gex/PeU7QvrmDBEdS9lQo4RGF597KRg3kOUFrCrvWZNv/T82OmsoAsywEFiSObH0dWaJczqwYCqK5xCCB7lA==","shasum":"6aa93ed9b6669921e21217ab4577422adc987a7c","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.22.0-canary.012c8dc0.0.tgz","fileCount":13,"unpackedSize":200482,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgqE1YCRA9TVsSAnZWagAAWxoP/RTsOxr1rNn+zKFTH/ER\nBUmGXQhl6sM4EKSo1Ze/siaq2A71aYCOpxGpMCpE9j1oz0LXLRHEOU3r59i4\nZmp+gUzHfwbPWs1Duc6CTu+kDbfiDLwCWs+c4zDWeIewHMCu/q9hWRYmNFAj\n8oDsEPTprLMAd9tpqKqduMQuBEROHXQmUzRLC0i54FwSoWoVO+RnOk4hgT5X\npPTJL2m0qLvgDGH072GS/Wxpe0PhVT4N6MuRkBwoNQ5mtpRvbCzJThMGrxQJ\nF1KMuGn0ea+AtfnlKOB9aL6SMPhZe7tvmzeMKkKEA6glY1HSIwkW7FnEEtep\nZUpFOfv8h+W7f6gCVROIfOlv1QyMBiwHwz0CDbHQ+ttibK+5iGQ1D80eWqn2\nH/47nbl1LPNOo06X4/voSABpRxwyB89qsIQ50Da86QIcGLhZ1a7INQTZzqAm\nFV47gTTYiqPmeigp/ahzDkr4/dmjLXezQm0ork83fzZaXgEjXxDtRraSO+DG\nKinKIU0zNGuKMjT9i5uSIbHIJiyVKt0Xqk5ys3WCTTnX5ZGltrH02gyOxfzT\nbEYRTM+WKXhGcW5UoaznsDYBuJZi5grmSPX6e9WU4Q2CNEbiQ+TNu/ogmiLr\nt4Sl1BHR/tINSlBTqzmEPOuicoiV3mxFaXsxh+QX6uRpeu7vNqEES0moBH7j\n/4e1\r\n=ix1A\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDFjiYW536yvnpAOTpr3aRVdOOcDaAAuS7NKmZSi6YvKwIhAJys2wvSWM87T+0J1SLvH6c66+sx26/8Doq73sy+nXZj"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.22.0-canary.012c8dc0.0_1621642583935_0.41084305259539833"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.22.0-canary.e01a1731.0":{"name":"@material/mwc-textfield","version":"0.22.0-canary.e01a1731.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.4bb5eea2b.0","@material/line-ripple":"=12.0.0-canary.4bb5eea2b.0","@material/mwc-base":"0.22.0-canary.e01a1731.0","@material/mwc-floating-label":"0.22.0-canary.e01a1731.0","@material/mwc-line-ripple":"0.22.0-canary.e01a1731.0","@material/mwc-notched-outline":"0.22.0-canary.e01a1731.0","@material/textfield":"=12.0.0-canary.4bb5eea2b.0","lit-element":"^2.5.0","lit-html":"^1.4.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.22.0-canary.e01a1731.0","@material/notched-outline":"=12.0.0-canary.4bb5eea2b.0","@material/ripple":"=12.0.0-canary.4bb5eea2b.0","@material/shape":"=12.0.0-canary.4bb5eea2b.0","@material/theme":"=12.0.0-canary.4bb5eea2b.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"8afd20b0913094a1c3c1b084d0bec7d38724fa00","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8afd20b0913094a1c3c1b084d0bec7d38724fa00/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8afd20b0913094a1c3c1b084d0bec7d38724fa00/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8afd20b0913094a1c3c1b084d0bec7d38724fa00/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8afd20b0913094a1c3c1b084d0bec7d38724fa00/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8afd20b0913094a1c3c1b084d0bec7d38724fa00/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8afd20b0913094a1c3c1b084d0bec7d38724fa00/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8afd20b0913094a1c3c1b084d0bec7d38724fa00/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8afd20b0913094a1c3c1b084d0bec7d38724fa00/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.22.0-canary.e01a1731.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-SSqKYcwmPi62AQXspNXsyq50wEzG4E29qchcuFNbdh/0W7Pl3UaHdVM9kN+BQa/IXiaxCcAHvm2pVmFaoiHKNQ==","shasum":"eb905a032c0be906652dd6267d0edf998b50de9b","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.22.0-canary.e01a1731.0.tgz","fileCount":13,"unpackedSize":200482,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgq84mCRA9TVsSAnZWagAAg7AQAIuPsPO5k3Hud+lqJ25n\nXTSxB/Vgn4qQ2LaZLvvh3m+5U85TLWG2Jv1iqnyMQGJxQnKUXqawwM/SxmTM\nqzl0m1aFoSKT/1anUg57qGlmvkqKJxyp0fT5ayGLqf+Mr8SZjG2VGS2hxr4p\nCKKKX2qiHAThw0bJVf/OO05czyVuSvQdrc+KjQZbzukl1lRW8K66KvYeTT3g\n1vK79krwd0mFKYIacw0SLVuTF9CMFL1tt/fLZuyKb2LTZIb4Z+iv/hyqWMT0\nv/o6/pZIPkNV8B4CJnNeyvJRxOAk5+kSeUeerYsENHgRT8QAcVsyQrToFgXW\nEzWCRUdhdxwusLJM6UPaVfgd7BWbg3sHQJQ01AoJaoSqubYgpvOyU97XKabN\n9hkY232Tz3IzuAQYWtLfXdMo49hYkGwXRli4aA7p51y82tf51VDc0MoB4kvn\nWzTHI1qc2jRM+3MJ+8ghu36dj37bN01ltn/FVynPVH/RGpHbi8ppXup6oVp2\n6LwYrLM41PP2HKAzz2KGd4K64dNn5XwQ3/9gM4a+pQpSP9vslxEiHbAwfM/6\nqMPS3mfuWDnNqwSEMNps7IndeZP2S2aXMwP21NbNVllIQ45akOYQMlBIQods\n/YcWZxZFy2seyoDCskKWrzwWj3Dykx0Uo9fmRQQBjLAJ0f7M+lpd332OIfyW\nSJD8\r\n=wozJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFhiKSi9PzxdJ1gxkfFd/uvQt+UsKnFpi+G/y1LnrpuqAiAj9fW5xHshUInsyv6OE2+5sZa86zTsX92uK7BmfTRdug=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.22.0-canary.e01a1731.0_1621872165862_0.750401150603401"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.22.0-canary.59174b9f.0":{"name":"@material/mwc-textfield","version":"0.22.0-canary.59174b9f.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.4bb5eea2b.0","@material/line-ripple":"=12.0.0-canary.4bb5eea2b.0","@material/mwc-base":"0.22.0-canary.59174b9f.0","@material/mwc-floating-label":"0.22.0-canary.59174b9f.0","@material/mwc-line-ripple":"0.22.0-canary.59174b9f.0","@material/mwc-notched-outline":"0.22.0-canary.59174b9f.0","@material/textfield":"=12.0.0-canary.4bb5eea2b.0","lit-element":"^2.5.0","lit-html":"^1.4.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.22.0-canary.59174b9f.0","@material/notched-outline":"=12.0.0-canary.4bb5eea2b.0","@material/ripple":"=12.0.0-canary.4bb5eea2b.0","@material/shape":"=12.0.0-canary.4bb5eea2b.0","@material/theme":"=12.0.0-canary.4bb5eea2b.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"7fb9171e05c85b1bf933cbbf66a44ff2e05e9e25","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7fb9171e05c85b1bf933cbbf66a44ff2e05e9e25/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7fb9171e05c85b1bf933cbbf66a44ff2e05e9e25/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7fb9171e05c85b1bf933cbbf66a44ff2e05e9e25/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7fb9171e05c85b1bf933cbbf66a44ff2e05e9e25/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7fb9171e05c85b1bf933cbbf66a44ff2e05e9e25/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7fb9171e05c85b1bf933cbbf66a44ff2e05e9e25/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7fb9171e05c85b1bf933cbbf66a44ff2e05e9e25/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7fb9171e05c85b1bf933cbbf66a44ff2e05e9e25/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.22.0-canary.59174b9f.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-7QHU8+FVtxhLB2sOip7m8Yvh11Exa8pIncox/XBw/VgAFmsWDnhEN+gwLdGos8uQ5xPk/v5T9n8heH9jCvQNBg==","shasum":"d5f0c78d66052fef019de205a8e258ebdbf4939a","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.22.0-canary.59174b9f.0.tgz","fileCount":13,"unpackedSize":200482,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgrTulCRA9TVsSAnZWagAA520P/1kqKRU/ccqxYSuNShm9\nyr06DsgY2ZLiwF9WK3mUZtPHBvjRWGn+AliFAfdtYblLW9pc2w2Uso6UGq2E\ny6qu0wSgcNoOfcA3MP6cI0On3AMhupSOXTWHUEYryJBOadC5ThDii46dgbtX\nsAFd+CSRo+uGpqUhJNskT3YZ3I8esRH2dHlLjJSjpXGKkcA3UzFlh98aOci/\nz/wo3WMn53SoMxV85IGglRso8SDuJXoLA6JqA6zdpJXx7kJxgTmV6DHsSSr8\nky6humwBRHraDlKLEy47a9jqH4TqgWsrRFLTix2H4rfPckUx/emu0zOUf5bJ\nNp907YykHCUODNk0rZCTGIgy09+79sWSGtGqxA9Ax+EODD7nN1XXqR5sFqZn\nKg9BAAnmJoYsxT5UoQ2xrBK/XgLx7n3/oYIALoq6XQUTdnPngc/rRAxMIxFU\ne8n48y3Zla9/E12lrutuERbFu1dqYKN/EFJ1ekn0NYlpUFOO6UeFRHlDp9iM\nbrlnCoe6TqBJntyzlfcu5CImllO9Lt5MtkrDD3joId1EIlbp1+FRcZiYciRm\n2SKUOiHGZzyMuRMFlfAeQmC0BIgsr8TSUglq/Kjt0Da8cQlX4qUyIDye+dJ4\n8qwUQ6rUGtuD1/RdEm8D0h6EaUAAGguKXqHk7zdjS1TIxa9LO7NOq3d5AWZg\n8BlK\r\n=DVNr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD1iBoDAmmnKnfKTmFJcGZWbt2jYkdkAWUcL8bo2SO1pQIhANRAm8G9V2VySCTOCI7qU9ladKDtzOKVIdwAu0iCSx2e"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.22.0-canary.59174b9f.0_1621965733104_0.8229645474932885"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.22.0-canary.c96cb2e0.0":{"name":"@material/mwc-textfield","version":"0.22.0-canary.c96cb2e0.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.4bb5eea2b.0","@material/line-ripple":"=12.0.0-canary.4bb5eea2b.0","@material/mwc-base":"0.22.0-canary.c96cb2e0.0","@material/mwc-floating-label":"0.22.0-canary.c96cb2e0.0","@material/mwc-line-ripple":"0.22.0-canary.c96cb2e0.0","@material/mwc-notched-outline":"0.22.0-canary.c96cb2e0.0","@material/textfield":"=12.0.0-canary.4bb5eea2b.0","lit-element":"^2.5.0","lit-html":"^1.4.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.22.0-canary.c96cb2e0.0","@material/notched-outline":"=12.0.0-canary.4bb5eea2b.0","@material/ripple":"=12.0.0-canary.4bb5eea2b.0","@material/shape":"=12.0.0-canary.4bb5eea2b.0","@material/theme":"=12.0.0-canary.4bb5eea2b.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"516910ae9bfae62513b95080369ed2be100b1c27","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/516910ae9bfae62513b95080369ed2be100b1c27/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/516910ae9bfae62513b95080369ed2be100b1c27/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/516910ae9bfae62513b95080369ed2be100b1c27/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/516910ae9bfae62513b95080369ed2be100b1c27/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/516910ae9bfae62513b95080369ed2be100b1c27/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/516910ae9bfae62513b95080369ed2be100b1c27/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/516910ae9bfae62513b95080369ed2be100b1c27/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/516910ae9bfae62513b95080369ed2be100b1c27/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.22.0-canary.c96cb2e0.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-p8SbWlhNaHCgoKcu/vyoEAKldM6iEhFDnvwZ8L7K5VHLgh99L0iMEFdNcDulHknVRGtSiavmPIKRDVIFNFhEag==","shasum":"f827a644abe71b60f2ce813fc9142852e2a9bd4d","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.22.0-canary.c96cb2e0.0.tgz","fileCount":13,"unpackedSize":200482,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgrUwTCRA9TVsSAnZWagAAq0IP/jDvba9hawrIk2q6Ph07\nw/IjAiuEA4vNjJ9So9gbdJEIbIq2/oFy6v8j8jPuQj7DkbVUXsViSq9Uv8oa\n9TRl3qHgVRLKy1sQ94iIHjVyUe1iMq/U/s+kMpHNCEQcMBtIfl1Nb4X+oggt\nI7ApPvhTU5cz2M6Xzm5JyOk6zqnPoHUS73zlYIRzZw7lklFDBs8lbwWzRVUl\ntd9UjAP79xtQqD2aaJjsPu9M+jSonrDBciVJoEkLPLOTqctMPL1A95fsh6ZR\nEqf8AaIm8U88J1NQkO61i4WfpikxpQUBO9eyMdWWRIEwxzUO5xZQW/oIJBcQ\n/TU0Rj3UOuAhJW/nRPbJztD334hTRIEcvK5MqToouq4ikPCEwK0bkto59o72\nhBDqKpzmBWzOL40JTzvPC6Y5/xVUntVL3NihgbZPjIWVwNO/xSjilHwrNvsQ\nLTCWlX21e/SKbksgyFnXaqUviCiLYAfnGpwOCXyO2X/2NdYEH7zql/2HNizq\nJIL4VT8H2Vxx77wirHM78ciiJSq8Kxi+W8uoPj0SN+myjxzolcjobgVRQ6+L\nDLb8WB2vibQnDn4K/C82K16/EPzsJ2aGCJ2046VePmQZRb2d/xxNJWsAJxUp\n77yLJz2S6lY9T4WGIDLcSww8A4KKZA9VuCkTE/0ZH1gUSESdo0LrWgwnfvXG\n+Z9+\r\n=wkKD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFov7LznEOT53MZc/bSjiZOGWxSm2rvLyf18CQdl9Ie2AiBkypOu7JhR+YxIM2sD/zBdXLvGOZoFkNF3GnEm8bG/zA=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.22.0-canary.c96cb2e0.0_1621969938594_0.12206113406267871"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.22.0-canary.b9b0e330.0":{"name":"@material/mwc-textfield","version":"0.22.0-canary.b9b0e330.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.4bb5eea2b.0","@material/line-ripple":"=12.0.0-canary.4bb5eea2b.0","@material/mwc-base":"0.22.0-canary.b9b0e330.0","@material/mwc-floating-label":"0.22.0-canary.b9b0e330.0","@material/mwc-line-ripple":"0.22.0-canary.b9b0e330.0","@material/mwc-notched-outline":"0.22.0-canary.b9b0e330.0","@material/textfield":"=12.0.0-canary.4bb5eea2b.0","lit-element":"^2.5.0","lit-html":"^1.4.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.22.0-canary.b9b0e330.0","@material/notched-outline":"=12.0.0-canary.4bb5eea2b.0","@material/ripple":"=12.0.0-canary.4bb5eea2b.0","@material/shape":"=12.0.0-canary.4bb5eea2b.0","@material/theme":"=12.0.0-canary.4bb5eea2b.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"18c2325baf4aba3a786f872ae497d8ee283800e0","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/18c2325baf4aba3a786f872ae497d8ee283800e0/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/18c2325baf4aba3a786f872ae497d8ee283800e0/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/18c2325baf4aba3a786f872ae497d8ee283800e0/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/18c2325baf4aba3a786f872ae497d8ee283800e0/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/18c2325baf4aba3a786f872ae497d8ee283800e0/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/18c2325baf4aba3a786f872ae497d8ee283800e0/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/18c2325baf4aba3a786f872ae497d8ee283800e0/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/18c2325baf4aba3a786f872ae497d8ee283800e0/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.22.0-canary.b9b0e330.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-1/UWFO3tYx3sOjtQxVhAom0v4sBSqrcydDgS303DxuPqXl8QtcW0vEuzMw6matYjSHSRIt/WP6hiBIWjG1DCLA==","shasum":"bb3efd1dfbd0f53417dae77fdb02d0ef830661fb","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.22.0-canary.b9b0e330.0.tgz","fileCount":13,"unpackedSize":200482,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgrWVmCRA9TVsSAnZWagAAZ9EP+wUolmKO+0odrAf4cRT1\nSk5h5yi49U54sErcc7l3/BOepFW/swuw0G1ZCZANyuIiLqnMTtAgNcavM2m3\nRZ+n3DvV/ori6SO+HOv1dH9++LDXMTL+uqtMxz4FowueM/raoEPIRDVengOD\nJedWSXGk4f/ZfkJqso6P70RvMLVrVpthsOT0Nsu6EN2oPW71rMVEm3L8/Ekd\n1qGE4fZo6ItmWDegbf010qHLxtppKVKWCPyvBWZA3Jmol66IlGIWk95buT9Z\n+q6f53xANEr6xkErT8xjNS05EHamjzeZwddgJTE8cAy47euogZYLRyo4Ouqi\nJOSD8xkFOGN2r3Mo8R4AuBEgvBs3cqIl6eiRKJv9b0oRN03I+VAlC9stIVWj\n6J4eX0TwX4O2V2ZDQ2iGOgMs8uhwS1ZzSoWnE0gvOhwih/2RTAxEVTYFwzaU\nHNtXi4hVSngbtHEn53RcQ+zh4CUb8MjWUX9xlHynCgWanXC3VdG6GviqFp3q\nFNN0JPKEogDg7yzvVHknFTuUf2SjqACmdkQoeL8bjFqy96DxhcWgIwrQkzRi\nvfX2q7Duh8CSjkURf+8mjhVVL7mUGMVWUutkRBVizVhZNu7SAyTViyYEX3PG\n0jF/IGhuZeLa4dml50l5KBufFQlIpaiqK2TyjlvaP7mmV0jike6cUU4ZCUhT\nrMUK\r\n=VwZw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBKZOz27heyJellbgYNeGwPYqS2MopZXIy2myA9u5NldAiBYaCUgZZJFGU+rGbWbN69G4LRi8otD9ehg5STjZUjGEg=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.22.0-canary.b9b0e330.0_1621976422322_0.09188420077980908"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.22.0-canary.ea2a8063.0":{"name":"@material/mwc-textfield","version":"0.22.0-canary.ea2a8063.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.4bb5eea2b.0","@material/line-ripple":"=12.0.0-canary.4bb5eea2b.0","@material/mwc-base":"0.22.0-canary.ea2a8063.0","@material/mwc-floating-label":"0.22.0-canary.ea2a8063.0","@material/mwc-line-ripple":"0.22.0-canary.ea2a8063.0","@material/mwc-notched-outline":"0.22.0-canary.ea2a8063.0","@material/textfield":"=12.0.0-canary.4bb5eea2b.0","lit-element":"^2.5.0","lit-html":"^1.4.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.22.0-canary.ea2a8063.0","@material/notched-outline":"=12.0.0-canary.4bb5eea2b.0","@material/ripple":"=12.0.0-canary.4bb5eea2b.0","@material/shape":"=12.0.0-canary.4bb5eea2b.0","@material/theme":"=12.0.0-canary.4bb5eea2b.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"0b10a1191b28a4155d8f169ab9a5a3003efd3fe5","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0b10a1191b28a4155d8f169ab9a5a3003efd3fe5/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0b10a1191b28a4155d8f169ab9a5a3003efd3fe5/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0b10a1191b28a4155d8f169ab9a5a3003efd3fe5/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0b10a1191b28a4155d8f169ab9a5a3003efd3fe5/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0b10a1191b28a4155d8f169ab9a5a3003efd3fe5/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0b10a1191b28a4155d8f169ab9a5a3003efd3fe5/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0b10a1191b28a4155d8f169ab9a5a3003efd3fe5/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0b10a1191b28a4155d8f169ab9a5a3003efd3fe5/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.22.0-canary.ea2a8063.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-mF8vH8hbAIul3Gkt4a08Gywv6F0PL5Vlx9ZaR05gvL0V1gdvbsUaxecjVK4BhP+J0IPWVQcGOtzl0A5MsbzmdQ==","shasum":"43feb3103f0355b5fa60695b999a6974acbc3f6f","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.22.0-canary.ea2a8063.0.tgz","fileCount":13,"unpackedSize":200498,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgrWaUCRA9TVsSAnZWagAA3uAP/jsqayiBf9YM2eQGTomL\nM+JngNE2D0Gsv5o3Mi3Dot6d7K7u09cddoe6rSzvTUU+Cmz/kYKoKe6Iwxg1\ne2qhNgCnqyj1V/o+vJXmLMRRuGPy1JQZHyCZUl5LcOpF2oXYEi+b7Sk2WHuo\nsFNOkBj0znwrGtmJDtC0abN+LfcCkZzBbrseEZABlXIsS2n5wvLr/8uR1uIB\naVUSjxo20FfiKAyZf7aC0HiKQZGylqyxvsyJlUigNll6HVYWidsCaWX+J+Iv\nrbX+e+svfhlpf3Fs5QqEtGx/FFUauSXTf+lol6C7RwGeYNEzXhCMF1BC9WTT\nZ9eZK2We+T/HP+8e2AFXIRsO9a1rw9jJuO1wwGEMJVuQ25peaYkOY+8tzCJE\nk3WBu/aj+IhciWIo602Q99O8JUp8LpQMUpqDxqashMDfNRdVXrMxEzP1ka9Y\nbRHS7aLCMqFeivEx1UAHu1fzqXo3OcLnFg2PVh3xy4IjD/P7/HITocdWs73U\n/uMX8XqaYDVHNExebCb1VBDMJq9KSmAvMHP4sr/9a3SDKXhSYEMxd8JCVqTR\nfzw79+Wwnv2f83rMBgG1Q206SEo8v5sGt46xQcUlkkkDt5W0/1C40cBZ+lEr\nUKiN4zJhsqaPkFo609z1808WnfOQspluBQfqJTSoQTM4oqLkMN8qP4h/qT73\nrswQ\r\n=ZnJ+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDKkLFZW18LW/GonX2JbEJwnHceP0ByB/wZNU6bBjV0sAiBfUI0ujazzt4O9Nb0uEZWxHLDUamoHyK+srd4rNco7wQ=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.22.0-canary.ea2a8063.0_1621976724289_0.18538495807719002"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.22.0-canary.60cd9178.0":{"name":"@material/mwc-textfield","version":"0.22.0-canary.60cd9178.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.fadab3372.0","@material/line-ripple":"=12.0.0-canary.fadab3372.0","@material/mwc-base":"0.22.0-canary.60cd9178.0","@material/mwc-floating-label":"0.22.0-canary.60cd9178.0","@material/mwc-line-ripple":"0.22.0-canary.60cd9178.0","@material/mwc-notched-outline":"0.22.0-canary.60cd9178.0","@material/textfield":"=12.0.0-canary.fadab3372.0","lit-element":"^2.5.0","lit-html":"^1.4.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.22.0-canary.60cd9178.0","@material/notched-outline":"=12.0.0-canary.fadab3372.0","@material/ripple":"=12.0.0-canary.fadab3372.0","@material/shape":"=12.0.0-canary.fadab3372.0","@material/theme":"=12.0.0-canary.fadab3372.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"b194465fb86d4af03f65ac72d9b8427df2a2e189","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b194465fb86d4af03f65ac72d9b8427df2a2e189/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b194465fb86d4af03f65ac72d9b8427df2a2e189/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b194465fb86d4af03f65ac72d9b8427df2a2e189/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b194465fb86d4af03f65ac72d9b8427df2a2e189/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b194465fb86d4af03f65ac72d9b8427df2a2e189/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b194465fb86d4af03f65ac72d9b8427df2a2e189/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b194465fb86d4af03f65ac72d9b8427df2a2e189/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b194465fb86d4af03f65ac72d9b8427df2a2e189/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.22.0-canary.60cd9178.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-AsnDMMHpTsX4L/SxaSOM33QCN3gAApuI7kx52e+CzXO92icj3g3aqOpyh2KDzhaoQlTF9bi2CLdwcdKmIshh/A==","shasum":"87b6e695d931ad1730c896660ad620b55b7377d2","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.22.0-canary.60cd9178.0.tgz","fileCount":13,"unpackedSize":200498,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgrYS6CRA9TVsSAnZWagAA9P8P/0fuIoD4LyIJ7+B84sSh\nCeiVDiwYH3Mf0AWzoFfXTaONUhV13v5R38iNaNpflbwOo7GlFvdP81sDXgjA\n0Hy8hSlanh04yKloxZuqgs8og4aS6e+OZESBoy+B+jZ0lU9x3HBiLV1iCap3\nGpTdpjG7sx/bui4QuEVjnGP8ZMmBCm8LT0lH/IhrdHpj86CqK6Wm/2nAMFOa\nyroptS0Fzp1mvKcnvOmsgXg77B3XKVdtD7Zzh3PFuN3SyWebYfCBMD/1Akad\n/3HaWJc+7CAcr0MiCCXs2YHO+FPQ9TAONh0Mwq9xIT8wUnMPikQtF3MIhdtj\nct2k1PPKnW/7xxoXYQ0AXKYBPDNdbP51mnpSJ3QZ0+EcOjIDl1xLoAuI+5H0\nwT7hMdGR49CeRXQPl8a9kyQqt9lxRKdb+zxpJg/n8DUr/3wPI5iTKOB6nVST\nG+DaJ9HjccfRZE+loNkQMnrOoexZBciooW7YO7kwIVLc1vVBWB7uh9KBTPBx\nyrvdsyzDmBNW8dIPV7pWN6uBho68V9sLvDcdwgKJTWjMS3ol6f0srnxX2mYC\nrCFEgXAcxW+gVGbT90bQx8Ga5/xK5XeeSzYlpJqY2Fs6HkNCDWUfAEB53r/V\nwA9w/Q3+sCj66n3quuvwv19eTCfLYByYJhzfaTtoCAV++2wgWjHohguWyMNq\ndMR1\r\n=7gRS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICgv9zCyiv5MrJKfExwsmSUjtBAyG017NAYaXi1Pn5WnAiBdr0wY/SIYQshWH2TvaOjvjm0ACx1MAywg50258sYfnQ=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.22.0-canary.60cd9178.0_1621984442256_0.22548393985789472"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.22.0-canary.2e2c75f2.0":{"name":"@material/mwc-textfield","version":"0.22.0-canary.2e2c75f2.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.fadab3372.0","@material/line-ripple":"=12.0.0-canary.fadab3372.0","@material/mwc-base":"0.22.0-canary.2e2c75f2.0","@material/mwc-floating-label":"0.22.0-canary.2e2c75f2.0","@material/mwc-line-ripple":"0.22.0-canary.2e2c75f2.0","@material/mwc-notched-outline":"0.22.0-canary.2e2c75f2.0","@material/textfield":"=12.0.0-canary.fadab3372.0","lit-element":"^2.5.0","lit-html":"^1.4.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.22.0-canary.2e2c75f2.0","@material/notched-outline":"=12.0.0-canary.fadab3372.0","@material/ripple":"=12.0.0-canary.fadab3372.0","@material/shape":"=12.0.0-canary.fadab3372.0","@material/theme":"=12.0.0-canary.fadab3372.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"7da0cb4191a309db2509b3bcff390b7ae8e4619a","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7da0cb4191a309db2509b3bcff390b7ae8e4619a/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7da0cb4191a309db2509b3bcff390b7ae8e4619a/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7da0cb4191a309db2509b3bcff390b7ae8e4619a/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7da0cb4191a309db2509b3bcff390b7ae8e4619a/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7da0cb4191a309db2509b3bcff390b7ae8e4619a/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7da0cb4191a309db2509b3bcff390b7ae8e4619a/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7da0cb4191a309db2509b3bcff390b7ae8e4619a/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7da0cb4191a309db2509b3bcff390b7ae8e4619a/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.22.0-canary.2e2c75f2.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-5oNC9293uUkP9skIBCD05OyG3ltN3A5E52UBD9XsmlVECqxfONCG2D2cTWGaVk3cn4MYw32QHt+WYAhvCh9p0g==","shasum":"03e67b1aee46582560b39ae4621d74b662ed1262","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.22.0-canary.2e2c75f2.0.tgz","fileCount":13,"unpackedSize":200498,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgrZIXCRA9TVsSAnZWagAAECYP+QGV/jnZkPFYv6Hg5c3m\nvrHo1zRr1SK4ESsC1VS60PNZJrZEh42ImQmLvFlJw/6d21Qdtt34ByaZWqaR\n+L/pIO5WresB6YJ+fQfPERyX3Ls66QChVP4109mQMsBdrYLpRMJ5Dm2NWoGN\nAEAZV2lq0nxXyWlFSZD9r7fizP1scr/fwL3fzYs0i6h8hEiqvngAxKcIGSqX\ng3SDoShB15xnJ+AIGb6InijH7YzWqykxpP9GWUx4vv2PxSJFhfsZoY6bfZtT\n9MwTguLf7t+BvQXUemLhjL5aAehNvhjjhCjYC127OkI7JJAGCuWjy2vltjyK\n2HHzbbSOcEITeHl7w8OGuw39iF50tgEdZsWXe2kLndi5VD+iN+lgtRub5Sjr\niJ/sOaaPdlb9b0amPIHKBmTwq2ot/l4HyexhJOJA4e8589jdHMrS6yX+sx8U\nZSJ13rywf6B//yC0OQHah0U1j1arESoZy6pyUbWpGw7Mqpbu0XQ9NlCbRGr4\njD/cRJRtJhEerH5OPdFVKCSIFhX/NSDTFSmTc/OYQY025jUh1kDxdhIlKFFk\nTZMI8KWgfroMJQMdGBXlGr8nj/YiMaDa9FSWr97JKxLtJxrvK3ZTaiHNUKxr\niAAEjFrHvDc10K+X+Z2S3d6RTkMwdF0gTPBKaw/gASrgeH3Buxc6SgPAa/2z\ng4XI\r\n=Vv3+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAtEK5bBGJ92gbAaArZgQeapKuuIrbbz6DtX7xtRpjwCAiARYUcpNNZk61VnG3btOnfM8HeebWahxlRCIckJuHwKpA=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.22.0-canary.2e2c75f2.0_1621987863446_0.330821107674268"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.22.0-canary.b99c77d5.0":{"name":"@material/mwc-textfield","version":"0.22.0-canary.b99c77d5.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.ec31ae1ed.0","@material/line-ripple":"=12.0.0-canary.ec31ae1ed.0","@material/mwc-base":"0.22.0-canary.b99c77d5.0","@material/mwc-floating-label":"0.22.0-canary.b99c77d5.0","@material/mwc-line-ripple":"0.22.0-canary.b99c77d5.0","@material/mwc-notched-outline":"0.22.0-canary.b99c77d5.0","@material/textfield":"=12.0.0-canary.ec31ae1ed.0","lit-element":"^2.5.0","lit-html":"^1.4.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.22.0-canary.b99c77d5.0","@material/notched-outline":"=12.0.0-canary.ec31ae1ed.0","@material/ripple":"=12.0.0-canary.ec31ae1ed.0","@material/shape":"=12.0.0-canary.ec31ae1ed.0","@material/theme":"=12.0.0-canary.ec31ae1ed.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"5fda182a00532c3dce9d3841b88c80c56a8dc757","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5fda182a00532c3dce9d3841b88c80c56a8dc757/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5fda182a00532c3dce9d3841b88c80c56a8dc757/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5fda182a00532c3dce9d3841b88c80c56a8dc757/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5fda182a00532c3dce9d3841b88c80c56a8dc757/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5fda182a00532c3dce9d3841b88c80c56a8dc757/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5fda182a00532c3dce9d3841b88c80c56a8dc757/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5fda182a00532c3dce9d3841b88c80c56a8dc757/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5fda182a00532c3dce9d3841b88c80c56a8dc757/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.22.0-canary.b99c77d5.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-OdsfnxqLlHMaQ1TpclmtJdQxRubViehz0fzZ2LkRv/Bpqg2W+TxHnKClDifPAuzesw0ZOsfDgh2sFa2sDjErDA==","shasum":"98d0a275fa579a8b0d3c95072c198e979cad89c5","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.22.0-canary.b99c77d5.0.tgz","fileCount":13,"unpackedSize":200498,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgrp3gCRA9TVsSAnZWagAAMIwP/Rg7NwYtJ6Xhqn+2ywYj\nK3cwC4jMVy4c6fLaqrPUosrNrMX0uU6p5SGSm/QzMOvNJX95FaioatM6bneu\ne5NmmBuOrZPpN80iVJLVcJRPufOCvoR91L74dX7MfHdRVApVLGNYVtilXy1X\nrRA/i4GooRo3x32s2vgj0YQTkd7/Ph58OlBXWDD6JZdioqkK0st1uCWek9dK\nDElO709dPjnRCHSJ55B2Y1jfrJChN2BhZG7/G6aMOqHDnyqysgpdwJ9Yuldp\ndgkBhUKfyQrP5mNyBgmicnXhzDkg+4KkrkIVIyUnVnPEVLdg1t16KjfjYqOi\nnld/4q8FNrVc0J3UutmNAVC0KOHnc2+Ci1HHLsrH2thuxiUiFrxDbclMW9xg\namFTNHxaig50o1l2hn/y4TGhByoUsevDrHwe6ieDWQ2rq8FLnaq2jEL757k1\ngsv/z11dlwUjosM7goYdoC3U3cZzcXd0ZmCKamYFE86yruQosvfB+u6cw4Z/\nblYk7ndjmiH0sUNrLB+LkvZ+ljIMsJZdt6ve2tpq+tlhAwYLmEyGEA54AQEL\nfdphqVwUf6p0aMg8fow5E8g4JyGsBLpmhhRh8bIZqeB1MzhzSZ7BI+dEt3FN\nxAVSkqah5H4uevVefwP7KD43goBlegw5kyqC/B+vhc9rAVfESKehFXULDLuz\n8GRK\r\n=tREq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICVT0ZnZaRKwpYzWyojgfYEtRI5j+VTTl+tmrL8wVjpcAiAE+afcx6v6MApfr6b9699L2ES0kT2GYgWS5B/CHRBCYA=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.22.0-canary.b99c77d5.0_1622056416549_0.6487703231881086"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.22.0-canary.0de82c12.0":{"name":"@material/mwc-textfield","version":"0.22.0-canary.0de82c12.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.ec31ae1ed.0","@material/line-ripple":"=12.0.0-canary.ec31ae1ed.0","@material/mwc-base":"0.22.0-canary.0de82c12.0","@material/mwc-floating-label":"0.22.0-canary.0de82c12.0","@material/mwc-line-ripple":"0.22.0-canary.0de82c12.0","@material/mwc-notched-outline":"0.22.0-canary.0de82c12.0","@material/textfield":"=12.0.0-canary.ec31ae1ed.0","lit-element":"^2.5.0","lit-html":"^1.4.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.22.0-canary.0de82c12.0","@material/notched-outline":"=12.0.0-canary.ec31ae1ed.0","@material/ripple":"=12.0.0-canary.ec31ae1ed.0","@material/shape":"=12.0.0-canary.ec31ae1ed.0","@material/theme":"=12.0.0-canary.ec31ae1ed.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"02037fe47532247fb8d3f160ce76eecc87a64963","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/02037fe47532247fb8d3f160ce76eecc87a64963/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/02037fe47532247fb8d3f160ce76eecc87a64963/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/02037fe47532247fb8d3f160ce76eecc87a64963/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/02037fe47532247fb8d3f160ce76eecc87a64963/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/02037fe47532247fb8d3f160ce76eecc87a64963/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/02037fe47532247fb8d3f160ce76eecc87a64963/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/02037fe47532247fb8d3f160ce76eecc87a64963/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/02037fe47532247fb8d3f160ce76eecc87a64963/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.22.0-canary.0de82c12.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-862nA4f0Fsf8uaIYNz3YmJv1HZtbAGhM07nz02EHlS+DQkhNmZWocIDwYEG0zHW7xEhMQcycANdE0V1l9gTJuw==","shasum":"bea61dd633c83642c7d4f94042b89ec8aae6cfa8","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.22.0-canary.0de82c12.0.tgz","fileCount":13,"unpackedSize":200498,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgrr4YCRA9TVsSAnZWagAAU3oP/1yoOs7iglaic54XK3b+\nyxSvmQeTS7agRx7Rwz+CPXJZqLxNSxR/nyLsmDEzMJC5WXicGSt7hgJVQVpv\nmUMMd2YMzsmRhOtCErQIteAuaICCD7EIquzh24DVWHZGDNdGEboYPWbo0lV2\nYpt35Vvix3HT3JqFL0t2Knq/nXBxJcHSu8l6aPUa36N87RB4Vnzgo9Q2BZVS\n4Vu45UdW+6bdiFbMqX/9ZrQ/U5WmOJZPsW63ld/y7elEH9/4rrQu82GJnAPq\nGyFMCFw7s5m69PSGXe7RKfrPnZzeFquO6pW64+ttuW8T2NW2Sfwl7qDNnJak\nMefQPVISj6UgIgqd+4L1g5zyOrZN10U9Fq5Cxloyl1IvEHIleZ8f00LSc8R5\namV79huDC2XuxRxnygY7xbW2NblbMTp0CBcuw5+KCzAaySicckcm4Z6BkTVM\nG/8cA5cgKkIA8UC4Ucs3ubjbmkwjJHCBazCJGvjVRMWSoVFrVwtUml9rONzi\n8Z4Nh+Ab2VZ7M20sDwXEogoS7Z7OyKeTwQH3JlpsvrO5aeqprDgy1ddYjkJt\no+PLS7bXMsSDCijvp+oNFJ6BtG7AQrXkN4iUNNhOTYei2ntC9pJTKaiQesfs\ndIQGgFuDjyviha4olX36bCy9DO41SaYz0pt/9qRph/LGwO/jP3ier7eV094N\n3cao\r\n=EiV6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDqNraZ4/em+56gy3KsoTTN4l3C1ZlU3vd6GAGpIPVbwgIger1cM+UgJ0dAylbelbWJqnKqAaJf5kWSyI0RQaPFcOU="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.22.0-canary.0de82c12.0_1622064664249_0.08207078753745711"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.22.0-canary.227a4614.0":{"name":"@material/mwc-textfield","version":"0.22.0-canary.227a4614.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.ec31ae1ed.0","@material/line-ripple":"=12.0.0-canary.ec31ae1ed.0","@material/mwc-base":"0.22.0-canary.227a4614.0","@material/mwc-floating-label":"0.22.0-canary.227a4614.0","@material/mwc-line-ripple":"0.22.0-canary.227a4614.0","@material/mwc-notched-outline":"0.22.0-canary.227a4614.0","@material/textfield":"=12.0.0-canary.ec31ae1ed.0","lit-element":"^2.5.0","lit-html":"^1.4.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.22.0-canary.227a4614.0","@material/notched-outline":"=12.0.0-canary.ec31ae1ed.0","@material/ripple":"=12.0.0-canary.ec31ae1ed.0","@material/shape":"=12.0.0-canary.ec31ae1ed.0","@material/theme":"=12.0.0-canary.ec31ae1ed.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"882557fee992155765312df09397dd80bd837720","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/882557fee992155765312df09397dd80bd837720/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/882557fee992155765312df09397dd80bd837720/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/882557fee992155765312df09397dd80bd837720/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/882557fee992155765312df09397dd80bd837720/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/882557fee992155765312df09397dd80bd837720/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/882557fee992155765312df09397dd80bd837720/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/882557fee992155765312df09397dd80bd837720/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/882557fee992155765312df09397dd80bd837720/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.22.0-canary.227a4614.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-lpE2iphH928f/uncQdwxMasaHHYn67hr1dVQLzYndb6QNRIXSyGV3BEuhK2EveBU5l2l9Jru1MKFqdBPPBqMxA==","shasum":"df4a7d51ec0b4ace74a698ecae9d289187d49fed","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.22.0-canary.227a4614.0.tgz","fileCount":13,"unpackedSize":200498,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgr8LACRA9TVsSAnZWagAAOaAP/0AenwZ9VeD+fY6HZQuv\nHiYoVpGwkOHrJ/Iaw5OeqJk5JZw5sgfVMdOaQETlXHHpgaFUd3iAdsscBtZf\n8DPsjAIMjbgaMyLZRdpkwSJ+QE6xVPPaSCSMFZr2j+5k5MfLAULV7mD/VTlu\nxA+va9UVqy/xJ8Ft0LPi4AUlrpSfpejfa3rQBcsCJTFUvvpqXOEH0z7TzQqF\n9lP7kytw4aoV6ma1e9T66DRusPPc8w91SKYpTvAnAA3hiGFF6vOeUIVRSpRt\ngf5nyJUXySH9r/MjJ4d2O5A2qe7U/LqGg/89ZPWK12vh2LVLyZfUGuxLthvT\nMYm+odzsk/NSgSHsgEjYK94wZsSOhSXvIKy9dpHR+4oz9Fn1LTXJfHv0SNod\nRD6wQBJ1fplIuMdruKXNexgMBbovirA61Qkfpb4zQTfaVYtj/xkxu05CpJKI\nGorfMK7dYYaRSsYwjYCVoODxzHCL4Ah0KBPINeV1Y01WrECPpT6UJ3zlJ0Ty\n3UgHMJFEClQ1EDTZbBnY9fYZhto6yqmKSITsfTcbgiHL4sioPHNLucsgMBF9\nUyz4bQr+Pm7r7jkigtKa5MT8lRAdgR9jpcisQEMBAggJFxX0AXsNRxgQ0W0C\n2PS4l3uS86lWTDy0Ni7EnLJI8u8eUbrMhdbLkjBn6iKJk/m+m6mYfIxwcgtV\nsa8F\r\n=iCIN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDli4IhMd9iL1Hczmvk5ZIIA3JaObXdkOmRlvTNyJNYGAiAVlBla4yiDCTXQcSP8kVzJBllzV22bFlYfwOf//A3tqA=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.22.0-canary.227a4614.0_1622131392295_0.6689204925502745"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.22.0-canary.b3d21d31.0":{"name":"@material/mwc-textfield","version":"0.22.0-canary.b3d21d31.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.8530d3514.0","@material/line-ripple":"=12.0.0-canary.8530d3514.0","@material/mwc-base":"0.22.0-canary.b3d21d31.0","@material/mwc-floating-label":"0.22.0-canary.b3d21d31.0","@material/mwc-line-ripple":"0.22.0-canary.b3d21d31.0","@material/mwc-notched-outline":"0.22.0-canary.b3d21d31.0","@material/textfield":"=12.0.0-canary.8530d3514.0","lit-element":"^2.5.0","lit-html":"^1.4.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.22.0-canary.b3d21d31.0","@material/notched-outline":"=12.0.0-canary.8530d3514.0","@material/ripple":"=12.0.0-canary.8530d3514.0","@material/shape":"=12.0.0-canary.8530d3514.0","@material/theme":"=12.0.0-canary.8530d3514.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"0346549e5547eca4c47152eae0253d802633b850","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0346549e5547eca4c47152eae0253d802633b850/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0346549e5547eca4c47152eae0253d802633b850/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0346549e5547eca4c47152eae0253d802633b850/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0346549e5547eca4c47152eae0253d802633b850/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0346549e5547eca4c47152eae0253d802633b850/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0346549e5547eca4c47152eae0253d802633b850/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0346549e5547eca4c47152eae0253d802633b850/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0346549e5547eca4c47152eae0253d802633b850/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.22.0-canary.b3d21d31.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-TFpNdIeAtl8Vti9mVKr2iT+WbGa1VW5xNxJ/uNVzVh+zBewuOP684EySYUaDfL4oc1dz47TSlfXPLZ3swFd5Tw==","shasum":"08969f6bf69df059d5fcc1a15fcd9cdc209caceb","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.22.0-canary.b3d21d31.0.tgz","fileCount":13,"unpackedSize":200498,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgr+i6CRA9TVsSAnZWagAA5JwQAKC9e+/03UDMRJglKTSl\nxFcIT+Sd29uGm+RgvYFUGdG+HktalVcnvX1tZXKFUT2oIBCPPsGO449rN1zs\nZXgJSfWb918BEWcLPv4W63FOvxEL7IDbCACkjF8ZxwJPJeGd9yvhMZWnMqcT\nX8Up0azF3v9cW+mVAuCzy70h65qITrS2CMA8MjNvXzUQ6ItKOAM0rm1kgLar\nbo1xf9/Zzd+s1rp70SAOoJtDOqudILdptmXS/kJgaNmQumglgp4GRbViFjaz\nOznkGHPPIgHNJFGzrp9yQolNtE/e7aIgYlBFrek3NuYskrJkvTQ89CGYyQsu\n+V19IZOH87hzlQQzGVbrg5G5cl6FH9xcC5pYZY9bDmffUMJxoj1wcavdWijy\nMx55d88AgkI+Vjs39oHmpm0KuT9AwBsZEt4/dJRDGOiQYV2aUTwiRM/bBDZI\nOkkEKiIxWGb98iZe4UOLjpWKuasiJZHgWFLrhWQ8QWvyGV8UrAeht0HcNFtv\n1KIAzrTTyFbC+DWSfzJQcAGwqq9pUlGWV2bRq7PvWe9THsXrR84/XqVst/85\ncllOa/fA7Nf/42O7lPLWMnbr1FPM/7BjPiMRZEkHyfkfSbuw/2m2OKi7I6aY\nJbAA139syu77VJwkE2hla7e2uSJRT3QlRn4ot5/3+FkjTg2dc4q87e0hqHHh\neZcO\r\n=Ct+S\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHDKsCglCT4axDgD5IoqA141+ZTagvzDkPdTh9WUYEEeAiB/hv38+a0HD84D9RUnCN1ZmEIzlzc6NRMCVb0gn+w7Yw=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.22.0-canary.b3d21d31.0_1622141114421_0.2725436110562507"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.22.0-canary.288c33ec.0":{"name":"@material/mwc-textfield","version":"0.22.0-canary.288c33ec.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.00b5899dc.0","@material/line-ripple":"=12.0.0-canary.00b5899dc.0","@material/mwc-base":"0.22.0-canary.288c33ec.0","@material/mwc-floating-label":"0.22.0-canary.288c33ec.0","@material/mwc-line-ripple":"0.22.0-canary.288c33ec.0","@material/mwc-notched-outline":"0.22.0-canary.288c33ec.0","@material/textfield":"=12.0.0-canary.00b5899dc.0","lit-element":"^2.5.0","lit-html":"^1.4.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.22.0-canary.288c33ec.0","@material/notched-outline":"=12.0.0-canary.00b5899dc.0","@material/ripple":"=12.0.0-canary.00b5899dc.0","@material/shape":"=12.0.0-canary.00b5899dc.0","@material/theme":"=12.0.0-canary.00b5899dc.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"69149a859b2cb2efd7d7cb7a55acad20d60fbca2","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/69149a859b2cb2efd7d7cb7a55acad20d60fbca2/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/69149a859b2cb2efd7d7cb7a55acad20d60fbca2/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/69149a859b2cb2efd7d7cb7a55acad20d60fbca2/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/69149a859b2cb2efd7d7cb7a55acad20d60fbca2/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/69149a859b2cb2efd7d7cb7a55acad20d60fbca2/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/69149a859b2cb2efd7d7cb7a55acad20d60fbca2/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/69149a859b2cb2efd7d7cb7a55acad20d60fbca2/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/69149a859b2cb2efd7d7cb7a55acad20d60fbca2/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.22.0-canary.288c33ec.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-7Q3GlhZFJa5XWoKjNDdnMl0il3P3lVQxpKBLsG5vqfi/6ez5WNFx/ocA7Co0SXs35gJY3WNNOn0eAktZsNRtBg==","shasum":"6547667c27773f7ce70b67c24c299320b41e9f6d","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.22.0-canary.288c33ec.0.tgz","fileCount":13,"unpackedSize":200498,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgt9zvCRA9TVsSAnZWagAAfKwQAJjW727+xFjne3+BV8L7\nfxPYEKn8vKL9RLrUVL+SwIGgFnvD9YDVyTjhCfASlx7Dznrw4H7vKn0pXd8j\nRPSKoo2dYNq+1VZ0dQopa2QGlUoeDY/AxxEsBoUEY/80cAMlW0PH7uNLvPl5\nG69NUUTbFFkGV0z9E4fso/AAUxmOvUXYeHYaUBL0QC7a2EJhN88gwhqNJtRU\nq1eXOYZwrHNsZIt2jWlAMzadLR2JSUZ2xQbVhJHzo/e7johCchWEOi+eVOA8\n/V0xHQW8GuO434qTJX/Z7odRtXHt2zqogi51YNYpB/WVha5XXbW6LNoZSiff\npLo/GUZKfd0V5SqTA20KWEvX4+CQ9GiAtUeAz4PHWBUioNR1Filth9cfqJ9F\ngLXJ1Rj0LF4I22g+vEO8F+tsKM041Wj7op/SKQ63RvPcSKPEx6v03KYQCJtF\n9iYjuQOYlLq69UMTWilSvQzH1noj4y3LV2l6ujdrfRvSjU40MnEU1KR+Dy38\noSMQ2tKYd433UCBpw8WjCp7PwI2gNffUdmI/uf9XsGyJwIFJJUfUudDNKnZc\nYrclfNMWhDkvj2ThTVRLN8VV7CxP6+X37anbhk8ptiLy3bvKLg25BRhGvoX9\nwaxZ6XEZYlN5MkVUR3Y8SbHM6MPxJIU15esY7jJbzm80rKYXwRaBj6zqBrmV\nabTj\r\n=omDb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDKbbzpLyS3wmJkAdHB4CjqDEVu6RwZs9bKEEtPYnK+rQIhAO0V7jm/nyHI2nDj+X+9onBBAvv42fn9PoaV2y88haq2"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.22.0-canary.288c33ec.0_1622662383382_0.3408966466084036"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.22.0-canary.7eb7ccb0.0":{"name":"@material/mwc-textfield","version":"0.22.0-canary.7eb7ccb0.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.474de7878.0","@material/line-ripple":"=12.0.0-canary.474de7878.0","@material/mwc-base":"0.22.0-canary.7eb7ccb0.0","@material/mwc-floating-label":"0.22.0-canary.7eb7ccb0.0","@material/mwc-line-ripple":"0.22.0-canary.7eb7ccb0.0","@material/mwc-notched-outline":"0.22.0-canary.7eb7ccb0.0","@material/textfield":"=12.0.0-canary.474de7878.0","lit-element":"^2.5.0","lit-html":"^1.4.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.22.0-canary.7eb7ccb0.0","@material/notched-outline":"=12.0.0-canary.474de7878.0","@material/ripple":"=12.0.0-canary.474de7878.0","@material/shape":"=12.0.0-canary.474de7878.0","@material/theme":"=12.0.0-canary.474de7878.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"54dcd68c7454a24c791e5bc1bacb53ff095de147","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/54dcd68c7454a24c791e5bc1bacb53ff095de147/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/54dcd68c7454a24c791e5bc1bacb53ff095de147/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/54dcd68c7454a24c791e5bc1bacb53ff095de147/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/54dcd68c7454a24c791e5bc1bacb53ff095de147/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/54dcd68c7454a24c791e5bc1bacb53ff095de147/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/54dcd68c7454a24c791e5bc1bacb53ff095de147/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/54dcd68c7454a24c791e5bc1bacb53ff095de147/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/54dcd68c7454a24c791e5bc1bacb53ff095de147/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.22.0-canary.7eb7ccb0.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-EfinqU1GHdaQMHjWxChVoFAXQ0swjJ2ieZYHKxxTvWfOkW5r5SVHAK6oxmk/8qfosjjQJPKsXpHDYUdi8mx70g==","shasum":"8269b629457e9c0127b314f2da7ea8107c6715b1","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.22.0-canary.7eb7ccb0.0.tgz","fileCount":13,"unpackedSize":200498,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJguTOVCRA9TVsSAnZWagAAvKMP/00ROQKOAeRdDOJv/EY3\nSeEXR2213ovViDEJS9E9j/jDju4MqCJiwjYU+F9BfhAMMLao2VZDcAAMI47G\nZVL28zQnWZRFEBgOyw5mYBe5sCMwIz9hWwGRcJkvBKypKP9zRaYKfqoE0GWk\n2xvJixqSNwQ0puKHReTbGquuTw3iEmvoEY3OUax48c9xp9kjUOEGRd2n+B5D\nBWqHoUktQ339+29yyMfeVLNTg8Lt+u9W3Pl+kLgRcR56pIOBasPty74tpgzF\nu1WQs9HhCvhtRaFt93h0kPeb4TN3dfq/3qD0Q0mn165SYTNda2JHbFtLp2uf\njFnZRCIaZOYqF6edKCdeDttjhwezK1VkgToWPQ/Or340/SyVcaPe0zbYCZv4\nfJSeRPxc5/4jWkL5ASVOFbKzyi+jYLFPVCngn5DpzoYOSaXpkgWwJONUIXkG\n0GYmKY2UyohjR7V+DBoyvLjchhLZXTNmtRQ6smkl1HS6Wp3SRVL4KntUg30k\nw/3TCXKB9Jda97NjE4CcYcclCNHRJrk9+Rjdbd9jg7dcZs+XN+5F+h7Jvyip\nlDf9uzarkjyIlAYZ+pY50f4EYD0AMonie3ev4Xc5rY0KaUNaZNKYCpr9WVPp\ntQQDTLtU8UkqguUIG+wsETTfvA++JdCcsDtY9H8EygSfT9Ok3gPEdhKR0zSN\namHN\r\n=pQoe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC4uuFFJCroWKHbZ8G+aKG8MALB5NA1iRUoin1sstQFlAIgJojE3eVdlp3yankx7/d8+NtBoC0ICbKdNRWYyD2NA70="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.22.0-canary.7eb7ccb0.0_1622750101668_0.5651583614145599"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.22.0-canary.7fcc0726.0":{"name":"@material/mwc-textfield","version":"0.22.0-canary.7fcc0726.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.474de7878.0","@material/line-ripple":"=12.0.0-canary.474de7878.0","@material/mwc-base":"0.22.0-canary.7fcc0726.0","@material/mwc-floating-label":"0.22.0-canary.7fcc0726.0","@material/mwc-line-ripple":"0.22.0-canary.7fcc0726.0","@material/mwc-notched-outline":"0.22.0-canary.7fcc0726.0","@material/textfield":"=12.0.0-canary.474de7878.0","lit-element":"^2.5.0","lit-html":"^1.4.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.22.0-canary.7fcc0726.0","@material/notched-outline":"=12.0.0-canary.474de7878.0","@material/ripple":"=12.0.0-canary.474de7878.0","@material/shape":"=12.0.0-canary.474de7878.0","@material/theme":"=12.0.0-canary.474de7878.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"55ab1f053532307fcc5a331fdc4718c7d8e5d8dc","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/55ab1f053532307fcc5a331fdc4718c7d8e5d8dc/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/55ab1f053532307fcc5a331fdc4718c7d8e5d8dc/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/55ab1f053532307fcc5a331fdc4718c7d8e5d8dc/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/55ab1f053532307fcc5a331fdc4718c7d8e5d8dc/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/55ab1f053532307fcc5a331fdc4718c7d8e5d8dc/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/55ab1f053532307fcc5a331fdc4718c7d8e5d8dc/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/55ab1f053532307fcc5a331fdc4718c7d8e5d8dc/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/55ab1f053532307fcc5a331fdc4718c7d8e5d8dc/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.22.0-canary.7fcc0726.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-RaGyK1lotGxGUPVvO57Y1CyZi+uvMo9gNwnc4HZPiIaT+x4SYdSYehKlo0/8DIuJUjZNKnkULYdZ6YF0SGQhRA==","shasum":"77b79d97c6c91af2bdb17500d3f6a65be3ce70bd","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.22.0-canary.7fcc0726.0.tgz","fileCount":13,"unpackedSize":200498,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgvr2oCRA9TVsSAnZWagAARIAP+wbeLjKcPWMFRpHPVgAK\n4HTnncV1sk5kGpYP89Y0FP60KFxXP4OAIEKdaHsAafpJ/32d4ePBM/iZeyWQ\nhaNONiu6wPCfPKuYqs7/Jk2LhlYtkmyTDN8D0pW92pXCbRbDsV7rf9DAAvOy\nCD8X3MJuUAGrpi9AGuWjMvwC0V/OMkl3QDSoHi+3RRJ9caH+sab7TmELaS+n\nMGxrFH5jfSa3DQSBgdXs2B/xaKWG88FnFXunzIwp3u89ItiPN0mmppbTN98S\nCaWenne1sVwyZfIAlbUrXAgsH7P9yBO6Q87GTeblXazDf9EjE6woWF8yE+7g\nkrB/NJ3GmNcjyZKzaj0gDmO+PRGlMt7D4B7GK6qk+Ysd0MKZc+G6sAbT9t+E\nB5jym3hgyVGsqDytHYnjY69IBhFQHg2c5yFS6f3Ysd/U2A7GTYdMv9nz9Mk5\nMHXeGAQ6bkBPJ4A07FtwjVsLYVlYszwfoQ+GvwjJEUL9zI4NrtLpiAGVMtRN\nXfiOil8xj4nl6HY6O+QTnwIhWFaqOfEtTfW2FIu9IVTYwEQZKG0JyDSkH5Rv\nnVpd4DMa/I5sdVqxjxLGY8PXqEnY+F5rrbE2iazRb7dtZebi2GQk4MeUDUSW\nRzaoZR7QTsnBTKW99UyAbVZOZTHhlwWW4q5OsxpyYL0MIB3jpxLcOLJDiZGA\n2Gx5\r\n=OyjC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC4ihkpr9KbZAjIiACZTsj42NLs3NtFNQBvf/FxPB0BoAiBtstWLW9tgwZyr7MmmP0Ta6ufM13XiIAP3YS10PXgH5A=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.22.0-canary.7fcc0726.0_1623113127904_0.9608642411691826"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.22.0-canary.220a4e5e.0":{"name":"@material/mwc-textfield","version":"0.22.0-canary.220a4e5e.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.474de7878.0","@material/line-ripple":"=12.0.0-canary.474de7878.0","@material/mwc-base":"0.22.0-canary.220a4e5e.0","@material/mwc-floating-label":"0.22.0-canary.220a4e5e.0","@material/mwc-line-ripple":"0.22.0-canary.220a4e5e.0","@material/mwc-notched-outline":"0.22.0-canary.220a4e5e.0","@material/textfield":"=12.0.0-canary.474de7878.0","lit-element":"^2.5.0","lit-html":"^1.4.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.22.0-canary.220a4e5e.0","@material/notched-outline":"=12.0.0-canary.474de7878.0","@material/ripple":"=12.0.0-canary.474de7878.0","@material/shape":"=12.0.0-canary.474de7878.0","@material/theme":"=12.0.0-canary.474de7878.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"43930a9e907fac042066906c7c9c4a9bc26e3233","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/43930a9e907fac042066906c7c9c4a9bc26e3233/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/43930a9e907fac042066906c7c9c4a9bc26e3233/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/43930a9e907fac042066906c7c9c4a9bc26e3233/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/43930a9e907fac042066906c7c9c4a9bc26e3233/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/43930a9e907fac042066906c7c9c4a9bc26e3233/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/43930a9e907fac042066906c7c9c4a9bc26e3233/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/43930a9e907fac042066906c7c9c4a9bc26e3233/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/43930a9e907fac042066906c7c9c4a9bc26e3233/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.22.0-canary.220a4e5e.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-OQMyu8ElG9VWEsiFdu96VsBzLb4Gf35KbwJkNmj4k+cMbbcZU+11G3JxGJVQA+kKJIyoVm1f9I/b9SN1FLJ7uA==","shasum":"b5bae66b64e121ecc800fbe066364f360367a8a6","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.22.0-canary.220a4e5e.0.tgz","fileCount":13,"unpackedSize":199714,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgv63PCRA9TVsSAnZWagAAd64P/2WAt+cBi5zReRZ8W3J8\nQC4cLeXCazls3TDyrCdm3E7B9J7ynsDVYcMTTuIp+6J/9omiE1Bvu8bLvzkL\n8EBjntIqA4d31ICNTZpAbeLzqb+TMEtyDv9JoorsbewzSFvC/o8cPLkAwkem\nD1EKQai/GTomka2QAG7ukSzKQMi3ZRUf8RMRyFqe4l5X48YpzguEEr98Kods\nlnTdj7uU5xqUNYmOrDT7odXE0MFR1AXbDf+jX8V5edu+gViSovRbAG5IwPm6\nlbe5K+joFyjCPZU7vYgxZjT6cWOw2/0bLen3OV8UzpSadg9QmwJmNQEtep2w\nuYagnHdtw4qI9NESDXZf6t0mr2wUtpUd2+gLzKDOC48uYayJmzvoWsLDy2Cg\nJ4pVHw5LTYjoOCDRKztP+8bpcLlL5He81CfWOgvmjtS/StHgtaLnkV9Qz9p1\nvDamYayNRHA6A5CqYiCAuXMhzco5kCAozJaKUITiqcSiYX36jt7vK6d+l4Op\nIbcKU5LZikeInZBE+nPFl3ikcnDqrxYlZkysZ87Ejwq/5pOJ48Gu9rH7NAfN\nKADIomPvHvv6H720A+z0ONEWxKAOcUnHZOp7llFkGab3keMVOFeifR3cw1Bu\n+liTrKocE/iwQjeaT5K9fr5jfscD8VuY/rU2XVnOvHziOLW6vzCDyTlxyIOW\nkVsu\r\n=0+zg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE15TrXqwuyn2bYfnHbmN0BCEgDbs0nq5VQNNWlemEqRAiAb2EEfTXHWpGeJV7zmTEcW6prBSv86UFKb5lJvM31p9A=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.22.0-canary.220a4e5e.0_1623174606995_0.9115671381950454"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.22.0-canary.6b2d6ab0.0":{"name":"@material/mwc-textfield","version":"0.22.0-canary.6b2d6ab0.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.474de7878.0","@material/line-ripple":"=12.0.0-canary.474de7878.0","@material/mwc-base":"0.22.0-canary.6b2d6ab0.0","@material/mwc-floating-label":"0.22.0-canary.6b2d6ab0.0","@material/mwc-line-ripple":"0.22.0-canary.6b2d6ab0.0","@material/mwc-notched-outline":"0.22.0-canary.6b2d6ab0.0","@material/textfield":"=12.0.0-canary.474de7878.0","lit-element":"^2.5.0","lit-html":"^1.4.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.22.0-canary.6b2d6ab0.0","@material/notched-outline":"=12.0.0-canary.474de7878.0","@material/ripple":"=12.0.0-canary.474de7878.0","@material/shape":"=12.0.0-canary.474de7878.0","@material/theme":"=12.0.0-canary.474de7878.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"b5388003b8ae379bc5c274e40db94c05a19d7ea1","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b5388003b8ae379bc5c274e40db94c05a19d7ea1/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b5388003b8ae379bc5c274e40db94c05a19d7ea1/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b5388003b8ae379bc5c274e40db94c05a19d7ea1/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b5388003b8ae379bc5c274e40db94c05a19d7ea1/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b5388003b8ae379bc5c274e40db94c05a19d7ea1/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b5388003b8ae379bc5c274e40db94c05a19d7ea1/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b5388003b8ae379bc5c274e40db94c05a19d7ea1/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b5388003b8ae379bc5c274e40db94c05a19d7ea1/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.22.0-canary.6b2d6ab0.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-KYIANMgqQj4OuehdQhELPl6/68Vob+uv3+LsYhf3M6HoKgc7WFn6InBr1chTpdgRiWd4FVSLWxsbmnYiMWdqig==","shasum":"30efbc8088dec3ea69eb8e18cdff7b94f6b15342","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.22.0-canary.6b2d6ab0.0.tgz","fileCount":13,"unpackedSize":199705,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgv7i3CRA9TVsSAnZWagAAtq4P+gI4VtsXo3g7dvZKVacd\n18wXCRhq1Gw69OdT4UXYSskYvjS3dO9XsKbGrLuRT2xalWEBu4GY285Gzaab\ndbhf7Uu0sYTHBqtDv1MeuBcuTa3C18kKfVNp91pHWya0+XGmp18LZ8m+XtbI\n5Vk3Q5dt71nfxokUCGZbMztsP9Ggbzl1XfcYYIa6IVJCRUtSGLKK0040XDgY\n5YOaxqrUdjZjkho+miHhJHv4E9HQHRt90bKYmtgmrbjLqf3EOTMC4k51UmYq\nJil42naQd2wZTpDctQaKaAWHVHIc5o6I+kEhqpkLQPpgnMedqJm23iHXydxH\na5/n8Hf6CHpnf2J21Fh79FdzQQCvB0xZ4aDp6haJ9dmdxc51YOFrMWp2mISm\nh6/0uKhqD7CQeqm3ImNfuG64fkQQHHTW8D2KXBj1KeI3GiTEFuZ7ZB1+pGcR\npkg13P18ZQOjPH5+4tBP7VnC4pt42n6nM5Abfi7ItkVRkJJguxBj7c7nasVF\nbS8fNGD9SUPLfb9X2feSV8kJMbrPW2V9YKO4HBfUEfcFteWf+3b4rYOOFcv3\nrUx49zUidxBNZboredqwZPvzcfkYVUSV8Ou/fbP0N0oblVEApMneHFQrjnaN\n0H26NLEIF90kSI48eUMQjxgGoimMtz6/GkDP3KI6THTulxEfhj2A6+vgm9vO\ncitf\r\n=HqVo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEjFKNVbXwACL0AQbOLLkNyl2mi1ES8EA+VqiuvXUSXpAiA/Lr37tG9tSPZe90PF9+K8iXpty65R6bGf70d17jIG6Q=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.22.0-canary.6b2d6ab0.0_1623177399155_0.822332081807122"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.22.0-canary.2b20825e.0":{"name":"@material/mwc-textfield","version":"0.22.0-canary.2b20825e.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.8415ae585.0","@material/line-ripple":"=12.0.0-canary.8415ae585.0","@material/mwc-base":"0.22.0-canary.2b20825e.0","@material/mwc-floating-label":"0.22.0-canary.2b20825e.0","@material/mwc-line-ripple":"0.22.0-canary.2b20825e.0","@material/mwc-notched-outline":"0.22.0-canary.2b20825e.0","@material/textfield":"=12.0.0-canary.8415ae585.0","lit-element":"^2.5.0","lit-html":"^1.4.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.22.0-canary.2b20825e.0","@material/notched-outline":"=12.0.0-canary.8415ae585.0","@material/ripple":"=12.0.0-canary.8415ae585.0","@material/shape":"=12.0.0-canary.8415ae585.0","@material/theme":"=12.0.0-canary.8415ae585.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"8790f27506406085c946b5033334ea71328fcb6f","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8790f27506406085c946b5033334ea71328fcb6f/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8790f27506406085c946b5033334ea71328fcb6f/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8790f27506406085c946b5033334ea71328fcb6f/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8790f27506406085c946b5033334ea71328fcb6f/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8790f27506406085c946b5033334ea71328fcb6f/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8790f27506406085c946b5033334ea71328fcb6f/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8790f27506406085c946b5033334ea71328fcb6f/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8790f27506406085c946b5033334ea71328fcb6f/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.22.0-canary.2b20825e.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-Fd1N9nppXmi3oFHqd6vwyFRsRmuvNfb5VN0hj8LwlspIVNJRk740TzNuwFSjpid9KJwyYZct1pL88Jg59OwvSw==","shasum":"a8c4b5d2d52c9982a5bf0180a67840e0bf5e2287","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.22.0-canary.2b20825e.0.tgz","fileCount":13,"unpackedSize":200233,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgw/ZtCRA9TVsSAnZWagAAu+oP/0yA8a4OdnGGjai40FnH\nhBUkZIVdFjfqHYDCB4ndFEZ5cCaTD+nhndH35r38FPXWFHrivUWmhUYpp7/c\na2yvFLbZ83RNN0Cb8ZdnOQritjEvpfDmWWL6QR4TUgdyNF/PiiI2G3DyxPD3\n8sPgU71SUSFWtg06H0lAkhZ7BkWV80uhQpZk8QJLIxIXj42+z/7ADV6sVkh8\nWXTwMhBWEC2D21RRziBsr/kgTcEIKZJojmL37B3wxbHSw9EXcX/S803Qs1WM\ntoX8JO3BBcvgjcUFX+GQ1vR0xbqYA7r198bNemoyvAU7I7oumbpq2JwuQSPh\na8b0CLEP6J8ImuNqjckvWInS7T+v5BcXNRQTMt/hvnMN9EsSyxK2DuAE43Ur\ns0bhsrqaKwYBxhv8KkgVrHBKAwqLWKRVftWwhwlnj2OI10WQgTUevjWacxSh\nVLtulByPo7YSN2ZlFlIKA5cQiPv7yIdSxZYqh5QSM3cq0WmY5RKpyCKBDTVk\nOt+9eV7OEihZIYQUOznqhTHKGGSFkpbIEJPpcJe5BF3zjmj/a+SAIb5kTK+o\nIf5BRohRYS9RcfTNINgz2ZDjsEOsqTQJqpQzrgW6I2vEtbIOAOKeOgaCzcm2\namUTORFg42UzaifmH/4tdY5CZK03qsvpiCTR5ARjAs5+ryUY6MjTYlhym+70\neZU/\r\n=RxVb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICi5uvGye3TruPZCI2n4jhwvXVgKn/3M0p9rghS8BIt5AiAL4u2yNAKtRRQUV/QHsb6urEw5P8CYkXV1bn+8tA2Ybw=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.22.0-canary.2b20825e.0_1623455341140_0.3679972769023634"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.22.0-canary.e1511867.0":{"name":"@material/mwc-textfield","version":"0.22.0-canary.e1511867.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.8415ae585.0","@material/line-ripple":"=12.0.0-canary.8415ae585.0","@material/mwc-base":"0.22.0-canary.e1511867.0","@material/mwc-floating-label":"0.22.0-canary.e1511867.0","@material/mwc-line-ripple":"0.22.0-canary.e1511867.0","@material/mwc-notched-outline":"0.22.0-canary.e1511867.0","@material/textfield":"=12.0.0-canary.8415ae585.0","lit-element":"^2.5.0","lit-html":"^1.4.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.22.0-canary.e1511867.0","@material/notched-outline":"=12.0.0-canary.8415ae585.0","@material/ripple":"=12.0.0-canary.8415ae585.0","@material/shape":"=12.0.0-canary.8415ae585.0","@material/theme":"=12.0.0-canary.8415ae585.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"37d9e0b693215142b4667122baccbb1b6fc9f835","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/37d9e0b693215142b4667122baccbb1b6fc9f835/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/37d9e0b693215142b4667122baccbb1b6fc9f835/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/37d9e0b693215142b4667122baccbb1b6fc9f835/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/37d9e0b693215142b4667122baccbb1b6fc9f835/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/37d9e0b693215142b4667122baccbb1b6fc9f835/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/37d9e0b693215142b4667122baccbb1b6fc9f835/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/37d9e0b693215142b4667122baccbb1b6fc9f835/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/37d9e0b693215142b4667122baccbb1b6fc9f835/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.22.0-canary.e1511867.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-MLk2hyV1KUZpyOk0bdb1zjsatkDZXdg7QumXjMQc1WhcjbsEINZbA5VUxxlq7MnCmy9KZRgWqmYQlcI4FE4TAg==","shasum":"31e5a62a37ce59b44c9147b5fb3332fa2c895696","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.22.0-canary.e1511867.0.tgz","fileCount":13,"unpackedSize":200233,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgxAZuCRA9TVsSAnZWagAA/hwP/0N3CfUV0SU1VGk+j6Zi\nSHgR7xN3XuivEUZwZJyzC+s4fRSqWXCWi/3pj2lMc5eAov/ZqfOabJ6FsOE/\n9ztdV6QfOJx+5KnaG3gz2TuNIy74Wqql/QCt54fK559K8iYH28FVF5SElyuo\nZfw+OECk16iNNH+MhtRssQpoLoo92xKZCNRrxnaxKE0XfwfYSBFyshzbaWeh\nyx3RwXjPG/CiZTGh3Dscj8rqPjbFCMSse/kpYT+Wl1uBTakoTKPObudgFOyx\nYi9nUTSsK6sZWKrgI2ERCVDTR6vMsFrJyy89HKcJ+rJ8wDieSkd64pBp9l6U\nPNVpX9xmjgPrZC9WGbwnSOlR3s1adl8jlCd7CPcFwSIN655w/TpRMGCZeBl9\n9Njja7/zUaAw0i/PvUI8yuwrTRmNlo2LRjadODYGQrInte1cb+y6l4GtKZl7\n/30Ey3TQlELTvMyvyr+fZhFUi6FLMKs4i3WL8AjAFW3Ke7au3XwQ5c6rBcqY\nl+8JEjNddooXnt1dTGpq6aiGEN1rbqjE37QpE4oshU0/gO/Gmpz1EnjDOgg5\ngcbt9M6OCs3MhEgEmd8HXkc4RVK5qeQVdDeOg8DBX6DAOS/J0I+lBocP7vFE\nM/mEPRMgGPNxAHidy9mA8fjCpwCuiguMvOZrXcMFZvkFwnFFK2iEkfV5ZzIP\nS7ck\r\n=7Htu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDedR2QEnCeV5upCDwJ55Ts3I3lCWCEQgCcU+5tFtMtkgIhAK3ZsSRUSurQHtg6JGJ7vUDqeCNeA9iUiCf+rrn8mW1d"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.22.0-canary.e1511867.0_1623459438064_0.04543206358255092"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.22.0-canary.ef4a0c0d.0":{"name":"@material/mwc-textfield","version":"0.22.0-canary.ef4a0c0d.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.8415ae585.0","@material/line-ripple":"=12.0.0-canary.8415ae585.0","@material/mwc-base":"0.22.0-canary.ef4a0c0d.0","@material/mwc-floating-label":"0.22.0-canary.ef4a0c0d.0","@material/mwc-line-ripple":"0.22.0-canary.ef4a0c0d.0","@material/mwc-notched-outline":"0.22.0-canary.ef4a0c0d.0","@material/textfield":"=12.0.0-canary.8415ae585.0","lit-element":"^2.5.0","lit-html":"^1.4.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.22.0-canary.ef4a0c0d.0","@material/notched-outline":"=12.0.0-canary.8415ae585.0","@material/ripple":"=12.0.0-canary.8415ae585.0","@material/shape":"=12.0.0-canary.8415ae585.0","@material/theme":"=12.0.0-canary.8415ae585.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"97de9eb21ffb99cc05f4ad3fe8dc24ffcb569bcb","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/97de9eb21ffb99cc05f4ad3fe8dc24ffcb569bcb/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/97de9eb21ffb99cc05f4ad3fe8dc24ffcb569bcb/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/97de9eb21ffb99cc05f4ad3fe8dc24ffcb569bcb/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/97de9eb21ffb99cc05f4ad3fe8dc24ffcb569bcb/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/97de9eb21ffb99cc05f4ad3fe8dc24ffcb569bcb/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/97de9eb21ffb99cc05f4ad3fe8dc24ffcb569bcb/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/97de9eb21ffb99cc05f4ad3fe8dc24ffcb569bcb/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/97de9eb21ffb99cc05f4ad3fe8dc24ffcb569bcb/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.22.0-canary.ef4a0c0d.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-l4g5e0BinxyqbnxGD4AqJzalA4GDXqh/fXJl7bHvz3O4W6LIoVbxSvEpFOXLQ+Gl4Y7jsfswxjiA8qZ9O8d+Eg==","shasum":"f0b2e6685f20f24d59e41a54929d11ba3a859740","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.22.0-canary.ef4a0c0d.0.tgz","fileCount":13,"unpackedSize":200233,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgyQTWCRA9TVsSAnZWagAAz24QAIJ9SU6iQlmpaDciRYuZ\nL9OplOEY3p1hWZJeML4X2kmOZ81tcwnA4M1TI4xi2btq1dE23KdQ1onka/B6\nmfF0R797m/h6GWHASCsureb/wxzUV9e4zYlUupyeBu2H3a9fwmMN/7JoKbxu\naYrCaQ1WLT0PLT/dOtZU7qxTEx3CE/4VKP0DvF0A8UpMAat3gdqdHn7CElQO\nLtN2PQkDfivLf1YK07Vraazeba48YTSmjiNB7/tj2TNVxTiwa82k6lD71JgL\n8dBJi7bGtTAH4VN6/IC626O9zBzUjI5NaY2AhaBEKG5cthpPZDuEhvfJTM8R\nH7P0oBBv0k5Bz7zF4VfIY4dzXbXtbFh6YUv3EbaxurbeRsgOiu6qVq9N/LjV\nHA2S8EzPqiB7Iptgg/vDVhhnRAXHvPDUz2+gLfV089zeFx92PL7Bqy3v/3t4\nJsYEqyHUsBgnivA6pWGnxBKcCJaBIOdH3YhgOwSmwuN9o+dnG5AmR/y46vGV\nnPPTh5l3bDAZz4MuSj/TY8Ir9Q+XX9meT6lzd4A0GqZ4nbrO2XQvE6DhmaYS\nUN4DIklKF1MzM9qIgLMrFFNjOM2IdnNHWCjDbrCXlu0dO2KHqP95ANaEwBNN\nr1mgC7DnD4tsLjePoYugaQUWLpXwiqeTJLBFL4pothtm3+btjKdFXh7+jkDw\nsMLf\r\n=D6UU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDCuFlDte//KZsfRwf8zap0HcLRZ9bn5n3Y9j2QQArFKAiBMPs352nz7OOnptnpzHqeRRZg2wfqSmkDE1cVkVBdZ8g=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.22.0-canary.ef4a0c0d.0_1623786710333_0.09231230043922878"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.22.0-canary.573d8913.0":{"name":"@material/mwc-textfield","version":"0.22.0-canary.573d8913.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.f705e8048.0","@material/line-ripple":"=12.0.0-canary.f705e8048.0","@material/mwc-base":"0.22.0-canary.573d8913.0","@material/mwc-floating-label":"0.22.0-canary.573d8913.0","@material/mwc-line-ripple":"0.22.0-canary.573d8913.0","@material/mwc-notched-outline":"0.22.0-canary.573d8913.0","@material/textfield":"=12.0.0-canary.f705e8048.0","lit-element":"^2.5.0","lit-html":"^1.4.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.22.0-canary.573d8913.0","@material/notched-outline":"=12.0.0-canary.f705e8048.0","@material/ripple":"=12.0.0-canary.f705e8048.0","@material/shape":"=12.0.0-canary.f705e8048.0","@material/theme":"=12.0.0-canary.f705e8048.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"13a9b9717491f67b5f5a219b279328890c0c951b","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/13a9b9717491f67b5f5a219b279328890c0c951b/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/13a9b9717491f67b5f5a219b279328890c0c951b/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/13a9b9717491f67b5f5a219b279328890c0c951b/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/13a9b9717491f67b5f5a219b279328890c0c951b/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/13a9b9717491f67b5f5a219b279328890c0c951b/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/13a9b9717491f67b5f5a219b279328890c0c951b/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/13a9b9717491f67b5f5a219b279328890c0c951b/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/13a9b9717491f67b5f5a219b279328890c0c951b/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.22.0-canary.573d8913.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-y84h9Q+n/C0FjueLLBbtwrrAH0K5jTzvUuzMm9dj1vUPoOi4CnagZz+3quaKHb3z/Ft97MzhacKYNy3myGHeww==","shasum":"235b9ced50984444fa15630e0d03536bda4d5881","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.22.0-canary.573d8913.0.tgz","fileCount":13,"unpackedSize":200233,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgzSuxCRA9TVsSAnZWagAASWIP/0mC3i7QIac65ywoqGpK\neh+5pRSjTJ3N+rnochDvE+uYwLbx1djfTMjrxjW0/kjej1FC0II9Mg5ndarO\n5BnYwsrn9ggMDCoMWQMLN3+bnTJdGlBPW/RV1lDP3SKSHiMprfAuRlPiuYQ2\nIvdLHsg5FQ8GVpAYufQ2ZznOM20VLtDiGE4pqYTh6WdfcAoEonwJs/P2VI4n\n+PcCjRh9Q4rci/3mkp+e//htq6UFTrRWGTqvRylsVrFEyN2HEM8tRpY+29P+\nubHgeAi1yfqLFARFTpMe9DKhbDiPAz8bgQ/ujb6mmSLyJe4rqfGXg60nI06w\nLik2YFHMSQukTfDYaWIuu+Tep60H1RCQr+EvIwvaSPfoL/sEckxNy3i2X5Yc\nEv/+0csRXHsw5Y8nj8I7gUGSf6t5bNUr+BXWukh7cjTzEg5pLEJYvIGHSMmb\n495JBaedAPVwDSHxEtc6T14cuv5pAaYqtI4Y6kg3tY+AfIGHYckOE8pDHxSI\ntYaKPV4LwXzO0aIE1VQwUQ0+sSMRIeD7zNO5tdEKw7xzrsbZsW4z362NNVnS\nrk7i57WVXYdVrHbVrV26ZbfDq1Z0CEFAJgHtzNoUq7GfOdXwhIriVcCYlN8f\nN6twRrp5M+Px4lbgULZFcXUoP6Y2DBHX8pPJzXPGPvjh64wwSWS8V6bElMkP\nJDqu\r\n=MbnE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGV+6r7LcqvRGBv9ZErjLEbIU9cIlqpfyBZEjGOX6m4pAiEA83kDVJ6rtZCtlYx9qw4ATZWvfOUJTwj7+mBmEWRYd0s="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.22.0-canary.573d8913.0_1624058800617_0.4837710958132184"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.22.0-canary.21dba001.0":{"name":"@material/mwc-textfield","version":"0.22.0-canary.21dba001.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.f705e8048.0","@material/line-ripple":"=12.0.0-canary.f705e8048.0","@material/mwc-base":"0.22.0-canary.21dba001.0","@material/mwc-floating-label":"0.22.0-canary.21dba001.0","@material/mwc-line-ripple":"0.22.0-canary.21dba001.0","@material/mwc-notched-outline":"0.22.0-canary.21dba001.0","@material/textfield":"=12.0.0-canary.f705e8048.0","lit-element":"^2.5.0","lit-html":"^1.4.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.22.0-canary.21dba001.0","@material/notched-outline":"=12.0.0-canary.f705e8048.0","@material/ripple":"=12.0.0-canary.f705e8048.0","@material/shape":"=12.0.0-canary.f705e8048.0","@material/theme":"=12.0.0-canary.f705e8048.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"f26ab3eb589dc34a464186e9b323c9a9bd20fade","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f26ab3eb589dc34a464186e9b323c9a9bd20fade/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f26ab3eb589dc34a464186e9b323c9a9bd20fade/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f26ab3eb589dc34a464186e9b323c9a9bd20fade/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f26ab3eb589dc34a464186e9b323c9a9bd20fade/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f26ab3eb589dc34a464186e9b323c9a9bd20fade/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f26ab3eb589dc34a464186e9b323c9a9bd20fade/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f26ab3eb589dc34a464186e9b323c9a9bd20fade/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f26ab3eb589dc34a464186e9b323c9a9bd20fade/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.22.0-canary.21dba001.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-S8zljI8IEqQtzsOwA2do2akXceCi/Pn1QAm8sODY3dFguJobAlySxPYf6m4eTS6i7VdWBPtbLbQsOyTYT9Erww==","shasum":"c4549dad69fdd8af6a6030d13e8c68efe3c4356e","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.22.0-canary.21dba001.0.tgz","fileCount":13,"unpackedSize":200233,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg0QdQCRA9TVsSAnZWagAAhzwP/2S0C2ELP/x43t01Bgcx\nS1ZgREJTKP5NJGCWOvAIXQnXBZ5zv21u6dNC19vzL9h68NnnWRw2NywQHgX9\nj0tcA8f45wws+MWTZPu6NtpBcqVx6dyyPyzo8zylInfzrHza4NBaxwIKPMA2\nyaNimfKknDlwzX0GJOlAvzB+ocdG0zvK7611TCm8d3sqSfrVkpm32E96xtF8\nagrRIN1+x0HbAY4UAZbInfkOMO5UP2VwE47IQovWF/+enTw2ejlmzd9CJiFS\n6a7VdNZ8C9KkX373L9+p9g4e+LBVQnROYe9xvkXhOfpsxenVvPNCmDROihCK\nAWYLR8Ly+oTaAF5Jf7JJypo3gjFQoPmL10YmRHgOVAl5g6kMoL35yn5WKiM8\nkxwKGs8MslCoU4IIbB9RCpij4J9ZBRLbj6sGPP6vYJ6SJdtWY5CyWoMvhbIT\n1OVaXfgXQ3d7aMuXiZxs6xHUlLgULgNTX0XfNZzHaDDn4N8n0Z6KiMI0T6O0\nwaK2igG5DU4NbBFuB4A9VV9ZeD3tEdDXvCvcurMea4w4RiUTGmd5oEwV5OaP\ne8iAJxH4LQ8Jaquu3gk7x66plZ1z0fZvtZargulOL7OSu0oEEnq7IKDSDbRL\njl1xa2mEZ4mZ1BckA42ts+XsLLlnoowyVYEJfVFW+r9/HPk3Y4yPo45ZutBK\nsla6\r\n=pgAO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGrUjDXiIetBPgW0mLTYF9eDx5GlB28u/Yqo/6sH2KCRAiAd7JpdJcP63yk/pirqYf8NTna2xtCENJ+F/R3lfTZOQw=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.22.0-canary.21dba001.0_1624311631601_0.05705637426348331"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.22.0-canary.6f5bfd0f.0":{"name":"@material/mwc-textfield","version":"0.22.0-canary.6f5bfd0f.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.4ccd39bdd.0","@material/line-ripple":"=12.0.0-canary.4ccd39bdd.0","@material/mwc-base":"0.22.0-canary.6f5bfd0f.0","@material/mwc-floating-label":"0.22.0-canary.6f5bfd0f.0","@material/mwc-line-ripple":"0.22.0-canary.6f5bfd0f.0","@material/mwc-notched-outline":"0.22.0-canary.6f5bfd0f.0","@material/textfield":"=12.0.0-canary.4ccd39bdd.0","lit-element":"^2.5.0","lit-html":"^1.4.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.22.0-canary.6f5bfd0f.0","@material/notched-outline":"=12.0.0-canary.4ccd39bdd.0","@material/ripple":"=12.0.0-canary.4ccd39bdd.0","@material/shape":"=12.0.0-canary.4ccd39bdd.0","@material/theme":"=12.0.0-canary.4ccd39bdd.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"38e391cc489598145e8956cdbc0a234563260efe","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/38e391cc489598145e8956cdbc0a234563260efe/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/38e391cc489598145e8956cdbc0a234563260efe/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/38e391cc489598145e8956cdbc0a234563260efe/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/38e391cc489598145e8956cdbc0a234563260efe/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/38e391cc489598145e8956cdbc0a234563260efe/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/38e391cc489598145e8956cdbc0a234563260efe/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/38e391cc489598145e8956cdbc0a234563260efe/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/38e391cc489598145e8956cdbc0a234563260efe/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.22.0-canary.6f5bfd0f.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-+eYuH3upeDPeyoN9OSpmwOFC5kxQP7ArP5AOYqr7V3hWn12e4VQ8jUknUlS6RapK6B+xKna5Iejgh0Q9l4fLcg==","shasum":"9717c780744497cd1af37b27eb0f8adb554b3468","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.22.0-canary.6f5bfd0f.0.tgz","fileCount":13,"unpackedSize":200233,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg1Q2BCRA9TVsSAnZWagAAzUcP/iMeRORiu/1gVlLZ5b6H\nSbo1s4HK0ba+QyfEfDCGgCDEATWCsqUnr2NtE/bwuidR3WIpy2rsn4TdAUhH\nu5plYzbQ8lbbIukxGnI5O+60KA0/3povDInP3AstVVjMcV7t2SZIieyJB95t\n8zxadpLueKeNFfA2bQ2/89FfcqBl6U+8Ay1jUH51uArlrF2k9erecKiznOeI\n6n/K4eRgW9nSCE8xWgBy8uAuTDE5b0DUwiO0flrNnnAIQ0K7rioIpE5cDYQX\nl7HxJh0BdWuOBwDZyujdN7IYjNdtWQS8jLr0QF2V5xZV0cuyRG9UJN4bstlY\nsNFpOGHdKUNEoDb+hKbATtJSrio/wRsrd7ii0JDfEzsV05NrenIo9+KuTr9t\nLUM/RXZCC2sfh/2tGB12nQcxErvlbC6KmBzRUyZ4nLLeayJf4fJaApALvPCM\n1Wzgv38pYh7CW0TdSbFc5adPyGVG0+WsZNw0XWWwqIZh3Z7/fkSIQoRYTMPa\noeuHjTdtNSjII+9JzULn5x0KnXll1B9tzlDTPJHS7+T7mXLZOJNWnhWW+XfU\nTVw3OUJtj0HCEqrfxf/dbI1cudLlRdVVnGc19ijqEoFfZ97CG0etEHkg0+t0\nOBnf3ilM1pMHZSxAnrGE3tc5FQC2pGxZv7739fiHeHj3IGvWcqPtg8+QVEqO\nnGEn\r\n=m6yF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC2tMuiHYRG9SNinXSCnyCYyEcxenkIpPUrkFDR4FQoLQIhANy5iYwoDX28SFy/Z56orEMSxb622ioyPg5fP95u/qDB"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.22.0-canary.6f5bfd0f.0_1624575361356_0.5692731486612379"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.22.0-canary.fd8360b4.0":{"name":"@material/mwc-textfield","version":"0.22.0-canary.fd8360b4.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.4ccd39bdd.0","@material/line-ripple":"=12.0.0-canary.4ccd39bdd.0","@material/mwc-base":"0.22.0-canary.fd8360b4.0","@material/mwc-floating-label":"0.22.0-canary.fd8360b4.0","@material/mwc-line-ripple":"0.22.0-canary.fd8360b4.0","@material/mwc-notched-outline":"0.22.0-canary.fd8360b4.0","@material/textfield":"=12.0.0-canary.4ccd39bdd.0","lit-element":"^2.5.0","lit-html":"^1.4.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.22.0-canary.fd8360b4.0","@material/notched-outline":"=12.0.0-canary.4ccd39bdd.0","@material/ripple":"=12.0.0-canary.4ccd39bdd.0","@material/shape":"=12.0.0-canary.4ccd39bdd.0","@material/theme":"=12.0.0-canary.4ccd39bdd.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"652b3840a450a965d0a571d3b055195dddebc8ca","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/652b3840a450a965d0a571d3b055195dddebc8ca/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/652b3840a450a965d0a571d3b055195dddebc8ca/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/652b3840a450a965d0a571d3b055195dddebc8ca/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/652b3840a450a965d0a571d3b055195dddebc8ca/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/652b3840a450a965d0a571d3b055195dddebc8ca/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/652b3840a450a965d0a571d3b055195dddebc8ca/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/652b3840a450a965d0a571d3b055195dddebc8ca/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/652b3840a450a965d0a571d3b055195dddebc8ca/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.22.0-canary.fd8360b4.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-4UnKrSbFy1n9yl7FA/eWOSYsEA16Fcjoiwteo7PAwaSd31kkwTKUxqY3Cz8xwx3LIQHRwciXXcvX7TsjPEuEkA==","shasum":"53ef7e89a5368e2981b11c9b1e1212d856074ba0","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.22.0-canary.fd8360b4.0.tgz","fileCount":13,"unpackedSize":200553,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg1inPCRA9TVsSAnZWagAAa54P/RwdwDcvp40+9/E5q06T\nkOSU8o8Q021cNEW27iqwv78nV89Ni8NXi4D2ECtd4oR8pCKN9WbRMavEXqdg\nIcirqD4SEdPXZZvDJuC/LtSrij+DTT1cBq6d+dt3GY331j1Aqj9nDkAFnN6H\nEslV9H2Tgv4cQpu/0SKHFeJRkgsWH3Mc0z/V/vHyqbs5qSQoVcQxZM0gv/y+\n1RPB7lO6T54nOAeJffanQc3cp74cKMbGXH7uuK1K7AZs2fa6tTexatPT7Ybp\nkXv/ncNt3+7ak5t+blhk+YpIwyyzK/79977tQoIuCUIIHfh3wLngswl5qBlG\nmI7p4TiU/aFIBl2/O9wyfrUoZ9FPS0ROLlVU8JWNslH5SJtbwbML3igHKZt6\ni6knPiMy+owbkJI8Zk6OHgNFbuFD76ho1nEkibIWHkyL3ZKdXyyAy4dtUiy1\nN1PtjeOPsU1rGNEir/QKfN3lLDDoAeH3qLxZi6DFYmC6djqwGv0X9PVTOVRw\n4iBMgw2NtelsAD7G0sBgPn9LiAb26I5WfWMjpqTJsYro47vVQMXmos2d3MEn\n45X5sAGIc9GwN8Cv3i4PRjRffAYuCieVIVVsEBqUDnVmhpwKXdlBbEA2uvSa\nkvsnAf/vmeiFbH35FdZnfzcKHyLpSV3kZ2/IAyE0+RhBJyRbO4lFNkev/gzD\nLp6V\r\n=O6Do\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGgnnyh+6UgqBJ0PwtICWS9pMIgCfp/xjVGmPbDwURVlAiEApXdSbXM64HpLH4FsE086Zw/7EysFQTufR0z/6/zDulw="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.22.0-canary.fd8360b4.0_1624648143234_0.7369727027042061"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.22.0-canary.6f74432f.0":{"name":"@material/mwc-textfield","version":"0.22.0-canary.6f74432f.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.4ccd39bdd.0","@material/line-ripple":"=12.0.0-canary.4ccd39bdd.0","@material/mwc-base":"0.22.0-canary.6f74432f.0","@material/mwc-floating-label":"0.22.0-canary.6f74432f.0","@material/mwc-line-ripple":"0.22.0-canary.6f74432f.0","@material/mwc-notched-outline":"0.22.0-canary.6f74432f.0","@material/textfield":"=12.0.0-canary.4ccd39bdd.0","lit-element":"^2.5.0","lit-html":"^1.4.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.22.0-canary.6f74432f.0","@material/notched-outline":"=12.0.0-canary.4ccd39bdd.0","@material/ripple":"=12.0.0-canary.4ccd39bdd.0","@material/shape":"=12.0.0-canary.4ccd39bdd.0","@material/theme":"=12.0.0-canary.4ccd39bdd.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"c9a217708497c2e16eaef6de3d1cd70873d0173f","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c9a217708497c2e16eaef6de3d1cd70873d0173f/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c9a217708497c2e16eaef6de3d1cd70873d0173f/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c9a217708497c2e16eaef6de3d1cd70873d0173f/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c9a217708497c2e16eaef6de3d1cd70873d0173f/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c9a217708497c2e16eaef6de3d1cd70873d0173f/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c9a217708497c2e16eaef6de3d1cd70873d0173f/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c9a217708497c2e16eaef6de3d1cd70873d0173f/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c9a217708497c2e16eaef6de3d1cd70873d0173f/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.22.0-canary.6f74432f.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-fkpW2i/F09IOhSrrAnaIezQgESX6u2iXBnJO0jUdeCe80pG34E5XpFG9ITsQAZdavTY1iTcpiJ3R2l0VI0dVQQ==","shasum":"9d3267bddfbe32d0ddf1a3dc5299819784358259","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.22.0-canary.6f74432f.0.tgz","fileCount":13,"unpackedSize":200553,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg1kDBCRA9TVsSAnZWagAAF/gP/2+oBnT1ijsiuQtL7OEH\nJ5CHzr4xNnow2Cni2WaAwsnvF6/y2uP/cVG5iIsEfvFQcIWE+EpsehJuUc1T\nTqz0kMeSEPRK5rkTsSOtLhJ8nxg2MeOl28fYEqud3gdXa3qp2+fnintDx44I\nUFUrn0uoK7e+PLkMeNSHy2eDoLyJMNEjLL8ec8m7RWKMwFmvyswyD0TRGOlh\n+I0O7q7Qbmyxwy6Ya8u1L1vBjZax9h1YmnZPnaFvJ8FF8+eOH7AJgBBeqiEt\n04NRqYyOCuNTKQNLwfEOeWbp7gOGG/+nMvDY2peW+vrwdXwiiMGSsJw54KKF\ndB1VdUqj+nvmMwulUNDoQm/Xbpff2muJVXwARRY1rSGyP98thnHwwpTlBO6x\nh/CdG5W8gOhh3eOqPo74aoeYJ9CN75x5eQrU2T2BGoYttaeqxZPiDL2nLK36\nwhhSRl39LQfaj4dNNB68Mr7lNW/IR3UPxhidxhxXEwyJZ6YQCSPRcqUmchtL\n5WW0M1lPGFfOqyaW+KoNuDmUpCu+POVO9au2o64EZJX9pt1ruGSFQVi84C8b\n40sY0TO3/jYFoCsUs3E4hFmSU3ZVx2ViHN4KUg4+24ahxZC+nc8djNiIIXuo\ngiJK0Rf+jjXf7/2zb0ljL8DTKSYsMwpbY9117uiMYNpKxActhvYnWY0BERFg\nbKBP\r\n=X9mx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCYUBA3aDdlwbTl3rAD03/GcEhBZdPA49APYKC0Os+miAIgOznZ4K4MKxKO1KMtlrgKHzWQplHwRhR4YuNlm5wRKxo="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.22.0-canary.6f74432f.0_1624654017427_0.41840529979652774"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.22.0-canary.b62f901d.0":{"name":"@material/mwc-textfield","version":"0.22.0-canary.b62f901d.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.4ccd39bdd.0","@material/line-ripple":"=12.0.0-canary.4ccd39bdd.0","@material/mwc-base":"0.22.0-canary.b62f901d.0","@material/mwc-floating-label":"0.22.0-canary.b62f901d.0","@material/mwc-line-ripple":"0.22.0-canary.b62f901d.0","@material/mwc-notched-outline":"0.22.0-canary.b62f901d.0","@material/textfield":"=12.0.0-canary.4ccd39bdd.0","lit-element":"^2.5.0","lit-html":"^1.4.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.22.0-canary.b62f901d.0","@material/notched-outline":"=12.0.0-canary.4ccd39bdd.0","@material/ripple":"=12.0.0-canary.4ccd39bdd.0","@material/shape":"=12.0.0-canary.4ccd39bdd.0","@material/theme":"=12.0.0-canary.4ccd39bdd.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"05d3042d6ee960a41512f4385bd22af7dad2331f","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/05d3042d6ee960a41512f4385bd22af7dad2331f/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/05d3042d6ee960a41512f4385bd22af7dad2331f/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/05d3042d6ee960a41512f4385bd22af7dad2331f/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/05d3042d6ee960a41512f4385bd22af7dad2331f/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/05d3042d6ee960a41512f4385bd22af7dad2331f/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/05d3042d6ee960a41512f4385bd22af7dad2331f/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/05d3042d6ee960a41512f4385bd22af7dad2331f/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/05d3042d6ee960a41512f4385bd22af7dad2331f/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.22.0-canary.b62f901d.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-efxPdmA9tqxkxG5iAtQvKLlSyuI/ygiFIbk5MPPOtjaQ8qx/fVyy08O6mAb7kowS7NGO9M+DAiPVkP7j9RT2TA==","shasum":"b47000604698d19c5950988879b185dced0afa4d","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.22.0-canary.b62f901d.0.tgz","fileCount":13,"unpackedSize":200553,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg1lXpCRA9TVsSAnZWagAAqA0P/0iZQ6oMjIEl9Kx9VXn8\n6ArwY/sxuV75rt+JtYALtSKoqYsmsvPCtXRiQbSZsqxbhqLags+U4zOX3DDs\nOxbPu1q1DNJpfpAxP/A35aWn50Iiiobr4DN6pU9L90Xn9N0zHGiGuQQ4AV8w\n6IdfDpKWcdxQaeqz1X4WsyQ4CbmKeZETh2mC13g4Nz8mPCIiXkiBPyIjlK9s\n6bYRd5b0qgXjh+tHPiq0Iv9EralZEAOyv1KYZ82I+KI6cmYl6j17MjpXeLMF\ncCxrMDMfaDh2JJcQTcJ7KztmsntL2/qBwzkvIJODHj4ti+b93CmVZrQMtkBB\nYVPsL0loqXN/E2L54+KZrUOyTkU0kzof/KRTwxevE0K+Q1/DiE1thUavDYza\n5A8mC88xmxToFVgfLY1kJ/O4LlnWkHoZEVfw7NcW9FFh5P/L+5InYizT+3Qm\nTwrrblTCaxAgzR0kOSH1o3i6nEDsPH2+bQejh94cmppRfTuZmFHjwNmKSYqH\nRd9iaRcWTFxtHU+mGDyQFJ7xjGJA7ATzd1tnHvUnrLm3+qIz7k4iXfjbJZOw\nNSEzYGN3rNcHt4GRKhXjy7lLZYYKHviIQyCvsFa0eO/PbrsBh29Uagnn49fY\nfvTcq0AiX8hlRD9DlKE5Q0sumDjx+nwHKQ/NTr/ajMVI9gOP40aKEQL/5l31\nAg1f\r\n=9zQR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCywDFDfziyDqQGgllTlxL8IAah52CLMqy2EOqkG9vjIAIgGiWTdTah99lxzfOTGWEr/+gU1YacKJwoDlTkhnpaf3w="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.22.0-canary.b62f901d.0_1624659432863_0.6329701858821057"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.22.0-canary.73122cba.0":{"name":"@material/mwc-textfield","version":"0.22.0-canary.73122cba.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.4c80072fd.0","@material/line-ripple":"=12.0.0-canary.4c80072fd.0","@material/mwc-base":"0.22.0-canary.73122cba.0","@material/mwc-floating-label":"0.22.0-canary.73122cba.0","@material/mwc-line-ripple":"0.22.0-canary.73122cba.0","@material/mwc-notched-outline":"0.22.0-canary.73122cba.0","@material/textfield":"=12.0.0-canary.4c80072fd.0","lit-element":"^2.5.0","lit-html":"^1.4.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.22.0-canary.73122cba.0","@material/notched-outline":"=12.0.0-canary.4c80072fd.0","@material/ripple":"=12.0.0-canary.4c80072fd.0","@material/shape":"=12.0.0-canary.4c80072fd.0","@material/theme":"=12.0.0-canary.4c80072fd.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"c6a144cd9623c2a8e58dd87af0807c1aa4d1f5e9","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c6a144cd9623c2a8e58dd87af0807c1aa4d1f5e9/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c6a144cd9623c2a8e58dd87af0807c1aa4d1f5e9/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c6a144cd9623c2a8e58dd87af0807c1aa4d1f5e9/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c6a144cd9623c2a8e58dd87af0807c1aa4d1f5e9/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c6a144cd9623c2a8e58dd87af0807c1aa4d1f5e9/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c6a144cd9623c2a8e58dd87af0807c1aa4d1f5e9/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c6a144cd9623c2a8e58dd87af0807c1aa4d1f5e9/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c6a144cd9623c2a8e58dd87af0807c1aa4d1f5e9/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.22.0-canary.73122cba.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-dd45Y4OCojBDS4x5rWUySEs8jUeOMqLkxkFXhtB957BkQbbDVS5Zt69m2ytZH9RB4s3XXvwHJ30+mSROVFKGVg==","shasum":"839789d5feee802066cc2c31a712d7c89c187312","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.22.0-canary.73122cba.0.tgz","fileCount":13,"unpackedSize":200785,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg3MfJCRA9TVsSAnZWagAAKWcP/Apo5dbux9o8JFaLDcOi\niHmaQJiESMvNA5nEMcpc/kNJkc8NjieekDnxBULoV3QqWRBGcKgfWpYBpkr7\njGLaSLhwMSWvsUpq5scISRTmfpiCbnLTZXmHU+636piZq+7vEI7xqW+j+4uW\n+1Abyr3scISczmg1wuy8+1s8A/5ED5S1KIRYKuwpaz7XYZ2UWe3C36itJMQI\nkusptmSzcQG7/ZdVzPK/p4VfXS7Y6vsQ0xEFfxIsdMyp0iUFMHadp0S4m6rA\ndColfSTqKTB6GZ14yOSdbcxDWrer2CqWDaji6TNw1Z3qBhkxGuB62fVBvWlM\nZh0YcnnEsfuI1g50FEFsQU8f1S5prfIMlMrNp3PvoX7Q4Vo+ypKc+UE+T6vn\nmCfjvGCMnuAIe+XQF63PLUZIL7kfM/S5M2wtcHbYEc2lm4DI8sy7R2EyY2KK\nVrgVHqxG2YMQ5ntrLnqZ8fs1Vcya3qrGRCWrqeQDP27eJ711QOmLyMB33aF/\nYVEgrwMUSy8D24ojxfRGuOZSn+lQCEiWktcBOSOWJ9YUti1KkqknwpuNJi7l\nFK+oFnpd9rMJfQ0/u3veU/tG8HzvRSLx3ur8tbvNMdORoGIpWo9hWLElvxvH\nVsv8/YqmpCG1D1WqY/bEd8vvqOEcW1sRHLB1auej3C8kv8vwozGX8ourr9Tk\nHn9x\r\n=CZns\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDHXG8n1ijNDA+N4R80QUU//AWNoSRLPR+siPJYYZC3nAiEAhzAu7fwd6Uj5MGvQ39N7Oqk2HD87vToyz5uWaNDtlu4="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.22.0-canary.73122cba.0_1625081800555_0.1651760936928004"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.22.0-canary.a6912af5.0":{"name":"@material/mwc-textfield","version":"0.22.0-canary.a6912af5.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.4c80072fd.0","@material/line-ripple":"=12.0.0-canary.4c80072fd.0","@material/mwc-base":"0.22.0-canary.a6912af5.0","@material/mwc-floating-label":"0.22.0-canary.a6912af5.0","@material/mwc-line-ripple":"0.22.0-canary.a6912af5.0","@material/mwc-notched-outline":"0.22.0-canary.a6912af5.0","@material/textfield":"=12.0.0-canary.4c80072fd.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.22.0-canary.a6912af5.0","@material/notched-outline":"=12.0.0-canary.4c80072fd.0","@material/ripple":"=12.0.0-canary.4c80072fd.0","@material/shape":"=12.0.0-canary.4c80072fd.0","@material/theme":"=12.0.0-canary.4c80072fd.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"b34c74a66bc7e54e1165edb13005a2923702f9e8","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b34c74a66bc7e54e1165edb13005a2923702f9e8/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b34c74a66bc7e54e1165edb13005a2923702f9e8/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b34c74a66bc7e54e1165edb13005a2923702f9e8/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b34c74a66bc7e54e1165edb13005a2923702f9e8/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b34c74a66bc7e54e1165edb13005a2923702f9e8/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b34c74a66bc7e54e1165edb13005a2923702f9e8/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b34c74a66bc7e54e1165edb13005a2923702f9e8/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b34c74a66bc7e54e1165edb13005a2923702f9e8/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.22.0-canary.a6912af5.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-v2NzDuTfBsVfeIRox5AU7nyd+wI1rR8c9V0LrzCELrZlhMkus6fxmNxm9OPnNGsMkJuS1pHHrlwuJsXB3X6CMA==","shasum":"44b2af6d07831a1712d34ecd7dc9d3d1538da455","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.22.0-canary.a6912af5.0.tgz","fileCount":13,"unpackedSize":200785,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg3jTGCRA9TVsSAnZWagAAPigQAJCXVaFENESs5BVl3nFE\nZpDPfWGNE8PdcnyLLgSJPHI4jlwrk2M2duID0EOmPqNUWI8hm/jwDyTLId7/\nf3a31auh9lAGT4kbpx/PUZs/TLs9pN9btXqgWwHpsGUtaNysp/ojxXaEP7F7\njhHBYWOMs0yFybt+Y3cGeCAFAS/Glax5/fF3IHEuvre5A68OJ5XDOqojEZQH\nheQMCXKulrJF/ShGIXCc4T94lQWgwbOFxaz7jVA8rtXZaRUjXGiGVUvmZuwr\nL2jLK+A0PuFi1oVULDPWTta4jlhXqoj29XvH+f/soJKy+krY9q1g9swokrFi\n+F190hgc3N6o9wxICz1rn4V8YM5uGVW/Ca1pXNf6i2QT6ql8LPbq8XKCqbUE\nt7Mpe2zIgoMstxIZi6sj055Yiz2ocZvUBS5tnxr157h6OyBlHyqgq30kPFSR\nRZztoPRDK1OFCIIEkEiEFlQQ1B6S4pKD3WiKh7p9aSIKAE70lmyK9StTBU+o\ngikVGSAVHSe8PYSxDGumOwmyw6hyK+32hRq9GodRIUdttwje2h5x29+vSgnq\n1NYWbrWEFJT8OGzu6wwkgndH579YGdXcHDjjUn3N0iRtMMF6QDcTMh+XrpCI\nt2ES14R1ldjj70mCcw8Sgxh79irIZpnC3lvHCzF/RuP0V4+06z+n+2Eetvqc\nxdl4\r\n=qDgc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEMCHzMmjp7cm+BjfqClGs4BP7aSt9y4KEiSO3AJGSsnH+ACIFUsHUdFwTwjUgzXoZGYpsU9IbfLsqxnswo+ULTEA0xb"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.22.0-canary.a6912af5.0_1625175238188_0.43853135108271735"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.22.0-canary.134f24bf.0":{"name":"@material/mwc-textfield","version":"0.22.0-canary.134f24bf.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.4c80072fd.0","@material/line-ripple":"=12.0.0-canary.4c80072fd.0","@material/mwc-base":"0.22.0-canary.134f24bf.0","@material/mwc-floating-label":"0.22.0-canary.134f24bf.0","@material/mwc-line-ripple":"0.22.0-canary.134f24bf.0","@material/mwc-notched-outline":"0.22.0-canary.134f24bf.0","@material/textfield":"=12.0.0-canary.4c80072fd.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.22.0-canary.134f24bf.0","@material/notched-outline":"=12.0.0-canary.4c80072fd.0","@material/ripple":"=12.0.0-canary.4c80072fd.0","@material/shape":"=12.0.0-canary.4c80072fd.0","@material/theme":"=12.0.0-canary.4c80072fd.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"1191b29dc7fa661811a1c3960131fce8394fc84e","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1191b29dc7fa661811a1c3960131fce8394fc84e/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1191b29dc7fa661811a1c3960131fce8394fc84e/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1191b29dc7fa661811a1c3960131fce8394fc84e/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1191b29dc7fa661811a1c3960131fce8394fc84e/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1191b29dc7fa661811a1c3960131fce8394fc84e/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1191b29dc7fa661811a1c3960131fce8394fc84e/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1191b29dc7fa661811a1c3960131fce8394fc84e/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1191b29dc7fa661811a1c3960131fce8394fc84e/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.22.0-canary.134f24bf.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-kk8fgKKABmzcKFUp3j0SXJACIeiz6XcMegK72BMIYPD+clIkPmXR2NtGJLjkPwMbA2Gz4O35uFYRWTr8KDCitg==","shasum":"33b3d32fd3a93065511ab887ba1880e3ad3c9548","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.22.0-canary.134f24bf.0.tgz","fileCount":13,"unpackedSize":200371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg3kJ0CRA9TVsSAnZWagAAWxMP/0ZeW/VGVochsY5TZ1Nn\nqBdkRqBi+9kRsPlfobzEGdantVlK7wHMVERPIS9ySG+WBBcVgMY5mQ/Ze+09\nMXEEsA2aVNqdV9jMe89iErHoygiWPMYzq0QsqJmrjmvIRdgMf1qh+f1Xdcyn\nYSI6Rq7sdquzHhXUzK6uOIz5DMRmTFECiFmkD9E51bJPogCzJ/Q2c1xcXye4\nv/wod1RI4goQ7lRe71wm8ZqEXyAxCRv2k7xcoJTXq8B/yQtDpVdwaq+Muwke\nS0sc8+mgX2pFFzmdlFXPjVGOwnY3AENnkJHSM8F6kogGAUbp0dnnkf4PyhTC\nE86vqPoKwX952fIjfoNJAlRaLUhLFV8SpfKPF0FI2Pt/xR8vPh7MLWWNBXHM\nYTZdrDgy6ERdT7a4KeLY50FUnDRA3nyaOSVONzjmSz9aigq1YBbd+HiBggr8\n3T1Be0AwkJlWWTdRzbW/rRccIBgV7ccITtnVi7rrFoIfTos5BBl2OV54hLaI\nYWHm6PnBCIA/qztlNp+EYMhQxlhN++w/7fwSl3b9G7dXgjiybf6wO38cISV5\ndM7ej6nZciXwfuY+NETLhF9fyQ1Lv51EUQRrMjjIDIbYb1ywTfEFIkuMakJT\nbVkniSVBCEs9BpNxHfykm2eHsioed80K6zCTx8XQ82b+7X/1SbqSJG7lt16A\np4at\r\n=EtFA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCTIcFED9TGROxdoB00rjsdav/0ur8t38zzVnRLFa6ERgIgAKEABu24TxNFdE1mLfedWbntTJt09nIPXntp+K1G2r4="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.22.0-canary.134f24bf.0_1625178739896_0.0076765025228029415"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.22.0-canary.1debb78f.0":{"name":"@material/mwc-textfield","version":"0.22.0-canary.1debb78f.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.d0f9f3f2e.0","@material/line-ripple":"=12.0.0-canary.d0f9f3f2e.0","@material/mwc-base":"0.22.0-canary.1debb78f.0","@material/mwc-floating-label":"0.22.0-canary.1debb78f.0","@material/mwc-line-ripple":"0.22.0-canary.1debb78f.0","@material/mwc-notched-outline":"0.22.0-canary.1debb78f.0","@material/textfield":"=12.0.0-canary.d0f9f3f2e.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.22.0-canary.1debb78f.0","@material/notched-outline":"=12.0.0-canary.d0f9f3f2e.0","@material/ripple":"=12.0.0-canary.d0f9f3f2e.0","@material/shape":"=12.0.0-canary.d0f9f3f2e.0","@material/theme":"=12.0.0-canary.d0f9f3f2e.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"05e5511ca831a84c47e7bd43f685202e9213b33e","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/05e5511ca831a84c47e7bd43f685202e9213b33e/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/05e5511ca831a84c47e7bd43f685202e9213b33e/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/05e5511ca831a84c47e7bd43f685202e9213b33e/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/05e5511ca831a84c47e7bd43f685202e9213b33e/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/05e5511ca831a84c47e7bd43f685202e9213b33e/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/05e5511ca831a84c47e7bd43f685202e9213b33e/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/05e5511ca831a84c47e7bd43f685202e9213b33e/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/05e5511ca831a84c47e7bd43f685202e9213b33e/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.22.0-canary.1debb78f.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-do08C00Q9e734pI4TMBdQZ1GzDzjqDAQYEqzkdIe5o+Tr92wSNTcztdonHogB3qVM9bNfp8Yzd6fxN/PHjK3+Q==","shasum":"85a999ef0288b0adc8c1fe41a5c1ea29230715f2","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.22.0-canary.1debb78f.0.tgz","fileCount":13,"unpackedSize":200371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg5PlWCRA9TVsSAnZWagAAXo4P/3WpJISq+JTs5vC3wc04\noHhMdTNdBC9kaDlS3X7MwvaHkBlQZSa54VpVtK2+y1X8//ripY/WCXf98JWC\nP8aDaDD0MpDh8EBbk1s4ViBG2B4MREPvkuqmZ3XoQG574XOJKCORJj4BOpvs\nHfuv5SmmXwuxrpY+TtzUqleCmza086nu4qxpq+77Rs5Q1oxCaYXyfhlkbKjH\nv/knsIvBhDT1Be8t80SG/Vxg1mboFOwOrbq0Cvr97SNL1a8N5w4OxcpnDYst\nWit1lSYzDxfYuQaKoEg6YaQvbbOiePgTFBTErttUth40QS9XkP94s+Gt8gu0\ngEELLCwGFTzJAXymVa1zjZxyf33q/rAjubfOTXQ5iyiOpSBxo4ZGWHlBi0Oq\nYCJDiM38Ee3mTYNWxH0tMd5Ff8Buo9LVKPt3EluulDSvI0zbxZyaKKiBw8ha\nigGfAtiLMDmVrvLCa2ci+zQzSeKeFZe1Dc720aTwdaXY/wVrHC0LFGMLgqVk\nR+0CHJZcuKvotek6sPWoXeMQhDNkmOJ/gy3WbUo6S6IvNaHuJRiCmscm8xxr\ne+g+HkwaCz+CaCg5g0h4JusndlDcJqeiQGr7c29csvYmoQQb8/VLlIubqXbX\nXSrZ3VfUxVsc4pREwV0i0zYU96K4UPHBulo0UMguPDYRxIAtHhHJhMCNpqk+\nESOt\r\n=5ufu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBRkD8wG73S4GoCdBl37rmiPjg4PaXEpC/zGSw+uyuACAiEA8fWXFwGpYpJvUEgNQf1kvtPKwHGHOxfLl6mrqIFnj7k="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.22.0-canary.1debb78f.0_1625618773582_0.4795623378543228"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.22.0-canary.d53edeb6.0":{"name":"@material/mwc-textfield","version":"0.22.0-canary.d53edeb6.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.d0f9f3f2e.0","@material/line-ripple":"=12.0.0-canary.d0f9f3f2e.0","@material/mwc-base":"0.22.0-canary.d53edeb6.0","@material/mwc-floating-label":"0.22.0-canary.d53edeb6.0","@material/mwc-line-ripple":"0.22.0-canary.d53edeb6.0","@material/mwc-notched-outline":"0.22.0-canary.d53edeb6.0","@material/textfield":"=12.0.0-canary.d0f9f3f2e.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.22.0-canary.d53edeb6.0","@material/notched-outline":"=12.0.0-canary.d0f9f3f2e.0","@material/ripple":"=12.0.0-canary.d0f9f3f2e.0","@material/shape":"=12.0.0-canary.d0f9f3f2e.0","@material/theme":"=12.0.0-canary.d0f9f3f2e.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"becc7820ecd046cb48666a32a633b8d9f76f2980","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/becc7820ecd046cb48666a32a633b8d9f76f2980/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/becc7820ecd046cb48666a32a633b8d9f76f2980/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/becc7820ecd046cb48666a32a633b8d9f76f2980/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/becc7820ecd046cb48666a32a633b8d9f76f2980/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/becc7820ecd046cb48666a32a633b8d9f76f2980/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/becc7820ecd046cb48666a32a633b8d9f76f2980/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/becc7820ecd046cb48666a32a633b8d9f76f2980/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/becc7820ecd046cb48666a32a633b8d9f76f2980/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.22.0-canary.d53edeb6.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-qQU6dGUsHrrSzZV2DNRkMN/1lY4LFiSc+2vYWABO6FXaB5jH0xAtXHraV39mXayPicrifgrAGmGk0Z+Qsb0zaw==","shasum":"8aa102b1af7c2277fae097daa837d13362e23029","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.22.0-canary.d53edeb6.0.tgz","fileCount":13,"unpackedSize":200371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg5d2bCRA9TVsSAnZWagAAgQ4QAIGpDYu8EB6JVxWYAgYR\na1PcSN6LCFUGQgT2Vc1oH2PouMHTOZerDa5XmMiR+qc9WWxfTXa7f5zmBfcD\n3P9Fy/x0va81JTRZAH1mE3645NmFnvH3sQH2uPYQcNL3Ftxk9pJkZ6tN8mZh\nJ+GF9IVRsrJlgaYSo4AZJxgmitgQfPGby85cwqbCEPSQWm72Eqn/FoitgG6g\n/9vCTY6A4hy6LiWsFpq6pnP05WSTgN62C10kbQZRIIj8rKreXJnM8GXZROt2\nOxY/a4mPXBCIHyWEUzs1Wedcq39HOa5u721p3JuOc3+fxeQB8OcMOx6IlRbJ\ny1ATXVcZc9evI4UwhIfkOEyYFxHbZPViy6J352ZdAnfbC4TF1skfPjE3hPZr\nuhRyQdpThOqVlTfwv3QoeZXWs2ji/xqL1gi04pvo64Y3g26ED0+UmP6g7yAG\nGorohPc/r/U7A38hqsI2dEvs9PmALQO9skc9KOmCb/D3a6ax9BP7eDz0+hic\nMXb3zODxqHG8DhiwdGCgm5Awbpd1jv0qJtHdtV0d+Vny/lRTqYEMEX2p8pk1\nbs11me+Qfsezd2ZWMixueH4W3Lak7utZzkz+zg0FjZsXa368/87YgvqIVVUj\nhxeYWLwewMdjHPeyknc2Jj1hS6xQmuKmF3HAZMRnkjy2dnX2mhzuFi8DkcNh\nzuE5\r\n=WxAB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBd4NfRQvzGhVOEL4bBjZykE/OT25d9c53U9P5WW3gOfAiA8YnDvAUnAFKoXxK2F1PpCfxgH2d8+t+rbnAB/UjdhJA=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.22.0-canary.d53edeb6.0_1625677211110_0.23374816161556478"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.22.0-canary.2226489a.0":{"name":"@material/mwc-textfield","version":"0.22.0-canary.2226489a.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.d0f9f3f2e.0","@material/line-ripple":"=12.0.0-canary.d0f9f3f2e.0","@material/mwc-base":"0.22.0-canary.2226489a.0","@material/mwc-floating-label":"0.22.0-canary.2226489a.0","@material/mwc-line-ripple":"0.22.0-canary.2226489a.0","@material/mwc-notched-outline":"0.22.0-canary.2226489a.0","@material/textfield":"=12.0.0-canary.d0f9f3f2e.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.22.0-canary.2226489a.0","@material/notched-outline":"=12.0.0-canary.d0f9f3f2e.0","@material/ripple":"=12.0.0-canary.d0f9f3f2e.0","@material/shape":"=12.0.0-canary.d0f9f3f2e.0","@material/theme":"=12.0.0-canary.d0f9f3f2e.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"4ac660ba00e610510de0d1b8c86d4095110ac230","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4ac660ba00e610510de0d1b8c86d4095110ac230/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4ac660ba00e610510de0d1b8c86d4095110ac230/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4ac660ba00e610510de0d1b8c86d4095110ac230/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4ac660ba00e610510de0d1b8c86d4095110ac230/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4ac660ba00e610510de0d1b8c86d4095110ac230/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4ac660ba00e610510de0d1b8c86d4095110ac230/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4ac660ba00e610510de0d1b8c86d4095110ac230/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4ac660ba00e610510de0d1b8c86d4095110ac230/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.22.0-canary.2226489a.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-yR0XQX0hxrAJjWCTeczw3OM33CCbRmBwltAWskX6RsbguGdeV3h0Xui0qM8SkehD6vF5USrsGXG4p3Tefdwi/Q==","shasum":"d0ab54a2d9aff457e8161dd5d4ac8f9830498578","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.22.0-canary.2226489a.0.tgz","fileCount":13,"unpackedSize":200371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg5z14CRA9TVsSAnZWagAADSAP/jP0cWb7riHAXc/82kgF\n+wjgafIx/475BpWdMT/pB/yACBBw4k8O3f7qh9Imb0R/yfnqMkCaTMbZv8Gx\ncIAoqek6SZnGW/+Jc4kDUvrQFZRALN2jmfKAc3wFE6d1fKUZwGBbWCl8ChZt\n5C1t9GZGnLqnK/bIXy8aRX44tMUiBzCuBMnSfhglESME0qAyuaiZiHi9l7A4\nxmVG3kjN1B/vgUVBij8KuUf59jAFyxTH1AwAqLdnWcPMG4JpKvnMjyIu5HKn\nnp4HtAL/V/c8Ey85u1DSr+jTL37oBSk+CT8msc7/5xVmXNWSlz6Y9i/Nl9Sv\nrjNR6EloOYKBUqUKnwdDd70ttbDLi1NUt+UnRaPD5OI5UBTZa+mlH3/9N8xm\nP36mTnqLxNVRhoLCN3UxsXAmVTAaz7abE/VvHiQkLYyfjYN0qxMalypqRGvx\nUS4hhEL43TQFsZak8gGa21cqApW1zCIusnu5+2a0WWhXahUvR5TwyxtbJOi1\nx1mJrcr/ME0lwjLcF7K4w+tS/nZkFnWx/5BzX8u+MLlc4kdvc0OJ/JHRT67Q\ndOaV+sV2+NqGNAve1JtZtJbTg6XG9eDHCq84ZD53BdmbxH0fp8dv9wNqpQWw\nhXYzVCPFw/InvgBOGM+d5rJ+tFyRcuyilEIaGzttT0JKpgRe+xVUdHhtyv4C\ncTF3\r\n=bCYF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC6kF/ioqR+WCpfT6eHsImH+fou9cv7ZCe2tv2BMtNJVgIhAIZrx83bcHwDFYMDCrqKu8BqFOWoFRyLEQv2+h356dJY"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.22.0-canary.2226489a.0_1625767288475_0.19773259749725502"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.22.0-canary.d4801c11.0":{"name":"@material/mwc-textfield","version":"0.22.0-canary.d4801c11.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.adeac0549.0","@material/line-ripple":"=12.0.0-canary.adeac0549.0","@material/mwc-base":"0.22.0-canary.d4801c11.0","@material/mwc-floating-label":"0.22.0-canary.d4801c11.0","@material/mwc-line-ripple":"0.22.0-canary.d4801c11.0","@material/mwc-notched-outline":"0.22.0-canary.d4801c11.0","@material/textfield":"=12.0.0-canary.adeac0549.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.22.0-canary.d4801c11.0","@material/notched-outline":"=12.0.0-canary.adeac0549.0","@material/ripple":"=12.0.0-canary.adeac0549.0","@material/shape":"=12.0.0-canary.adeac0549.0","@material/theme":"=12.0.0-canary.adeac0549.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"2d6201005f2b928287b990b2ce5ca643ef37ce6e","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2d6201005f2b928287b990b2ce5ca643ef37ce6e/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2d6201005f2b928287b990b2ce5ca643ef37ce6e/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2d6201005f2b928287b990b2ce5ca643ef37ce6e/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2d6201005f2b928287b990b2ce5ca643ef37ce6e/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2d6201005f2b928287b990b2ce5ca643ef37ce6e/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2d6201005f2b928287b990b2ce5ca643ef37ce6e/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2d6201005f2b928287b990b2ce5ca643ef37ce6e/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2d6201005f2b928287b990b2ce5ca643ef37ce6e/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.22.0-canary.d4801c11.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-mwGViau9iA8liZLZ4k4j1+u6pEFRY2Lfwoqz4kxteZUOZornB39NTUts7LfkB96XwCgsybZSxA/FJJVVz4a6uw==","shasum":"46905651b9b7f097fb9be64f8b5de7db9865fe19","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.22.0-canary.d4801c11.0.tgz","fileCount":13,"unpackedSize":200371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg51nhCRA9TVsSAnZWagAA5+sP/Aqq2KB3kVp+bNAwUOIF\n6VJf9pYZQAABWzjgMavEsMkZE7pglR3zXMkyTttT1UI2u9KwvyTyfp4oyh2r\n9Knu1YF2ObtIqGvDO1j8yjk16F7HlDfFbyOpMVuOkIFNpQc33f1nuvqznk7n\n+oQ1taquvEdcc9wn3LL5Thzj2CQUk/5LYhkUxbSkGElqv/eByQVBj6l47VoP\nRgxy/WCvv4AyXzUrJ3lVTRiuq8Ro6ZMRhEjoQBloZDLpcG+IEsJDLaKwCPef\nK1vRGiplQiKRWgFCSq+g/OtapRrXugOpeHysXd2ue05OiQcwWmcZTdhYbufG\nBu72GU86uphER22+n6L6U4C2OgbLVcQUYueac54AckvyvnzInYlssGay/GOQ\n1e/HmvVYkckDUzHDN9gaCO0nnpt0oJbYHdJK2GZvE+lPFyilpuo+IXOl5lz8\nYkvdl1+WnHUhswSb0p4BzHNcus4QIJ3ti700AgYCuems081VCh3hwkQ+9Lrc\n/var5CO97/qukx8fzVFgNdcRycP/ILGrh3j24jResbxhLhTuM+W0CDt8xpSj\nZo+VcZLaBllIdp0CEiFezLeS4GgKBTRjS7D+6ZoM256dBdc7D4bRMryMyn5n\ngEj0tuFo2RZcvueG+60srC+9jX+asa+29jVZRHNt8mUl2GGm/97AMECKAdc6\nsG2N\r\n=niGw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHNZc3hKNeWtrNAEZTFkOKllUClwhf2Kh8TIqURZXTIeAiB7OaNrKRZQxVCMUIVi9g0+vmZEKFgweAaHbKFg5HDyyw=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.22.0-canary.d4801c11.0_1625774561087_0.26117913758961286"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.22.0-canary.7ec5f2d6.0":{"name":"@material/mwc-textfield","version":"0.22.0-canary.7ec5f2d6.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.068fd5028.0","@material/line-ripple":"=12.0.0-canary.068fd5028.0","@material/mwc-base":"0.22.0-canary.7ec5f2d6.0","@material/mwc-floating-label":"0.22.0-canary.7ec5f2d6.0","@material/mwc-line-ripple":"0.22.0-canary.7ec5f2d6.0","@material/mwc-notched-outline":"0.22.0-canary.7ec5f2d6.0","@material/textfield":"=12.0.0-canary.068fd5028.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.22.0-canary.7ec5f2d6.0","@material/notched-outline":"=12.0.0-canary.068fd5028.0","@material/ripple":"=12.0.0-canary.068fd5028.0","@material/shape":"=12.0.0-canary.068fd5028.0","@material/theme":"=12.0.0-canary.068fd5028.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"530ddb2b50487eae209a7b76d4233a5b591dc62f","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/530ddb2b50487eae209a7b76d4233a5b591dc62f/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/530ddb2b50487eae209a7b76d4233a5b591dc62f/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/530ddb2b50487eae209a7b76d4233a5b591dc62f/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/530ddb2b50487eae209a7b76d4233a5b591dc62f/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/530ddb2b50487eae209a7b76d4233a5b591dc62f/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/530ddb2b50487eae209a7b76d4233a5b591dc62f/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/530ddb2b50487eae209a7b76d4233a5b591dc62f/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/530ddb2b50487eae209a7b76d4233a5b591dc62f/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.22.0-canary.7ec5f2d6.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-Ir63/qQsN9vvyeJAUwqZ1FXoFm+5UzSgS+2hkK5CtZffifD/JusuU9mXIoHIu/xOwkjfS64HbtR9Uvsb+Majhg==","shasum":"dfc5e2c2478ee5461c0774195053e20afbfc4eaf","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.22.0-canary.7ec5f2d6.0.tgz","fileCount":13,"unpackedSize":200371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg7Hj9CRA9TVsSAnZWagAAim8P/2dQ09woeybtALZqxY6m\nHJZqni6PBWJx+H+gCuhXHxHbsoBdWNQFz2XhWMC3UyzJkLzJ6loF1lvvlHXS\nLLmK6pGmiLf3X3PyIN/2hT3mozoKefDYIDpJBchsTkYO8p0jMAbUzB5o59sc\noonPlK/4B9RqIENW9cdGRNsN/cDITkeaaSLB6y7YX7pVLKJQZtGx9gt8r4TY\nq4+Vt77KzG5TZL1pZQ823+do0qee+eHiyT+ZZofWGNuAvzGLYpiF7EhJnFJx\n67pla0ML+m8E61K2HA/x2kNMtecK2mYV7IIEpStr5jVBmyRQ1GKULuwyAwrb\nETZADdYUE0wN10rdrWq8NTQAqgY0ksqwWhuyP90nfBRQkJhDW2GIgKPAG2Os\nhVjzFnzK4Xd2+aWwFxtuhQ+PX6JlXEo3IM+i/Jrqdhz7TRAUfdo3XaRJV/ci\nTOS6ZRC1eUOZXUgNreOrYTFqtGF1z2q3j1y+L0inkbvCf+Y3gJxwyajSQ14R\nvtCH6/UoWD3SUrVsUj1SRG4KIWRklYWXV5I5q0CmxBdk/RXq4ZZ9xbIbTy7u\nUNvsUWjiC0lKbDjQd5wbgw/GzHXbuDzjePrU8XczxH8bei1zipqQhQpeYnDK\n0xnS0bAclymkDYk5B6BunkV8f0x5LCKOPjp72fR+ryxjm5tX3XvYOd9bPkZi\nnMOC\r\n=QhQn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFnbY847yCUmFA5EEZkmR96tnMgbnbxGzzLK6uqEVUhsAiEA2pWnPKS2Dw7SGDzYVUpVyAzoOB0VUQkbHaLymrPhSqs="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.22.0-canary.7ec5f2d6.0_1626110204780_0.13751866927736733"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.22.0-canary.86cb4ca7.0":{"name":"@material/mwc-textfield","version":"0.22.0-canary.86cb4ca7.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.068fd5028.0","@material/line-ripple":"=12.0.0-canary.068fd5028.0","@material/mwc-base":"0.22.0-canary.86cb4ca7.0","@material/mwc-floating-label":"0.22.0-canary.86cb4ca7.0","@material/mwc-line-ripple":"0.22.0-canary.86cb4ca7.0","@material/mwc-notched-outline":"0.22.0-canary.86cb4ca7.0","@material/textfield":"=12.0.0-canary.068fd5028.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.22.0-canary.86cb4ca7.0","@material/notched-outline":"=12.0.0-canary.068fd5028.0","@material/ripple":"=12.0.0-canary.068fd5028.0","@material/shape":"=12.0.0-canary.068fd5028.0","@material/theme":"=12.0.0-canary.068fd5028.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"f679091aef1ae61c94f4217310d6cd1161c48598","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f679091aef1ae61c94f4217310d6cd1161c48598/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f679091aef1ae61c94f4217310d6cd1161c48598/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f679091aef1ae61c94f4217310d6cd1161c48598/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f679091aef1ae61c94f4217310d6cd1161c48598/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f679091aef1ae61c94f4217310d6cd1161c48598/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f679091aef1ae61c94f4217310d6cd1161c48598/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f679091aef1ae61c94f4217310d6cd1161c48598/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f679091aef1ae61c94f4217310d6cd1161c48598/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.22.0-canary.86cb4ca7.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-1dNUN1RNbeZrurn3D8QMnZpDtq3SRwtoieEgRR+knUocrYu4c93NLwiW+cLOK7vOtoLQfnAvYaZEMtGdKu8JBw==","shasum":"219ce57f9ad6766fd3c9250d560711a5bd4ee35c","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.22.0-canary.86cb4ca7.0.tgz","fileCount":13,"unpackedSize":200371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg7c9bCRA9TVsSAnZWagAARMcP/izJF/QFAztdVkF02Epc\n3607k/P3heyVaj10VlHsTdnhe3LZbasuXdmTFmEkjWmZZSjTjR1J1bEsw8TL\nVg2LAYmUoSo30XryFGGGwZeQBOXiTS902wmpcp/Qft8c//URM8tYE9TIOW9O\ntBk1i2iKEbXeGXALWKNo3LVhPZLkAn3zoZUM4/Y9SBnZFq1++DUhTWLU5NxR\nxcc/GBkSJ06QSWWArz3/f9ahd2IrnJnEkuTF8I3xaplsm0Cq2qUyPqRhHX/D\n31/WSctS1W+z/lHnUzRwXCjSUvXOtpf167VOgJjwl27QJnr+iXaxmVoWNeWi\nX2LqzsPf4GMrMmvkUz3NqhNAv4CzFx8VAtam3iSQeCjdVJLTtmuefxz8NbRe\n3CSER94B58Z0ZqVZsVww26wvsH+4yvjdRlLC6EGi5pXtvnUlBPLT9y+pU9jB\nzkVYZn4b51R15KF7dtfxAS/I4anEBpib5SyU7uydFpAtb22sWOuznQ3jbaQ7\nQ1txXZW7WlRjlDqKjbrVXgpyFdwHeAwWnoMb3og87g46BPZXhpmknjYTkqIw\npnQZPGt1WmbqAVeNvCbgrwiulwNgSaMD444u2CM9dO+Sd/KuVU7IA4KOqur1\n07x+B83crs0BxbUF4qYW48DZgAk/IeHDgocG3jPgZXAj+Wq8FVkj/oyMavWB\ngDG+\r\n=EHD4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCd3SPLoLyBTz0Zm5jD9Zsw76Z7+K1QRCvTgU6JcXQh1gIgaxhBhXrGSoTDD30UJrDq23Pic58auh+Yky4FBVpAV3k="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.22.0-canary.86cb4ca7.0_1626197850534_0.3306921822463986"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.22.0-canary.bc9a724e.0":{"name":"@material/mwc-textfield","version":"0.22.0-canary.bc9a724e.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.ea77795b1.0","@material/line-ripple":"=12.0.0-canary.ea77795b1.0","@material/mwc-base":"0.22.0-canary.bc9a724e.0","@material/mwc-floating-label":"0.22.0-canary.bc9a724e.0","@material/mwc-line-ripple":"0.22.0-canary.bc9a724e.0","@material/mwc-notched-outline":"0.22.0-canary.bc9a724e.0","@material/textfield":"=12.0.0-canary.ea77795b1.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.22.0-canary.bc9a724e.0","@material/notched-outline":"=12.0.0-canary.ea77795b1.0","@material/ripple":"=12.0.0-canary.ea77795b1.0","@material/shape":"=12.0.0-canary.ea77795b1.0","@material/theme":"=12.0.0-canary.ea77795b1.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"3f6fbd971026d270d71f4fa8515adb70cb387ae3","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3f6fbd971026d270d71f4fa8515adb70cb387ae3/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3f6fbd971026d270d71f4fa8515adb70cb387ae3/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3f6fbd971026d270d71f4fa8515adb70cb387ae3/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3f6fbd971026d270d71f4fa8515adb70cb387ae3/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3f6fbd971026d270d71f4fa8515adb70cb387ae3/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3f6fbd971026d270d71f4fa8515adb70cb387ae3/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3f6fbd971026d270d71f4fa8515adb70cb387ae3/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3f6fbd971026d270d71f4fa8515adb70cb387ae3/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.22.0-canary.bc9a724e.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-Pv7/RGCsXQBbDpduCXCDaJYk72AMPQWRbT+LCk6Q3w8W7ZHNIz7ONVTd3Qm/Z6wViIy2x3lgrf8rZnZteORkdg==","shasum":"8c3d1527c27798b5fe9c9b1ed17dc8fb33ad3c52","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.22.0-canary.bc9a724e.0.tgz","fileCount":13,"unpackedSize":200371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg7d55CRA9TVsSAnZWagAAxlYQAJsrQXSUyMJX6nkG7Pl1\nWadSNn6MaujECh3Vw8TrquCDknOPVcX3Q7xbVOMkaGk+dTEolRcCTpkhET4J\nqxyDwXE8a1oljjCO9EhYyTWinbmKXNHy1FGu8YDFxa94LyjimvZbM5f9RRy5\nEpYCBH55ApRhfzQX7KXPIeP9TEPPBYmCS2HyQJE4Lm80vhjFL3pWaOWZcVKf\nG7r0JU2LkqsinUltB931hfEprk1I4iVeIsVI3CaKj6Vs9b3ojlVZ7HLjMJXr\ntpCaoe7ODbeD1ySJiPE0djqu+C648lsgeO9cjVW/bylQNfC2IkzbKxVZs+qK\nzl5Rx2HqA3B5mw7Nll9qt7r5FciJAgORd+UG88dd/rcYBAlWoqb+i13Uwk1o\nBX9rUjLc3z+JmemHM0uLkRKh/Q3wPqllW8nDQd30HjfUuz5vat3KMMPfb7IM\nflZykUyJqIH7BfqoGtLAVbw4j69H0Td548LSACv46MUX8pE80UltBPVBr1q3\nGWnQickbnsNDKPPDbwmLIBJ0ctGONRgGrOVUaN3eaZrzCyoLYE9mpDfHBM3L\nMYiALSllGC3q2ZgPlZ7qkfcglgWiRCVvpAD+Ou4gWTWkhNHfOvWv21ck4lbx\nCkXYxhvvUn8+2kQFUWmtKk0AV4YzFt3CMAqk5YZ2KY06NsTdAWZlp1+CFc8Z\nPZ2h\r\n=7Zf3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBqdPgNWtx98T2eN9YW9UZxEDThs4Em0MC0321fj/NWxAiB3TvDh0pm2syf37sahjYUdI9eoCanitpVmMSosn6AD0Q=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.22.0-canary.bc9a724e.0_1626201721377_0.42914529846164906"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.22.0-canary.7847b83a.0":{"name":"@material/mwc-textfield","version":"0.22.0-canary.7847b83a.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.22d29cbb4.0","@material/line-ripple":"=12.0.0-canary.22d29cbb4.0","@material/mwc-base":"0.22.0-canary.7847b83a.0","@material/mwc-floating-label":"0.22.0-canary.7847b83a.0","@material/mwc-line-ripple":"0.22.0-canary.7847b83a.0","@material/mwc-notched-outline":"0.22.0-canary.7847b83a.0","@material/textfield":"=12.0.0-canary.22d29cbb4.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.22.0-canary.7847b83a.0","@material/notched-outline":"=12.0.0-canary.22d29cbb4.0","@material/ripple":"=12.0.0-canary.22d29cbb4.0","@material/shape":"=12.0.0-canary.22d29cbb4.0","@material/theme":"=12.0.0-canary.22d29cbb4.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"96a87e19e381c977d8ac1c7a5a20a261fe54c448","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/96a87e19e381c977d8ac1c7a5a20a261fe54c448/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/96a87e19e381c977d8ac1c7a5a20a261fe54c448/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/96a87e19e381c977d8ac1c7a5a20a261fe54c448/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/96a87e19e381c977d8ac1c7a5a20a261fe54c448/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/96a87e19e381c977d8ac1c7a5a20a261fe54c448/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/96a87e19e381c977d8ac1c7a5a20a261fe54c448/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/96a87e19e381c977d8ac1c7a5a20a261fe54c448/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/96a87e19e381c977d8ac1c7a5a20a261fe54c448/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.22.0-canary.7847b83a.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-VtLeAb4s30YyTBfNJiIGJ9xXHByB3JmbBtBxiQH3xOamzJk/PXa4x8LduuebHCM9GR3fOBzV6eR5pmbcdqLc9g==","shasum":"dc170b07b0a3ace9833a41c286469b5f26cbfd1b","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.22.0-canary.7847b83a.0.tgz","fileCount":13,"unpackedSize":200371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg7xxsCRA9TVsSAnZWagAA0rgP/0/eqJrFxQg95OIj9d5W\nOV1TAQPkO1A89ZnDxy1degN4SkpczqwZw0IbS2MqEl4wjwsx5MCu8lUbHTml\ns5Q4cZRTQlyitJ9CtEQSzN7a882nUkCxDABkKY+MZJd+HDWneKz15u7ULKVc\nQYrcfqUCeFbqKghN0kjNTLxzX1j9huxw1S/lnYqaKgm8kt1YtQiwObVm9jZN\n8P4fOCmaJuXQ0Y3HpUzXkRnsHcGSqRvtMTF5F0PEEv76nLyw2KetWIi6wuFM\n90zQ05yIY+Z7FdiybWRV2C+yv2pvQWP+FRCEh/1v7+YoDtqEyFdVbZCj+5JL\nkoS6FDcWdGrFIPp1DRn3oqzzkIx/KPKwfN1tWXzCBKjiOFDgg559uc0Q/m4n\nBM7lIz5j69+vrKIXn22kFjqZB5v5rDmpoDo6JqxzwNEeiEszipAqzLqspCus\n3CCKzLXNx/HM+3W6JlStQB/R13AELdcaVwuwzjUTEv+e6asX2bVOd8ddAXep\nIlQRnT4CPijiKUF8Cz92YLfMjkSUsYNSAzTOt9yi4DDw7L/dw0gRzP6xeAF5\n5/99eazVAQmpJ/ao0ZDEI6mde51GXUuNEZNbLY/kkx7pFF9WNKFdewyjWoiq\nGPHXpklVzmZ/00qIPu2AmKG6JUH/l8bhhw+HJWAc+NjCkArFS+99fdfu7qMG\naoBI\r\n=FSWG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEpMCi1kPkiYUfCxl6Gh3CYDJG3Ua+opjVgIf3jupd1YAiEAnT4xMuvqyG2e/4at0wCIdcRc+DCqP+1akTgwgoMm9Bs="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.22.0-canary.7847b83a.0_1626283116350_0.024913944132073818"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.22.0-canary.8cba18fa.0":{"name":"@material/mwc-textfield","version":"0.22.0-canary.8cba18fa.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.22d29cbb4.0","@material/line-ripple":"=12.0.0-canary.22d29cbb4.0","@material/mwc-base":"0.22.0-canary.8cba18fa.0","@material/mwc-floating-label":"0.22.0-canary.8cba18fa.0","@material/mwc-line-ripple":"0.22.0-canary.8cba18fa.0","@material/mwc-notched-outline":"0.22.0-canary.8cba18fa.0","@material/textfield":"=12.0.0-canary.22d29cbb4.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.22.0-canary.8cba18fa.0","@material/notched-outline":"=12.0.0-canary.22d29cbb4.0","@material/ripple":"=12.0.0-canary.22d29cbb4.0","@material/shape":"=12.0.0-canary.22d29cbb4.0","@material/theme":"=12.0.0-canary.22d29cbb4.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"0eb1334d9597f86a21b5f9edc232a1c0f67f6abc","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0eb1334d9597f86a21b5f9edc232a1c0f67f6abc/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0eb1334d9597f86a21b5f9edc232a1c0f67f6abc/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0eb1334d9597f86a21b5f9edc232a1c0f67f6abc/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0eb1334d9597f86a21b5f9edc232a1c0f67f6abc/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0eb1334d9597f86a21b5f9edc232a1c0f67f6abc/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0eb1334d9597f86a21b5f9edc232a1c0f67f6abc/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0eb1334d9597f86a21b5f9edc232a1c0f67f6abc/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0eb1334d9597f86a21b5f9edc232a1c0f67f6abc/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.22.0-canary.8cba18fa.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-Goh3OA+AZTAqa/CbtvXj5LxF2yvcjVNSZF8jdGcmVR2K5uUoDejmQKOm5M0bVbYn/sFtiaqYa30QNyD9JFhbaQ==","shasum":"7dd6004c4c5c6dad389f10830d4a5d805179bfc3","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.22.0-canary.8cba18fa.0.tgz","fileCount":13,"unpackedSize":200371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg70h7CRA9TVsSAnZWagAA6gEQAJWJWr8XxT0zisgQRV57\nDHXH4HWKbPAdGcXaFDQtW5aedc04zj45k4QPwgGwItpQW9B0klwaLA66eNVw\nbaXGGhx/N1utKrsTk+VOZSkGVMNVVlt7hIn2A7+b3/j26Nq5pBTUNMvr2NDJ\nOXKgbVD4u/VDGzJLE7tDa4mO9qVSkPCXH6L5agGnPr0CYbBXVZomWmDWa6HP\nJFG1pV6rSL3NB4/Vc8/F8Hww1Bp+hX2SERg1lPRq96g9D33mI0ScbbdKxCpC\na9vlmZZCNYP+Cy5QrlKFUZ61fo6Q7b+ron5JsHSGJjc55fNmG7738+yk64PI\n2gI+6pVInACP5loCobkIo+IIjXrOEDENLk0kDvifYubpvkEdpiRkPdvwn/uL\nGCxxkNdvGsriqxervnCWM0DY7Orq/w7zYbss/UHQARK7BKqGv60SKZFiHqTI\nu3KivhuOwYZwf2WZAUU3S4ytkCAYeVgEBzHzvmOaawSimfxAdphmUyqpASgj\nLSFm+moR/YYa5P1y5buW3w9meDZ0vHjMaGtO6+NpZxr8DhqHuKgYUgBY7HM0\nKPjErH6s+YOLOwVLZO26Us54PpoZJALAUDK3CzfsWf34je8mD8yGMbvLzfiI\noYS2h5P/1NVCHVyOe5yXLWb9wCU7+KT6t92MaoG6Vb3E+2Q3kA45q6mJkpjm\nafSg\r\n=/kRd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCKguTQvE7FwyFyVBix8HMPtX/oJJXM2v8rY+53VuXKfwIgbcydz4y4EMTvGNba7pe/rdvm1k1hkq3T7MLNY8VYRm0="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.22.0-canary.8cba18fa.0_1626294395068_0.5306520504077903"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.22.1":{"name":"@material/mwc-textfield","version":"0.22.1","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.22d29cbb4.0","@material/line-ripple":"=12.0.0-canary.22d29cbb4.0","@material/mwc-base":"^0.22.1","@material/mwc-floating-label":"^0.22.1","@material/mwc-line-ripple":"^0.22.1","@material/mwc-notched-outline":"^0.22.1","@material/textfield":"=12.0.0-canary.22d29cbb4.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"^0.22.1","@material/notched-outline":"=12.0.0-canary.22d29cbb4.0","@material/ripple":"=12.0.0-canary.22d29cbb4.0","@material/shape":"=12.0.0-canary.22d29cbb4.0","@material/theme":"=12.0.0-canary.22d29cbb4.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"fbc09b4e8766843c4aef86023c2cfa4cb9e7cf5d","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.22.1","_nodeVersion":"15.8.0","_npmVersion":"lerna/3.22.1/node@v15.8.0+x64 (darwin)","dist":{"integrity":"sha512-7xLlW2B1wMnCi2JSlOELELPEUda0w6bWpjn4LB4UPi1hAWG8VR+Rn5rR6q4NDav9pad+qA7+PGjNlE32xVUm7g==","shasum":"ee9268cca825f1272eed242b6a12ae6585d4111a","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.22.1.tgz","fileCount":13,"unpackedSize":200268,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg72rECRA9TVsSAnZWagAAqeQP+wdTEaXH4kfVwzmS56Rn\nUqykb7QB3a/+7H8JejVRmj3ePy64lHHA1R82dcFjo8c4f5e7FFHfoNZCHOz3\n0FSGcM5XnhJMPWsE4htgyz88sSpyYICJ4Q35tBulW3skGrho7we2VWYdvJer\nVHO7PnOUvKZiy1vayX8VrOQb8wyy3OWxMYIMtw4WwE6XgQ1t3SYMiel9/uia\nIKiXSHjUkJkPSAswas2jQeId7x22EPEmFGELeVOQJsqIP61FVUWpWF6spb3O\nixGISqcfsXm6ClpSD+u2C1PFm+3hKHA5Mvp9ePQGTmH8RwZxUe1czuJqku62\nh51tYOlMZVdPcA6SOYNfdXgSOgptrqyFFbtCZpfTX4Py1CfroXsSzYhPDdn/\n63PJPR/lhQOTq6hzuYMOwjwbHoiTFLhFmMPV3dHLzwia0bXjIxEM98vGagEB\nX2uXs9o7RhOZttDyqeDturaVpvsc922J7Q/sZk7S3Z7KYGig6hslRaV9Hz9o\nzT/7TOEgA18skUV0MyQbBaEv/px8DMgQ0l8x6NvvmvQH3xYY7RKrQU7UQpvT\nj6BEWEzETGhlcWID0jTDt5mplHIcI+uVNsOPQTBa2EEIH8MU1CIGuZCualMA\nSWbM1xI7cXVndXWHXsVfzXd32r4LoYL0yXUwuEO1cIswk2oU7dzkrqiFzubA\nH/Pg\r\n=BVXP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGH6U2+ma2vVqf7bSH1CkuueuNxVgbsuvXV3NxDZeeBpAiEA4bcQH/fD8mlmi/ejTcNBPJkI2Ub3EHXjeXqciIn7Aiw="}]},"_npmUser":{"name":"aomarks","email":"aomarks@gmail.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.22.1_1626303172517_0.24664760590317392"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.fbc09b4e.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.fbc09b4e.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.22d29cbb4.0","@material/line-ripple":"=12.0.0-canary.22d29cbb4.0","@material/mwc-base":"0.23.0-canary.fbc09b4e.0","@material/mwc-floating-label":"0.23.0-canary.fbc09b4e.0","@material/mwc-line-ripple":"0.23.0-canary.fbc09b4e.0","@material/mwc-notched-outline":"0.23.0-canary.fbc09b4e.0","@material/textfield":"=12.0.0-canary.22d29cbb4.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.fbc09b4e.0","@material/notched-outline":"=12.0.0-canary.22d29cbb4.0","@material/ripple":"=12.0.0-canary.22d29cbb4.0","@material/shape":"=12.0.0-canary.22d29cbb4.0","@material/theme":"=12.0.0-canary.22d29cbb4.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"928fe21d53da3c383833e0766f262dd5454356ed","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/928fe21d53da3c383833e0766f262dd5454356ed/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/928fe21d53da3c383833e0766f262dd5454356ed/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/928fe21d53da3c383833e0766f262dd5454356ed/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/928fe21d53da3c383833e0766f262dd5454356ed/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/928fe21d53da3c383833e0766f262dd5454356ed/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/928fe21d53da3c383833e0766f262dd5454356ed/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/928fe21d53da3c383833e0766f262dd5454356ed/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/928fe21d53da3c383833e0766f262dd5454356ed/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.fbc09b4e.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-6P3F9Uj9QWytGCwWzykJxomqs7WlXY+8Jx2VdlbReGthRHPT0ZDjo5wD98xrX/aG+uBy+67rFFDVjhmg4OOOCg==","shasum":"23631f6d4a3aa850f258633cb5b180df01c7b589","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.fbc09b4e.0.tgz","fileCount":13,"unpackedSize":200371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg72sJCRA9TVsSAnZWagAALWUQAIqu1gpfjAjYfTIzsp4m\nJtnxLs/qLtvoNofF5w/vdPiqAOAU1tzE/4Y8lrn6p3kBzPCoFMyzc4YsJLlk\nplnhjX8pJkqnAna0Cxn6Bt3gIH5BOMQHuSvpEUH121llp5wTVXQRXbOmkwyL\ntzz1CHaVuIpW10PQlXiuG5fH5/doWXyK4wSW/ENfL0nqw7hocbRxhbXxzwpQ\naVocosP7gYi2dB5Rx2dI8v7XnllA5980MvXkeUAmV7WEBqaOSfGgwgXWplGF\n5ulzOkgEgvXQTw2cTLfynyiC5jwzP4zs0nxykeYoA0L6zOAlYWYX9H1ls6ON\nOv7sisXWaIhnOwATOc89j/OHYtOAVb5hpvjBQYgDBUOmR8HuT4sRcQ3X+kaj\ndMu+zp8wv1O+VUYNANodAI+mHsC/5ALJEfVrx1NnSUzfVr+Pkr1u/QlwJtlh\n4ivnlPfDf1SMaxCManefNbmHXpSxaSS+dPbIenF24JA8+LnciwlL2krfj/n4\nHouactJZq7PDlYkmTHhCPvV5rtdP6nv8FgTcmV/VJ8mLkrcauZu+RQzoqyDA\n2vHRaAMW31JgysVzXEKIlbmXEmANlXS5Swq4XqYHDPfPTo34D8veJLSGeA0x\nf12GIbzrg6npBmw9koLV9qXoKTdPL+lXrDU5eb3AJ271uMcdquWuGfnYvJ4g\nf8dU\r\n=FXLm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFn/Kf8moLCMDinqFsm02dtxpuA076uk+z06U8Lre5bLAiEA2IxhChQ275Tr+NUH5ZduNdoRZV2xZOsfKdKb2q1YNF0="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.fbc09b4e.0_1626303241343_0.1564947048700569"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.73e9f83c.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.73e9f83c.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.22d29cbb4.0","@material/line-ripple":"=12.0.0-canary.22d29cbb4.0","@material/mwc-base":"0.23.0-canary.73e9f83c.0","@material/mwc-floating-label":"0.23.0-canary.73e9f83c.0","@material/mwc-line-ripple":"0.23.0-canary.73e9f83c.0","@material/mwc-notched-outline":"0.23.0-canary.73e9f83c.0","@material/textfield":"=12.0.0-canary.22d29cbb4.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.73e9f83c.0","@material/notched-outline":"=12.0.0-canary.22d29cbb4.0","@material/ripple":"=12.0.0-canary.22d29cbb4.0","@material/shape":"=12.0.0-canary.22d29cbb4.0","@material/theme":"=12.0.0-canary.22d29cbb4.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"7cb506f7d4ddb8897417b2451e1dce233644faea","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7cb506f7d4ddb8897417b2451e1dce233644faea/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7cb506f7d4ddb8897417b2451e1dce233644faea/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7cb506f7d4ddb8897417b2451e1dce233644faea/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7cb506f7d4ddb8897417b2451e1dce233644faea/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7cb506f7d4ddb8897417b2451e1dce233644faea/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7cb506f7d4ddb8897417b2451e1dce233644faea/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7cb506f7d4ddb8897417b2451e1dce233644faea/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7cb506f7d4ddb8897417b2451e1dce233644faea/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.73e9f83c.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-Zmp3rYHuykaMN4NGuaNjTC7+p+9rklyzYiIp8yP/XQ6PDmxjsRz0/5MSSgSXkPjtLwV5TPlbqQ+Pd0Zy7VNv/w==","shasum":"4485d58afd361d09cb389f7f71031583d5736d68","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.73e9f83c.0.tgz","fileCount":13,"unpackedSize":200371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg8J0CCRA9TVsSAnZWagAAIaUP/jvpMWaVljW9RrmluEDT\nyYs57LikcZvPxZJvfWWu6dgNdjCu5hOTW1VymHACL2Q2aiIQwdXysWDhYOA1\nPU3vr7n7+Ns9oQygCbRBkBJ/G9wbXp/efQTfCrAmuki1hqobTpBHSBCS69GR\n2hk2p7PE0C2/3vkT1xyB0on3IOAxqCFscWAnZozPpgx9iCKsJgepublnJAuj\nFE/Nig7qZR2mGOnH1JMYHK+cytj4MRfZxxCIHdY6YoQiH5Iestv8fQEIXngm\nVcn1NK2lE0NxImTabmrRxB/B+d0uMU6+AEXc5os44Q6t7ZU2OQKIo8uWkBBk\nnoxecf78EHXfktfkBqvCs9EIMtpOQSypM0EQYNTC8xf7LmDyf9tHu/0hk1Dq\nxsesL12/PQ0RvBCTu9ANy9rcIUSDGuQ1KBmR3lsMxcVq+pFgoSCq0fp2Iz6X\nJ36CxrturKfAROOTpnemB/ESjO/orCE6Kt/nrPjo2N+MalVWBociL455HD+t\nrZXYfOY/NrYTUeqZN48SJeskU2R6AMwCbW2WPhTV9piv1JUUj/cK7RF3SxoR\nLX5UeR4vY/9dbV7hG4F3J/CfI3W0ORj4WZdxuWzHQEQqVzvrdmJl5tw6G6+L\nuoWT5m6ouZazBFuG2gNT0hwGWSJwhYhVSmwm+ctqDTJMlQ/NTqDsrPYg7X4T\nvWkL\r\n=DfHh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD2p7lOw+YqRyqXjI10QD5VO2G9g14+RkAytVXIlZXSKAIhAPHsWifPNYTldDSRyse7yv50u6wBFOLann4ZK7lBRPFp"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.73e9f83c.0_1626381570666_0.454825732690064"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.cc0aa7a9.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.cc0aa7a9.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.22d29cbb4.0","@material/line-ripple":"=12.0.0-canary.22d29cbb4.0","@material/mwc-base":"0.23.0-canary.cc0aa7a9.0","@material/mwc-floating-label":"0.23.0-canary.cc0aa7a9.0","@material/mwc-line-ripple":"0.23.0-canary.cc0aa7a9.0","@material/mwc-notched-outline":"0.23.0-canary.cc0aa7a9.0","@material/textfield":"=12.0.0-canary.22d29cbb4.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.cc0aa7a9.0","@material/notched-outline":"=12.0.0-canary.22d29cbb4.0","@material/ripple":"=12.0.0-canary.22d29cbb4.0","@material/shape":"=12.0.0-canary.22d29cbb4.0","@material/theme":"=12.0.0-canary.22d29cbb4.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"46cd2c64b884400d63eb38fd81a1ad72accf42df","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/46cd2c64b884400d63eb38fd81a1ad72accf42df/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/46cd2c64b884400d63eb38fd81a1ad72accf42df/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/46cd2c64b884400d63eb38fd81a1ad72accf42df/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/46cd2c64b884400d63eb38fd81a1ad72accf42df/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/46cd2c64b884400d63eb38fd81a1ad72accf42df/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/46cd2c64b884400d63eb38fd81a1ad72accf42df/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/46cd2c64b884400d63eb38fd81a1ad72accf42df/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/46cd2c64b884400d63eb38fd81a1ad72accf42df/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.cc0aa7a9.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-KkwekxsnbQnRR202fjJyRKFCD/Q7vWkNSDkAjDJZ6Ydus5kDXGX5pQ6QUHbKi+luMydjb0xhh8zevgMMKU7TaQ==","shasum":"8ff31759dcea2bf6a28a156dacf081890f510a97","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.cc0aa7a9.0.tgz","fileCount":13,"unpackedSize":200371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg8KKrCRA9TVsSAnZWagAACkEP/01cUwYlkhyBxjDnmZ95\nhG0Ck/IT7t1yUeWzZ5T1Ku/9e7AwV69fy6yEE7vWDnDHwOqAvDJuh9DmtUro\nrXoAZUYFEnTXZ+31iTfYwkCefVBaBRoyxvsjvi7gzz5c/c5Tme6/5Wt0zWQx\nAddaC55RJBDX4lizmlrux8m1nZcPgo+IDdEvz/ue2RiyRvL5H6UgeBDKMnxH\nND7Jo9P0H0Eb1kbbaRC6hDtAIfmIM/A6cgG5fos+umG/65HgkG6gpvN0P7d1\nuu94jC2qbSUFGOPPrDxxtRfQ//tqZLsg/6AoO3bZLQLCHzWLHqz2SNfhN/tt\nL9fh4T9+lMJrKAfN9rk5ae7kfBd0MO/Cc53qLof2xE1S3+9lA25nin23+3Px\nnxV1iftD/oOn1otqtzEijQKpPPKWersZH8qk9qRNN1ptRX1jFmM+dqivjqJ/\nnmrbgn6KmzPttYz8JsEeTbrqOKZmyfn9zpAJgKC7y7/LKXC9bPVMXYdn10sD\n59yhKD2wmnujS3ziqVYFq+6gfPRcpqTB7GscukJQJFlPa3ayxm3bJ9UT7OTG\n42erkZLxOYWxGBq0PMAFapTCJvg9Y7Q+2BcrUjSzY3mOz5eFKe8JDe9FlOkZ\n6x23niNuv5pDRtEKULYwCq8tO6ien96Uj2pFkopxydtqP06jas8aHA1ko5yq\nk6Bu\r\n=tMYL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFsZqmfjheFoKk6XDLxxPUzn25+PJk4vU8GFlJxoJC+YAiAWE7XkrbzyQSqtpgFfS2CJgIsa2fzGoujFwi9O0dDEWg=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.cc0aa7a9.0_1626383019379_0.5397732587389801"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.a8fcac45.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.a8fcac45.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.22d29cbb4.0","@material/line-ripple":"=12.0.0-canary.22d29cbb4.0","@material/mwc-base":"0.23.0-canary.a8fcac45.0","@material/mwc-floating-label":"0.23.0-canary.a8fcac45.0","@material/mwc-line-ripple":"0.23.0-canary.a8fcac45.0","@material/mwc-notched-outline":"0.23.0-canary.a8fcac45.0","@material/textfield":"=12.0.0-canary.22d29cbb4.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.a8fcac45.0","@material/notched-outline":"=12.0.0-canary.22d29cbb4.0","@material/ripple":"=12.0.0-canary.22d29cbb4.0","@material/shape":"=12.0.0-canary.22d29cbb4.0","@material/theme":"=12.0.0-canary.22d29cbb4.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"7319affa5e07f6651089343a3fdf21864f2d3de3","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7319affa5e07f6651089343a3fdf21864f2d3de3/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7319affa5e07f6651089343a3fdf21864f2d3de3/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7319affa5e07f6651089343a3fdf21864f2d3de3/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7319affa5e07f6651089343a3fdf21864f2d3de3/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7319affa5e07f6651089343a3fdf21864f2d3de3/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7319affa5e07f6651089343a3fdf21864f2d3de3/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7319affa5e07f6651089343a3fdf21864f2d3de3/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7319affa5e07f6651089343a3fdf21864f2d3de3/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.a8fcac45.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-Cjzks3CGn2guk8oF5L0uLhrFIjQObQgyFw379dv4SVH/TJDxjn0POTvEgZx8yqvUKhuj6yJCymMv8TFWWjeikA==","shasum":"c12ed236c5c67a64eafdab55a7caacfab21939de","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.a8fcac45.0.tgz","fileCount":13,"unpackedSize":200371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg8KccCRA9TVsSAnZWagAAOdMP/0RF+1mSp/T2UdEmES7l\nKFW1GiI46fT5cR2iIJEdAmKskhXilBRb/W124Y2xVlOwnOQsn2X+mVJbOkpH\nForfNXXvohCIFlqNDAovscmZe/SMB9vdEJgvUTVdIO98NGVhyTYwdE6oW6Xl\nJt8URxUCvC87Deg46cofy0OV4rP/he8EKi9D77E1LlTUrSMg6mh5OxrebuH8\nl7OLD3gScYvJCFbYxe4qfjP7LuqUAzttnPBC2rBlqfDo/4if5GqGIahNomlC\nP52xxbsgofLnPZFtuLVTdZJBLtBEyEYAXArqINfl0J7P9k/TPoB9wmBoOHll\nzuaYD/rN/5d3wwfzhBtmIJy7PtVibAVaholkhMkBel/dwFzYyas7xIhCCiLu\nO9hkuG5tkMmv3Qdlhvl2fJkrROE4jwvVahypZMgOAeot+Hd4INNCRprTHele\n+cuReGZ/MSMn0b1gR5G9kvtu7qvAcKsfbqk7PzoNjHdzhMyV7IBON9D33JS0\nns2J9HVeYPLb5FpR7iUlP2OfxoCUVb0L0ipIbLgZj197IhGiwbY8UdLS5C/R\n4zQhIuFjW1O4uZNSU38e0uBYsxM/gCLNRX+XROe3l3kEEZ9KLH6v6wvgPQwV\nhDeuIFRXaOS8KhfN7eRWxrB+R+VbQzV8vIdXDGIWpYi3oTXUgpHKTfcZfkb8\nrtiO\r\n=31Mg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGoxo2xoNqY+Ix8l4Pmk2i9wZYs4KxclFiV/uxAXl1EOAiB9xV15mnw/Wn8EftebE2WCtc3JrLxKn0YwJyvR0XRnRg=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.a8fcac45.0_1626384156392_0.5136384690280809"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.3ca580d1.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.3ca580d1.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.22d29cbb4.0","@material/line-ripple":"=12.0.0-canary.22d29cbb4.0","@material/mwc-base":"0.23.0-canary.3ca580d1.0","@material/mwc-floating-label":"0.23.0-canary.3ca580d1.0","@material/mwc-line-ripple":"0.23.0-canary.3ca580d1.0","@material/mwc-notched-outline":"0.23.0-canary.3ca580d1.0","@material/textfield":"=12.0.0-canary.22d29cbb4.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.3ca580d1.0","@material/notched-outline":"=12.0.0-canary.22d29cbb4.0","@material/ripple":"=12.0.0-canary.22d29cbb4.0","@material/shape":"=12.0.0-canary.22d29cbb4.0","@material/theme":"=12.0.0-canary.22d29cbb4.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"a2e57ca3915a4619a2a2fe234e3e3bb8be5a5496","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a2e57ca3915a4619a2a2fe234e3e3bb8be5a5496/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a2e57ca3915a4619a2a2fe234e3e3bb8be5a5496/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a2e57ca3915a4619a2a2fe234e3e3bb8be5a5496/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a2e57ca3915a4619a2a2fe234e3e3bb8be5a5496/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a2e57ca3915a4619a2a2fe234e3e3bb8be5a5496/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a2e57ca3915a4619a2a2fe234e3e3bb8be5a5496/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a2e57ca3915a4619a2a2fe234e3e3bb8be5a5496/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a2e57ca3915a4619a2a2fe234e3e3bb8be5a5496/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.3ca580d1.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-F30j/oqbBbjEzQOeC2r6oGHhyBLwaJ+ybmToF0KGHZ0ttU6AqsxDbjJfTfwlrzOE9opiUV8elyifyOCrm/riIA==","shasum":"ddea1b08dedd7343b62ed0ed5856eda4f1382f9a","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.3ca580d1.0.tgz","fileCount":13,"unpackedSize":200371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg8LDQCRA9TVsSAnZWagAAxNcP/2SigNvyDJT574IZdqxt\n6y3TiKgK0FeL+neu95zyHatHtLHW60jYhMFdNkMhAE3qBSR2F91TKA3GD6Kv\nNelaM5JZR8mbgXVsqhx+OZ7uT1VeFqQ6z/i8858XZrtAAt8vqzIr0yjFg85b\nzZm7Lx0MMbig3MyGT0RODVuw6fgeFfBTFUicElhmqd/8f5gYa/dpMk6g4QPe\nmk3Vfu0NTeNXr9EJ4FjuFbJ1jcbEdxpAhv+Cw3++ewHdqUuuH/rWgoOTPe+n\n1zdmB3EDxgogj3qXxAQSLXQzREIzc4rVVQbOMpTS1HYDX3M6+m8QX24Trscm\n+oPmzxgGooArkh/6P15uf7W1FfnYfNMTXopCxjqYSxjnbvsDGcaoQpjILZIg\npKCSPKq9ghqGQutHecE/W/vMroUaAIHEC6VrNI0QprVdpSXezPo/GxC84XsZ\nKMEUCUBNFOoaDlWoFsr7cqJBBQVHwK+4yKF5NlRL99SD1FTSBwabKWnS76ck\nY3AQ/gK5UPecOlK/Jz/WQyviWP7b7Cg+q+UAHkfxockuNYvtFAepApfgtrkB\nJJ/u7rocXP8Var5UVxI61NImm0TtU/V+TqDG3d4zmyCwc9q4VztsN6ZyVOQ8\nB/fbAaMsf+uOyT6llxiz7uiN1nsN+Wul9ttAB+17YJBx8NcW/GmSymlrgtyz\n/qqP\r\n=f/wQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHq0zH/ps1JHTAuMoDA6a7PGTYLEgP/22w7dYi/hN7M3AiBfM/RzIB6cwYQkjtoSWMrlV73qZ1K+sjxuazCcMzIPkg=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.3ca580d1.0_1626386640582_0.6992840237516109"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.9e41cb2e.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.9e41cb2e.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.22d29cbb4.0","@material/line-ripple":"=12.0.0-canary.22d29cbb4.0","@material/mwc-base":"0.23.0-canary.9e41cb2e.0","@material/mwc-floating-label":"0.23.0-canary.9e41cb2e.0","@material/mwc-line-ripple":"0.23.0-canary.9e41cb2e.0","@material/mwc-notched-outline":"0.23.0-canary.9e41cb2e.0","@material/textfield":"=12.0.0-canary.22d29cbb4.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.9e41cb2e.0","@material/notched-outline":"=12.0.0-canary.22d29cbb4.0","@material/ripple":"=12.0.0-canary.22d29cbb4.0","@material/shape":"=12.0.0-canary.22d29cbb4.0","@material/theme":"=12.0.0-canary.22d29cbb4.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"66f1b7c941717bc279a73626020dd81fa186f3b2","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/66f1b7c941717bc279a73626020dd81fa186f3b2/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/66f1b7c941717bc279a73626020dd81fa186f3b2/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/66f1b7c941717bc279a73626020dd81fa186f3b2/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/66f1b7c941717bc279a73626020dd81fa186f3b2/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/66f1b7c941717bc279a73626020dd81fa186f3b2/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/66f1b7c941717bc279a73626020dd81fa186f3b2/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/66f1b7c941717bc279a73626020dd81fa186f3b2/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/66f1b7c941717bc279a73626020dd81fa186f3b2/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.9e41cb2e.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-h5rbAwsvSff/fjj5x/AtcRK8p0ao3dhiZxO9gT40YTsGY5G76lnrj3OmFMcTjOhbArcvMJy2wjbeo1ObwjAukg==","shasum":"52ec5f4cec056f2f6fcb2b377c0f9c1f9da5e6f6","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.9e41cb2e.0.tgz","fileCount":13,"unpackedSize":200823,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg8MARCRA9TVsSAnZWagAAJSUP/2hJ1502lxBRGi5X5ChE\nMDxKn3MTNXxXNiBsWZGTTyeI7RbPMT3f4lBvGAF5O4wWQ0epxtQxI1VC/5hG\nW0WK1kkTL6m6602cXkbWwlsdEn5hFtBZcoM8Lk/Z/Z16WTKe+qshGXKRxv0/\ngJJX0QEdnCQmRqthFKc5Gm4ThGi9EydRFVZZ+bZuC2rdHtArQKzOoHltmlG3\nnd9NeaQhOH7EpwNP8RH5PyenYrZPCGO1Z0uX6yGhp+48WafIVvJcYsdcMvGR\n93fFqDmtbJeocc3wvan7zHkTTpauoILMuo3I1CRPTwAodkIfBS1lvL0gbS2/\nr7Gu9SUlnjOtDFLfM1p2e6bZ0taw1SoIbLa0uUxoh8VqGip2UZUPyAaNngFR\nid/9DRtgsssmLdlzzwwvKZ9jqL1hVD0VF2UOKDu3VhK215bDw72mopyN/ETd\nl3pv4NQlJoiOTjppmSYvKV6cZfTI9sIo0PMBFUFBkrOO/RO/+AY+wBzmoelg\nAG+ku8yAMPqfH6Oezmf75nKuH6afzKUifdhpnUvGeSjdfIGkDm+J62cBwHRK\nomLmEl0bwQ0FvbnEW47F0Ux3SV0al2B8P8W+0vHQ0GJEljYF+VApKxYISEIw\nNJ6Di8NR1PprU/hAdb7QfXq2boLScGyAywE2ccs2A6P1svLPdNPpNCuC2/h9\nrZLT\r\n=MzB3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD7fLiRmJiEOj5RGtijulJme2hPG/TChLWPjXLBwG89JgIgSkZltJDuWR38u44kA8Qz9XyFJD6Uzh4Gl7L4t9tdyq8="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.9e41cb2e.0_1626390545789_0.5503115707057358"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.c180db74.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.c180db74.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.9f68a932e.0","@material/line-ripple":"=12.0.0-canary.9f68a932e.0","@material/mwc-base":"0.23.0-canary.c180db74.0","@material/mwc-floating-label":"0.23.0-canary.c180db74.0","@material/mwc-line-ripple":"0.23.0-canary.c180db74.0","@material/mwc-notched-outline":"0.23.0-canary.c180db74.0","@material/textfield":"=12.0.0-canary.9f68a932e.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.c180db74.0","@material/notched-outline":"=12.0.0-canary.9f68a932e.0","@material/ripple":"=12.0.0-canary.9f68a932e.0","@material/shape":"=12.0.0-canary.9f68a932e.0","@material/theme":"=12.0.0-canary.9f68a932e.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"33c53eb23c6f331885c1a70223139ee7e69ae97a","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/33c53eb23c6f331885c1a70223139ee7e69ae97a/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/33c53eb23c6f331885c1a70223139ee7e69ae97a/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/33c53eb23c6f331885c1a70223139ee7e69ae97a/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/33c53eb23c6f331885c1a70223139ee7e69ae97a/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/33c53eb23c6f331885c1a70223139ee7e69ae97a/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/33c53eb23c6f331885c1a70223139ee7e69ae97a/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/33c53eb23c6f331885c1a70223139ee7e69ae97a/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/33c53eb23c6f331885c1a70223139ee7e69ae97a/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.c180db74.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-jsxP1wwCBZG+hm5NQFck28seTPrzeX2y0KYKKyJziJQ1XrOd5Mfwxjul7U9MXRrnl96My44OZY+EAEkXHeE5bg==","shasum":"c4b0a98e3b4902ce1ecc6e00e32d4be33e2053ab","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.c180db74.0.tgz","fileCount":13,"unpackedSize":200823,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg8cDoCRA9TVsSAnZWagAAtkMP+wU3ZhXkeymg4Q96BURf\nP2tRMdvWrHgwxCl8BeK/aKYUZgnAClcdKVGgblRwCEzqBn5DB1+sDEnSCLYD\ndhvyfcwcWgy5RXzuJngO9veCRKbd7kgtLo+z520KpKWgDDIrGBq36aDHfWgm\nYr7U7Wc/zgLlAupHL9HR5d6teJ98tINa70s4eCQ8c9uURmYIrO96Ak32GfVj\nxRRrCeHNJ5iHHbqZOG/c558jII0HpkiJGLSxgm3pQ/s/YVaXg9Qx1U52cMgl\nwON18NXsY5zp4FKLG7gLx4ny4YGLB+DAmBtJ1ur4qIFoy+KB5DGUlgOL8wtJ\n5RgJiK8ws1+BlBS6eEE9I9qswYMbv4NtvbEuFf3NqCvilafkIFpVpJUKGAY6\nyV9r01naH2J+S/NiFMJT4AlL2D8BcXwe31ySrk9OdnTWkcXR07DdTdfBEN2i\nR1WdHn4EP7DzxZFJOTL7fSe1/fnciFBMvzfCRbf2tlWysHrbNE4gmHqF3pjf\nM3TRJgugGRH9fv+oE54Z1LwA0+pI4qVhi4kC89P5ELYOG/Xrtgam3SsKJg7W\njJdNKhoBmEM4f5w1K7rcC950PFzOuhCJX4lPU+bha9ZrAxcAzMGzKv5T+wPP\n+WcKf+E9cSSxWLSkvylUEQVsbQaE9mhaP9D3EUy5zPLPlLg5/fafPvoHILqh\nB0U6\r\n=VWOs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDTgGzcMH6ufoNjYTqQC/MxeWxJUR+DKyS94QGdWmM8HgIgSjfPgtA+oIht3AgamxHKp6+9+iz6UseD5zD1TpiOZSI="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.c180db74.0_1626456296675_0.7499478625753173"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.0d0a9267.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.0d0a9267.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.9f68a932e.0","@material/line-ripple":"=12.0.0-canary.9f68a932e.0","@material/mwc-base":"0.23.0-canary.0d0a9267.0","@material/mwc-floating-label":"0.23.0-canary.0d0a9267.0","@material/mwc-line-ripple":"0.23.0-canary.0d0a9267.0","@material/mwc-notched-outline":"0.23.0-canary.0d0a9267.0","@material/textfield":"=12.0.0-canary.9f68a932e.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.0d0a9267.0","@material/notched-outline":"=12.0.0-canary.9f68a932e.0","@material/ripple":"=12.0.0-canary.9f68a932e.0","@material/shape":"=12.0.0-canary.9f68a932e.0","@material/theme":"=12.0.0-canary.9f68a932e.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"edc1a3fb88ad7e6dec8f22e73f329dd02bca032f","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/edc1a3fb88ad7e6dec8f22e73f329dd02bca032f/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/edc1a3fb88ad7e6dec8f22e73f329dd02bca032f/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/edc1a3fb88ad7e6dec8f22e73f329dd02bca032f/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/edc1a3fb88ad7e6dec8f22e73f329dd02bca032f/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/edc1a3fb88ad7e6dec8f22e73f329dd02bca032f/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/edc1a3fb88ad7e6dec8f22e73f329dd02bca032f/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/edc1a3fb88ad7e6dec8f22e73f329dd02bca032f/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/edc1a3fb88ad7e6dec8f22e73f329dd02bca032f/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.0d0a9267.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-A/SSHm+PunLXMlhh1oS0XsTDLeFR9R2LmmHMC5bYSChAJKfaxt2B2flPk6kEdw2LZlIt+0jbtGGRZlz5zv0FTQ==","shasum":"fb83986679659b024ae3f4108d671619d3cb79fc","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.0d0a9267.0.tgz","fileCount":13,"unpackedSize":200823,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg8ch4CRA9TVsSAnZWagAAeQwP/Rcj5Y+gmR4kwsJ5Rg6n\nIMyU1luoySv2noqV+BEmhFO8yQq8IKKWw2+hY0SwwxiDuOjsEbAiC3DBHsMk\nXWHoD0CML3bA7RoWz6eIEI/+Rglb8sTd7FEPGjHxPo/yO8FND7097+hqu8MP\nhRrqBAb78BZkRUrw2L8+Mv4ATCkKygoklWRYaVR4Gzv3oIHg4ILHMts73DVQ\n0dZiQyKSKF95tuKd1oNvpI2bv0X04DpdpUMFmzopMiAw1hzwUZ5V6zHAmMx1\nGWGrcNKcJjh7RgahxFcN6+PKtvCWXce/2EiJ3N3vOZXgDM7vhjtrDuVfhDBF\n52Q+G5laVhxo5TqNPPtTe6Y08VyaQBCm8CjoJfPy3UXJYvujkFfbv57z9QWI\nen9lSZz7U8zof+tqvQ7p8ryX9ulPl9iduDfX+Refv0M/wXsKOCvZkXUI0Svc\n9+ZVZm4qvxcdhICZF65lv5ACzIvukvaCvA8ZcVRWzwqXzs/o630oAT1embR+\n3VwRjjHdVCzoPLQvhPEUUhuL75gOqcL0rwMUNM5hVrIiSwRuUN8JW2GxpRLs\nVKy5/B1629zIWQLjIsTNLMmhYLdgqOmP5sXrMjohxGW1LuYEyyJzBx80iAxt\nyw70+6YKtAHThqF5+GMFsA14UEv0Sq6HV2YDVHCiUGqY06RGnHrJP1Pl+PGS\ncaQN\r\n=SubB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC+hhCuDCpo6ptaWbwCUZ5BkA38urlbMEwdiv8/AYBzfwIhAIs8txpiRPTyLDgCekWp4V637mN7LzXVgGsK3EARP3Ff"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.0d0a9267.0_1626458232013_0.8651506904421666"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.d234ec3f.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.d234ec3f.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.9f68a932e.0","@material/line-ripple":"=12.0.0-canary.9f68a932e.0","@material/mwc-base":"0.23.0-canary.d234ec3f.0","@material/mwc-floating-label":"0.23.0-canary.d234ec3f.0","@material/mwc-line-ripple":"0.23.0-canary.d234ec3f.0","@material/mwc-notched-outline":"0.23.0-canary.d234ec3f.0","@material/textfield":"=12.0.0-canary.9f68a932e.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.d234ec3f.0","@material/notched-outline":"=12.0.0-canary.9f68a932e.0","@material/ripple":"=12.0.0-canary.9f68a932e.0","@material/shape":"=12.0.0-canary.9f68a932e.0","@material/theme":"=12.0.0-canary.9f68a932e.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"950f54539b9a71153ac09a57ec5710112c307c8f","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/950f54539b9a71153ac09a57ec5710112c307c8f/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/950f54539b9a71153ac09a57ec5710112c307c8f/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/950f54539b9a71153ac09a57ec5710112c307c8f/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/950f54539b9a71153ac09a57ec5710112c307c8f/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/950f54539b9a71153ac09a57ec5710112c307c8f/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/950f54539b9a71153ac09a57ec5710112c307c8f/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/950f54539b9a71153ac09a57ec5710112c307c8f/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/950f54539b9a71153ac09a57ec5710112c307c8f/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.d234ec3f.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-LePbOS//ls0AjToWrtdxENHRjTmoDSwoqsLjw37b2mIFOp3vCxpEjmBuNxTwlkoWENHlRKClx9kc9pUnk9IbyQ==","shasum":"c801ec3d925ae6c192424db5595fee150d6ae0ab","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.d234ec3f.0.tgz","fileCount":13,"unpackedSize":200823,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg8crxCRA9TVsSAnZWagAAL9QQAIaJdEyQPcQA2CkAonwk\n3oo5FJmjZU568fwMvMbuASYjbHIYv4eKph1IBvpqshOk8yn7joCpWpjnQtc9\npT2sVKAx2I4gDPPzrhmkKiMvW6NRDqi/pvZwdbdyGZoCOLvNwDoXVY28zVhC\nLaQSSqxZ1EVH75VCdQ42rme8nK837qA1grWsHH4FPv51krKuLd7zQIMxIQVl\nC1kBH+llafsNAmUTviUpNIdag5C39iswifPBqXa1lf+X6jFR59Kmq9q7hyHl\nXTEZdHWkn9VcjBV5ciPWWTtCVATCPdLqN3rYLZyXM4oT8KEADczM+81Ty0SS\nUEub8kMNvDXFVCpei9t9l5C8X6nAkkPEezvVBD1xg73Q2by1xTYVO7x1vMIR\nO+jPyB6RSbO430Tijvba7Cie2xxKUXBQGddvXwxBZ/oFHX77zOsFb5d83lP6\nzKoGQJD9vJDIolJ5xuAlXLNXPmqrL8y8TRkEALkkNxKxXAfuBNsVl4+a1KX4\nq2gOnEB5BIvMfdCibO/DqreGz+Bn2qnH3F+XSP+rdljwRBs7v/ZQhHvBj1QZ\nFUUnJe1reeTUysE2Hl6zYNl8vnThQFKdfnoyX0+PoOfvAeSr7MaLuaxS0Kih\nzKrR9QG3cDwIRbxU/INuq5C6Vnhe7hXZ+njag5eOzyRK2rm2K6ykAddGxXia\nykzg\r\n=yoBg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD9Lt91RVTbczVK2ee7ngf7DPqssRKjjRylmcjAajbDugIgEv9J0ZdxcSbBJcrjbF6LGPf3xinQxOVNqVSdOCdHF0w="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.d234ec3f.0_1626458865317_0.03174832068779998"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.5cd4bcdb.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.5cd4bcdb.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.9f68a932e.0","@material/line-ripple":"=12.0.0-canary.9f68a932e.0","@material/mwc-base":"0.23.0-canary.5cd4bcdb.0","@material/mwc-floating-label":"0.23.0-canary.5cd4bcdb.0","@material/mwc-line-ripple":"0.23.0-canary.5cd4bcdb.0","@material/mwc-notched-outline":"0.23.0-canary.5cd4bcdb.0","@material/textfield":"=12.0.0-canary.9f68a932e.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.5cd4bcdb.0","@material/notched-outline":"=12.0.0-canary.9f68a932e.0","@material/ripple":"=12.0.0-canary.9f68a932e.0","@material/shape":"=12.0.0-canary.9f68a932e.0","@material/theme":"=12.0.0-canary.9f68a932e.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"5c053f1de07d32aeb409f327470360f0b5c02ae4","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5c053f1de07d32aeb409f327470360f0b5c02ae4/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5c053f1de07d32aeb409f327470360f0b5c02ae4/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5c053f1de07d32aeb409f327470360f0b5c02ae4/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5c053f1de07d32aeb409f327470360f0b5c02ae4/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5c053f1de07d32aeb409f327470360f0b5c02ae4/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5c053f1de07d32aeb409f327470360f0b5c02ae4/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5c053f1de07d32aeb409f327470360f0b5c02ae4/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5c053f1de07d32aeb409f327470360f0b5c02ae4/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.5cd4bcdb.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-n44PpUNgk/wED7xzVliHCX57YtRlNlokR2nNVEZO/r0NbdjAGT6OF644aOpyeQuEu26nT6V9K4S+zhJxvV4JTA==","shasum":"774b98d4e549753042b95b8f8eafb357e67d46b4","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.5cd4bcdb.0.tgz","fileCount":13,"unpackedSize":200823,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg8fYkCRA9TVsSAnZWagAA+EAQAIbKnVGOstk0NnUNibMH\n6lRzznezJxDnfga5jNupjm9+imuVPWhjSxjjRDnmMWo5gPsSL4irmxMLOWa7\nzKkAxnXgJlqE2dcsPpIYCvaf0lS49YaOgY0Ihr4Tet/K427iIpGaArlghRFl\nsD1pAVZ+gMyb6rv7wsc9uT0DDcRE5SpXxXi4VDWU1QzSZyVC9u2VIIKcGMft\nDMUgLGPhXT7njiwHlpReRJEVbAhxODeeBdDQX6+v963H6fbQRIIf75CZqlaM\n7KkEZ9nSO7g0H1ScZoi1Trpsd9QdGbYOWOE+X7sZOVWPSMsx+Iwt/1VpPViK\n7W5LMgt9OhY7D0H82atqxUwFSjOrMGNzeSXtOwDuGMwohBqNybQEr6rnfiFg\nkeNMWyMAtbDA8UG1jr5gnuJ9gqOwbEqh3kVhEZ4tKVGKoS9QbQhHGuuUowno\ngRxnNVYEogrHIGJZLVP8yUpmk/Wv1cgjgRWPOK1KAvuvxTkLEaQjx+Q7hXIB\njbnr7aDxQDalJLE8K5MRBGc+JLuTL5eR4zWmidiyOC/wmH85sCjct5dkpQj4\nefCLRBX98A8rCKOMxWu2J82WPD9W5A5K/YM59NOoxmLgYqCjPTJ1d1/a20SK\n7sFsTFIDljm1Ames4Q2v4SxHgHKlPnaVED9Py2M8MCBSg2hPBR7KtezHlFwB\nWpyr\r\n=nnF8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHIYZDzCnyywhx+dUsXGxnHLq1pD/JPsGzfDVY+W1bZ2AiB1e4sXlNX7eI7JdVo/13wZd41tjQgsoizYkgxQ752CVA=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.5cd4bcdb.0_1626469924419_0.7404777974104737"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.2b133cb2.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.2b133cb2.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.4d95812f9.0","@material/line-ripple":"=12.0.0-canary.4d95812f9.0","@material/mwc-base":"0.23.0-canary.2b133cb2.0","@material/mwc-floating-label":"0.23.0-canary.2b133cb2.0","@material/mwc-line-ripple":"0.23.0-canary.2b133cb2.0","@material/mwc-notched-outline":"0.23.0-canary.2b133cb2.0","@material/textfield":"=12.0.0-canary.4d95812f9.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.2b133cb2.0","@material/notched-outline":"=12.0.0-canary.4d95812f9.0","@material/ripple":"=12.0.0-canary.4d95812f9.0","@material/shape":"=12.0.0-canary.4d95812f9.0","@material/theme":"=12.0.0-canary.4d95812f9.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"72202d1bfc4060bef4aa100b9593a5dd27125d0e","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/72202d1bfc4060bef4aa100b9593a5dd27125d0e/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/72202d1bfc4060bef4aa100b9593a5dd27125d0e/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/72202d1bfc4060bef4aa100b9593a5dd27125d0e/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/72202d1bfc4060bef4aa100b9593a5dd27125d0e/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/72202d1bfc4060bef4aa100b9593a5dd27125d0e/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/72202d1bfc4060bef4aa100b9593a5dd27125d0e/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/72202d1bfc4060bef4aa100b9593a5dd27125d0e/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/72202d1bfc4060bef4aa100b9593a5dd27125d0e/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.2b133cb2.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-u4W30+ttMlbV3MaKmQdoXUgXv8ELE8asCCgElX/9OSMxjLGAJg/BH/Ka2HJv0yUOa/gmPFHmF7lnfZI0mIOn9A==","shasum":"bc304f66082571d5fa3c6bc9a9893d72d6c8a338","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.2b133cb2.0.tgz","fileCount":13,"unpackedSize":200823,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg8gLpCRA9TVsSAnZWagAAWpoP/3duQOZUGpycHAO7UOqL\ntNbt9g3ZQF9SpF1sImNHbwzQ6YhL1w2zbB0bD3vF0lF9jSgQ6daCXzcwBb9h\n0xzbq+XLnnmCQm/ZTx4UbnhVfAnfyvYmBUbsdsOP0NA+cK9aQHjFLnXgHjuH\nWzkfhZRiTLv318mJUZ/8cP3oZlwLKPBkrAaQQgqHFHEb3KCU7rrjSMyBZ25F\nBuHrFQrDlo49TdgX468RgWawLacFVbtngulHHGL9Af1iRFXnp1aGTjVu7fMn\nyu2SH0ic23oBUJjnpZPREAVeik+/EslhOJc5jEOTDIlJ/hmDdYH7PB9nNGhj\nTAC0p92BmUkijWHtr8PBJCEmdkPgcOnWCkDJYDaJOh3W4BzgOa5PzNQk+ZsX\ngKmDsi8lAe5Ly6DhLqkTn1nK64z5LcYQp5QmTa7TgEi3+c1fnLPrcOu+zc04\nSE6WMEw8XUdDRrYSRU8CZquyGKiUgo2pePF5yv16hlQLtFNMyeMxMfYDrs3Q\n5L3nGs8N5di0twQMNPd7j0TnS2J8XkBSiLFjByWgB1rlmclqHt+7ebuSrtNo\nZL4uRGN+LSGB1FJJTrAdm0yFUPPtCDLYqlLSroNysdfylTTWuRiKx9hg6PUm\njjmbd3sb4I/yOYrNuJxRFv3yrnJAyw9OBLFtBFM6U32mne/ElVPwBZRk/py9\nl6Vw\r\n=25hG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA3J3F1MpRQLrIPXYC5VTX1UJeZu9XEkGI/Ms7eZw0+fAiACWf5cC1yNrqA+yGx6iVpq+WP8Ggc3OFidHeSbHlri5g=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.2b133cb2.0_1626473193303_0.8713064933913266"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.ae4f422b.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.ae4f422b.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.4d95812f9.0","@material/line-ripple":"=12.0.0-canary.4d95812f9.0","@material/mwc-base":"0.23.0-canary.ae4f422b.0","@material/mwc-floating-label":"0.23.0-canary.ae4f422b.0","@material/mwc-line-ripple":"0.23.0-canary.ae4f422b.0","@material/mwc-notched-outline":"0.23.0-canary.ae4f422b.0","@material/textfield":"=12.0.0-canary.4d95812f9.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.ae4f422b.0","@material/notched-outline":"=12.0.0-canary.4d95812f9.0","@material/ripple":"=12.0.0-canary.4d95812f9.0","@material/shape":"=12.0.0-canary.4d95812f9.0","@material/theme":"=12.0.0-canary.4d95812f9.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"8bddb410bdb60fa3790691718471a6b49c3f8765","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8bddb410bdb60fa3790691718471a6b49c3f8765/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8bddb410bdb60fa3790691718471a6b49c3f8765/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8bddb410bdb60fa3790691718471a6b49c3f8765/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8bddb410bdb60fa3790691718471a6b49c3f8765/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8bddb410bdb60fa3790691718471a6b49c3f8765/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8bddb410bdb60fa3790691718471a6b49c3f8765/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8bddb410bdb60fa3790691718471a6b49c3f8765/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8bddb410bdb60fa3790691718471a6b49c3f8765/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.ae4f422b.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-uQcNhhF1Pc2mWqCLxj/f0Lk0jR8HavG3dy4Xe5aU7FXIedX39Nuq/Yya4K2oCpzzG8W0IndYMwqZxKq4q2GISA==","shasum":"25984ed721219929a36de9706bcabfe48f5c91dc","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.ae4f422b.0.tgz","fileCount":13,"unpackedSize":201265,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg8hwaCRA9TVsSAnZWagAA0gYP/159HizexgKFe4DznvSO\nkJvQco0iPT8lO6FavEzcKQVDwnHqZR6zVvj8uS+/syS9m5OBI+t42g2y0+Td\nGtvxzg1Mn+i3rJCtGfJTJShPsdMZbg5ieVJR1eTJdx1urh7q2u85N3J4dJEc\nZZ7aun13tXfyM9Rg+B+qN3hrjJKJG3bi3+++XKJLqp1tfFhbzz6uV3hFBeNC\nV3ryUzYELvimCDo0P8uJB8244qxFr7tZPIffnuTHCBahp+CbWHo9QM5THuhX\nKvVJ26eqmKWFmcViOrEIYA3g5YJJIjD3dLFpNzJGHnlHuMguHxnZ+C2l94/0\n+n145Lbal+WVA93Yrp/9MVRJVujbvpyYjjfQ/jdAR+FxaWXOHOVru7iDEWmf\nngRlq6ozMqVFCbS0kp9+Nr52ra0GQj8DKo3gFJIpllQXYtMRnhPUATcZFXuq\nrxYQRoWKNvBxb8hPa6ub5FupWLvxCubrMrgmJMwr0Rq81ilXW9mk/UWObo1a\nSWepbAQGLnkztat5Rj9SscQjyaDNwvMcnMPcUhHED2stTMqZiq62OeuSSip7\nWLIgbmxR43Cu8pjfnJxwNjdtzvGjnrwQ2vZJKfVcTQsFmOof5oP88v+N+nHp\nYZDVrZNXW6twjbp79aYUMd0UGXF9QhgXdRWH0r9Gu5UxPYXgZcTJqYglRdje\nVkXw\r\n=HtEJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCnOTP4XLaGqWDsS32wGA3ZxbSwCXbCkrTdJkUZNh/qtgIgJh5tpW6FrFpXreq/UhS5N4GuDBgzEvPi2kTuzVXJeuQ="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.ae4f422b.0_1626479642349_0.8307161031031296"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.90ff8057.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.90ff8057.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.4d95812f9.0","@material/line-ripple":"=12.0.0-canary.4d95812f9.0","@material/mwc-base":"0.23.0-canary.90ff8057.0","@material/mwc-floating-label":"0.23.0-canary.90ff8057.0","@material/mwc-line-ripple":"0.23.0-canary.90ff8057.0","@material/mwc-notched-outline":"0.23.0-canary.90ff8057.0","@material/textfield":"=12.0.0-canary.4d95812f9.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.90ff8057.0","@material/notched-outline":"=12.0.0-canary.4d95812f9.0","@material/ripple":"=12.0.0-canary.4d95812f9.0","@material/shape":"=12.0.0-canary.4d95812f9.0","@material/theme":"=12.0.0-canary.4d95812f9.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"f90c69a94171ac1d67bd6c3315ba759c0e2e79b7","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f90c69a94171ac1d67bd6c3315ba759c0e2e79b7/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f90c69a94171ac1d67bd6c3315ba759c0e2e79b7/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f90c69a94171ac1d67bd6c3315ba759c0e2e79b7/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f90c69a94171ac1d67bd6c3315ba759c0e2e79b7/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f90c69a94171ac1d67bd6c3315ba759c0e2e79b7/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f90c69a94171ac1d67bd6c3315ba759c0e2e79b7/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f90c69a94171ac1d67bd6c3315ba759c0e2e79b7/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f90c69a94171ac1d67bd6c3315ba759c0e2e79b7/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.90ff8057.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-FfyeDBqB0EhgrR8qWN4pxp+BmiCRpNdk7MUCPZeou36Lr1SsmM+acrcTaIe8X7kSzq7uRCVMtWNwzbrTsrRmCQ==","shasum":"688c8b5bf15d6c99d608a366159aa7faee5f79d1","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.90ff8057.0.tgz","fileCount":13,"unpackedSize":201265,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg9YcmCRA9TVsSAnZWagAAWxwP/09xbeCGYdwyUY9vVq8B\n9q1HqAgvHLq6Pv0XPCnL5EjoawkHWC+2UV3RnXUxuuSHXAT9FaFoj6fLp60Y\nPmLASmKTOOYhRHCH9SuvpzjZMCh4eL6MaSOx5jyiKIMOlmYxHL88ty0Xi/XF\n7jcRQQCsukDvwM8vegl97h+GGOhX56kzTLepAgK30e2mZLRtN5DEx3WZW6SF\nknMt0IJ5GydBvYDP9xg9ExJ7jZ+BR8cGdmQGtLEliO3oP7UN09a5D1gFRzE2\nY/LErNyyPIO2sCBifrc0aTOwuepZZYJaBLo7IQlJyfwIRhCIz74+GuZfS/Zq\nCsbIEF+bTQg8alevq5hBd4M2WQ5yJjlooLuvcUmn+k1zQphulx624I3Uqn/1\nV6l8yRfes0MhdlT7z6j/+tWjfbYb9O7hYO3Mp/T7n0L0t7CKtH8Nyju574sq\njRCO23spDxWDsasaTk/gLPKY6c8apXfEpeHE5qgmdH8+++BYFi8cCVBhmJpu\nJfWyw4SH/yx7krqZrJEwMYPzWwUr91l5nUyjuGYHod4PKbIsOXxDQ6/WObsB\nCNcVlVLhgt+0Q2PwBFw/uu0KshdYZwb0YPqYo0iYmQqjEpwy8TD5ART/XXVC\nMIZFr84FkPMCE8ZQFKdPN3yiZgttwmHNkoBulkIRnqJGaMhEFLZYSKl5/W+c\nFcbh\r\n=dsbh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCG4QJTMNa29fAZdXMvjpUhcICEoYjf/B5C55K8z265QQIhAPZD7J0HkADDjnbwZJO1nZTC56oFs32mXMxvx3Lt34c8"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.90ff8057.0_1626703653816_0.5551349943007684"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.dd7b75d1.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.dd7b75d1.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.4d95812f9.0","@material/line-ripple":"=12.0.0-canary.4d95812f9.0","@material/mwc-base":"0.23.0-canary.dd7b75d1.0","@material/mwc-floating-label":"0.23.0-canary.dd7b75d1.0","@material/mwc-line-ripple":"0.23.0-canary.dd7b75d1.0","@material/mwc-notched-outline":"0.23.0-canary.dd7b75d1.0","@material/textfield":"=12.0.0-canary.4d95812f9.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.dd7b75d1.0","@material/notched-outline":"=12.0.0-canary.4d95812f9.0","@material/ripple":"=12.0.0-canary.4d95812f9.0","@material/shape":"=12.0.0-canary.4d95812f9.0","@material/theme":"=12.0.0-canary.4d95812f9.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"b0752e4552aba84ad89d4eafc1a2a995bbfa0607","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b0752e4552aba84ad89d4eafc1a2a995bbfa0607/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b0752e4552aba84ad89d4eafc1a2a995bbfa0607/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b0752e4552aba84ad89d4eafc1a2a995bbfa0607/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b0752e4552aba84ad89d4eafc1a2a995bbfa0607/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b0752e4552aba84ad89d4eafc1a2a995bbfa0607/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b0752e4552aba84ad89d4eafc1a2a995bbfa0607/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b0752e4552aba84ad89d4eafc1a2a995bbfa0607/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b0752e4552aba84ad89d4eafc1a2a995bbfa0607/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.dd7b75d1.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-mZDPtpuDuXE2e5vjcv5ZZpX265JDRlJHD/K+bTvHyZJzI+UUQvWpCiP3t6mDeh7yt407HcE9mBPoYBXzPGsnsg==","shasum":"39c14280430a73879056aa7d7e2db7ed2f3490ce","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.dd7b75d1.0.tgz","fileCount":13,"unpackedSize":201265,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg9btyCRA9TVsSAnZWagAAc2kP/Rc7Phjuu8JbYFZLmCha\n/BeTKT6BZteQ36CgF5huPLw2ixc8H5rakMeqgJDNSps38i4XEnWD+Z+rcwyx\nmQrA04d2h6qutNO3fhctlI2ISQfo/rmGtWIVjd1SI965B2p1l/WQUh7tH8tz\nYq1CENsCbxlR1a0qhN1VyqXF7q2mu0fChR3EpIkHVadpn3Bucc763ozoAsHL\nseXYp9XNJuyAmmTzzVqIstgSKPpvnEbxBu/ryYQ+ws1+EahF5VTrD2dns2vm\nN69ewuygvhgNjtcqasLg4M6a1xhcRb5MOEjKNDButn9/OA4BF9EZDD/9mNzQ\n2UNoRLwjLo72DsO/4eaON8o2PxLmiD3HKIYlg2xqdRTFy3C/b0J/yboEWDRB\nUQ0lboRC5/L3KNbh6QDfNkv5hH670F6ITY7kok3YBPco1Ow7hQihzODap/Ev\ncz+1BQV+m0KVttRrECAQ1fl5fMi28rqMpuY0vD9/C/yRaljJpT/ah1kFh88d\n/DjHy5v+Q4VeCF8aufrmoyZpAXc/1QAT/BIOPI58TxH8GGs+HteE7fRAdMLl\nzh4RX/a5h801ofJgoAEN4biVMGgZwgvrFF/pduDS1oNgCdlwzrC63d+moZhF\nFz78rEvmLBb1pn1dYIILE5svWSPqKHXillQqClBG96cEoCCR4X2JDi84ZO1R\nYDPQ\r\n=qAII\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE1iVbJ6ODxBeH03bWmxo6rV3pT3YebRglmgLGqjmZfKAiAeKsAP48TnrfHBKZ6OmF5Hjqruk2x51U3K8jqEyBH0+w=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.dd7b75d1.0_1626717041907_0.4014339867635175"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.104debd5.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.104debd5.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.38d1846cc.0","@material/line-ripple":"=12.0.0-canary.38d1846cc.0","@material/mwc-base":"0.23.0-canary.104debd5.0","@material/mwc-floating-label":"0.23.0-canary.104debd5.0","@material/mwc-line-ripple":"0.23.0-canary.104debd5.0","@material/mwc-notched-outline":"0.23.0-canary.104debd5.0","@material/textfield":"=12.0.0-canary.38d1846cc.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.104debd5.0","@material/notched-outline":"=12.0.0-canary.38d1846cc.0","@material/ripple":"=12.0.0-canary.38d1846cc.0","@material/shape":"=12.0.0-canary.38d1846cc.0","@material/theme":"=12.0.0-canary.38d1846cc.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"9dde76584b6e4258f93d65b54a1f9695d2dddb1a","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9dde76584b6e4258f93d65b54a1f9695d2dddb1a/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9dde76584b6e4258f93d65b54a1f9695d2dddb1a/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9dde76584b6e4258f93d65b54a1f9695d2dddb1a/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9dde76584b6e4258f93d65b54a1f9695d2dddb1a/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9dde76584b6e4258f93d65b54a1f9695d2dddb1a/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9dde76584b6e4258f93d65b54a1f9695d2dddb1a/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9dde76584b6e4258f93d65b54a1f9695d2dddb1a/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9dde76584b6e4258f93d65b54a1f9695d2dddb1a/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.104debd5.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-9DY/Kl9sQvixU0HTsS0HXcUVnsMUy3saV0wz/bLeJ86gRG2+ui/yUtLuEDtbeYRmppUeXObydqGNfSq11BvHpQ==","shasum":"2b130902453fc3bc37aff0f8896e97155f0ef565","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.104debd5.0.tgz","fileCount":13,"unpackedSize":201265,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg9gJtCRA9TVsSAnZWagAA9tAP/RvQxDhzSRQmnSqF3u2p\nO21v74+fyNIXSjnuRy1OD7ePEaIVVO/qw9TuZjxirywd8ZwOM8M4rsKNibuH\nE1AIOZZzUzJmbfsop0Ftuk25NtkRZw6jN119qkETSFoz0+Pm7swjT5IUM33I\nTDwlJz0SLQ6hdgp29WJ7+AObuo1n/xG4D7xCzGbpq/P7cxJPvpxgUqSdcCvt\nkjT4WtyS9ns7xWcWbKRoCvLWYXrgiunlnJNuTZOuUBmLAV27GPxiEH3ggJri\n2PhEv4vY2ZNKicouejiTQtzqHFjxcoL17Q1SsL7bqSgqPAhzxjpDN1n/r4Ne\nOKACP4kulQ+09k8NaXxdT4tnA4V7Q739hSwstRNN0CL/UBLL4bZ4jVUAbZMg\nW1BehRlTRz6OcXwwzpQsqIKDiVPIbi5Uh0uZu636XScHIpiwpX8u6AhKF842\nMy88WMyWmgWGXITOwBdWld+ZkxrGRkHagp7lJbZTl1csfJa24xsaeXUHL/5y\n644AwWEkRccqqHbDcbZEXP9Hm//fRGDiQBJWdTPj7dMNHPn3id5GiQlAEe9m\nibXndC8XhQeJRdcR/1L5vpNbDp3JqRAyM1yWdeEIOM5Ewl3gsGASt3BYbnZV\n0YF/i3gYJU4tUQZtylDBp6ckhckJRzjRG9yzlBns++h75OiorfxsspdZbOGD\nfoDT\r\n=+KC5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAlg5Zv5QUN2A2mYRfwq/+ywWlyopfSi/HzV+Dz1dfPmAiEAhze+WXLrFREPbOAxQJ6b/ZZuvgEM/nRUX/AzvjTGJMI="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.104debd5.0_1626735213655_0.8020493529816441"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.4612705d.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.4612705d.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.38d1846cc.0","@material/line-ripple":"=12.0.0-canary.38d1846cc.0","@material/mwc-base":"0.23.0-canary.4612705d.0","@material/mwc-floating-label":"0.23.0-canary.4612705d.0","@material/mwc-line-ripple":"0.23.0-canary.4612705d.0","@material/mwc-notched-outline":"0.23.0-canary.4612705d.0","@material/textfield":"=12.0.0-canary.38d1846cc.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.4612705d.0","@material/notched-outline":"=12.0.0-canary.38d1846cc.0","@material/ripple":"=12.0.0-canary.38d1846cc.0","@material/shape":"=12.0.0-canary.38d1846cc.0","@material/theme":"=12.0.0-canary.38d1846cc.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"28f0176f44158c2fa7246b69d5737a09425a6e4f","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/28f0176f44158c2fa7246b69d5737a09425a6e4f/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/28f0176f44158c2fa7246b69d5737a09425a6e4f/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/28f0176f44158c2fa7246b69d5737a09425a6e4f/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/28f0176f44158c2fa7246b69d5737a09425a6e4f/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/28f0176f44158c2fa7246b69d5737a09425a6e4f/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/28f0176f44158c2fa7246b69d5737a09425a6e4f/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/28f0176f44158c2fa7246b69d5737a09425a6e4f/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/28f0176f44158c2fa7246b69d5737a09425a6e4f/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.4612705d.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-eQ23BZz18QsdbhXBbfwLuYP1VGLdOkE/FfBarBknXiE0oynFYZlU9EEHz9QLGsvp4mEXsc3jcnHDH7dJpPdCZg==","shasum":"f67678568d47bc9c6654a8f932d4a318fafab1e0","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.4612705d.0.tgz","fileCount":13,"unpackedSize":201265,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg9vQUCRA9TVsSAnZWagAAJ7MP+QBDP0Xm5N1h/eLq515I\n/MOjAaD8W4sUnjj9NJXQz9Vnv4AnAiXzEUMJpLYeoGf2WfNGLeSYJQNCMbON\n5JZ2zel2/pHqAQ+0qjvo8cvuCpFKFI7Eks3T3wbrm6jutD66JnYf18GMHTA4\nwFP2wLnPhvt1IZZ3+/6zBksre4VaLo6XSFYjIgGmgvNgPe8xlHvc4XvQGjEA\n3u1phDaKuox8RtKZTsxYIrxEJQfmlLyflCl7jEMrHpD92/uLlEQ1qCyZ+wpC\ntWX4ZV0Ee8TLUEikb/CBvRemRdfDMg/lcrQIh3JwPB+wogTa88vzyWBHZlRc\nERxUeI9ayWkWJzFHh/ZTs4zwYjzAKv/0gK+mjP4IHYhH5smmdDxdfi8QhzB9\n6+FrjJOe7GCmIUQGLPKGZGA7WicRn1btne5RBHgQtveqNFI84HgHqUXdKUUT\nv1v734AvZPA44JWaMrfP3ifUAglUInqgCorLqYI4+DmnNggiQhYuFHI4DKXz\n/4Cibn8LLsbqfv7n2sk/ydUi3EOTb2PKJtgqZqZpPnsl8lUiY5h+V5XiVFf4\nacyLyqQzN6VTEfAptcLoccr7MuiNJmX7Wl0OZmckVzl/HBzeewpLLc2jBucB\nIbrIrj6K7THVlIxIMOy9PqibhaYyw241nzAG/ssRomZH6lK8vlTeuIrnghzA\nVePG\r\n=fRud\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC4+rN6aYtS9JcNmbxrzPolmoEonbXmVTEWu5h+w2ixTwIhAPlLVfv52A3wP1dcDXCCMzah4NC6atuIrSwaC6CsmrLy"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.4612705d.0_1626797076214_0.7009604152621705"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.b36502a2.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.b36502a2.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.6b0442278.0","@material/line-ripple":"=12.0.0-canary.6b0442278.0","@material/mwc-base":"0.23.0-canary.b36502a2.0","@material/mwc-floating-label":"0.23.0-canary.b36502a2.0","@material/mwc-line-ripple":"0.23.0-canary.b36502a2.0","@material/mwc-notched-outline":"0.23.0-canary.b36502a2.0","@material/textfield":"=12.0.0-canary.6b0442278.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.b36502a2.0","@material/notched-outline":"=12.0.0-canary.6b0442278.0","@material/ripple":"=12.0.0-canary.6b0442278.0","@material/shape":"=12.0.0-canary.6b0442278.0","@material/theme":"=12.0.0-canary.6b0442278.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"1df0a9b6912d747311691d2320eb16519bf8c660","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1df0a9b6912d747311691d2320eb16519bf8c660/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1df0a9b6912d747311691d2320eb16519bf8c660/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1df0a9b6912d747311691d2320eb16519bf8c660/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1df0a9b6912d747311691d2320eb16519bf8c660/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1df0a9b6912d747311691d2320eb16519bf8c660/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1df0a9b6912d747311691d2320eb16519bf8c660/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1df0a9b6912d747311691d2320eb16519bf8c660/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1df0a9b6912d747311691d2320eb16519bf8c660/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.b36502a2.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-DT1SOiQWCpHB694+3d4tv2sW4UeIJABl82BAHi8/VGHvBlf8weMPlQGVGxiLOQ1mtsPZrxTx9ZWyt1nMwHoLHQ==","shasum":"7965e4470492bf9d0faf539ac54409a2ec04c600","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.b36502a2.0.tgz","fileCount":13,"unpackedSize":201265,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg+KD7CRA9TVsSAnZWagAALssP/jIdTBc5VWVvD2L+JbBY\nH/b3LrVGdJ6cFWD00RjVMrrLPJbFipo2ILsIOfhUfa+m6SFLw28SMCNn0kYn\nMu/nONmAbkwXrSLeNTrk/JEeulXk7jhKxjWbGLiwCNniTy3+6xQMNEE8I6tt\nJN0k3N3Y4mL9dOXRtjDXS8tmvmmYAKHy5TYWaUr2k+88EijdoNFqOHXHdRb+\nt8/5+updq1XFy/+m/+73TU5ETqWolO5Me/j/FirTa2k0z5uCkQM5Bk6GMK2S\n/QeQyu3JZVh53iEg8c4AhcxbXUY5ni9ZKzbwEiUL1kX9v1SDm1ajBiIevObf\nkPKnpr3mOzKC0U21NqmCP6YQI4NBwlnnw7DOvaKdsmmF+bWeq/elVGOvy+yx\nx5ee6zSYYrnN6FGWWOuQYh/6up39+P3QO6q49SDxAocj2xHS6M02P6Zc0p/e\n48iRoZSYbd5KY1PRq16kcl9Dvt5eJMmGjLlwkjYuum7bZlOD31sQYUYjWUDp\ntrzylbk8d8I+B1SqyCBe5i1jpYYJgc7zpebKawp18AI7UIzKfXXopKTpdfuv\nfOvPyAErPzMN+FyYc6jbMcD81xuS/OgKfd+VjL9+Umz0UwljzEEkjdfmsXiX\nJNQupi4DksdD+E8b7Hczk2CxAx9ocL51rXs2RUouBMP7IZv4GZHNyrKWrFiN\njm7B\r\n=UxLd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIET2+ZN7BCUwfBVfgPQDFM555S4UQE0HX6NY0EVpuTRJAiEA8/Q/4IzybC524otmLKGRSvrR80DbD07PpBZOtHA38+E="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.b36502a2.0_1626906874828_0.03507245229257183"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.2c392ab3.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.2c392ab3.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.6b0442278.0","@material/line-ripple":"=12.0.0-canary.6b0442278.0","@material/mwc-base":"0.23.0-canary.2c392ab3.0","@material/mwc-floating-label":"0.23.0-canary.2c392ab3.0","@material/mwc-line-ripple":"0.23.0-canary.2c392ab3.0","@material/mwc-notched-outline":"0.23.0-canary.2c392ab3.0","@material/textfield":"=12.0.0-canary.6b0442278.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.2c392ab3.0","@material/notched-outline":"=12.0.0-canary.6b0442278.0","@material/ripple":"=12.0.0-canary.6b0442278.0","@material/shape":"=12.0.0-canary.6b0442278.0","@material/theme":"=12.0.0-canary.6b0442278.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"83a61c9efee1610d42af318683fe4985effae0df","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/83a61c9efee1610d42af318683fe4985effae0df/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/83a61c9efee1610d42af318683fe4985effae0df/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/83a61c9efee1610d42af318683fe4985effae0df/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/83a61c9efee1610d42af318683fe4985effae0df/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/83a61c9efee1610d42af318683fe4985effae0df/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/83a61c9efee1610d42af318683fe4985effae0df/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/83a61c9efee1610d42af318683fe4985effae0df/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/83a61c9efee1610d42af318683fe4985effae0df/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.2c392ab3.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-VhB17S/o0sJFLdytYDLZMIUSOFH+wriybyKIBt5DSU6G7Axv5A/2m1pOD/bzYmYMP8QBtWH82paZB1OzLjY7PA==","shasum":"69b5a02ec8a3b0e5fe29f2b7ee44e72d1eba1599","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.2c392ab3.0.tgz","fileCount":13,"unpackedSize":201265,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg+YZGCRA9TVsSAnZWagAAXqMP/00Wz361YEMM7yptaPiJ\njQmK9bLnoNE2pCrujP754gO+xb/e48qbiBFRmGRNb31etAP6X8N9LSZLD+fM\nwQf2yWPq3r7bDtWVpLcecLQ4Z+dd7v/xmDaH30IGvbuIWWTGuAF83RLibXul\nKAdsPgAoCNekrn1feIktJwHGfCMZt6HtVpEIzMjzzuvyevjjC9J92EwXNg/B\n4VkJP3hXPQUXktsT1V51vNhkBvls8Urxc0zyd5xkH6j/dJQQgu75H9l+yj7z\n1h84K7OokFdTqSoAFdc/eeDeqUTbVWBa9P4+hI34G9NOUjtNvcCgNpDT6JfS\nVrCTDd62bXRGXuvee5ybScFIQdBIkRyBTQYruAo1zc+WhncOOytJX7U6knGn\nGUKPmhAWL3lFV7i1cfQV5jAGn1L7B55o3fJXjgv42IWy0YUySH1+/WDWUq0K\nv1Ak6dvaPCfCv/29S1GsnBiDv+3bJPvqTShw6TWq7aRav38eni76Zi/0u/Kt\nSNAIVpeg230otBA3DlG8gvMIw0B08ZmV5Qc6z22Bf9wpq1n5LBPFIHNdIguD\nk2S6LFZvRYlj1oth/g17qGAZJAobSY0M9+sFo0S307pg797TgWjX893h1RNd\nDHl8BgHRldnk/qrk+1HrOroibT9zWo1Pf3+55sLJOuuVaRD1EpqTJHVKjNJt\nL4XO\r\n=xQsy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDEgQxrBpRwG37AEh261S1rSLWfwlKnx2kPgTTe8CxeqAiEAivzozTmBwNi6HNg1CeKOeFiNDQsxooIZ5JCzgS95y+4="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.2c392ab3.0_1626965574306_0.9926768354632505"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.e8bac95a.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.e8bac95a.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.5f00e454a.0","@material/line-ripple":"=12.0.0-canary.5f00e454a.0","@material/mwc-base":"0.23.0-canary.e8bac95a.0","@material/mwc-floating-label":"0.23.0-canary.e8bac95a.0","@material/mwc-line-ripple":"0.23.0-canary.e8bac95a.0","@material/mwc-notched-outline":"0.23.0-canary.e8bac95a.0","@material/textfield":"=12.0.0-canary.5f00e454a.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.e8bac95a.0","@material/notched-outline":"=12.0.0-canary.5f00e454a.0","@material/ripple":"=12.0.0-canary.5f00e454a.0","@material/shape":"=12.0.0-canary.5f00e454a.0","@material/theme":"=12.0.0-canary.5f00e454a.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"2215253d0031fb9db27cec4c40894bd549b72930","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2215253d0031fb9db27cec4c40894bd549b72930/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2215253d0031fb9db27cec4c40894bd549b72930/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2215253d0031fb9db27cec4c40894bd549b72930/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2215253d0031fb9db27cec4c40894bd549b72930/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2215253d0031fb9db27cec4c40894bd549b72930/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2215253d0031fb9db27cec4c40894bd549b72930/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2215253d0031fb9db27cec4c40894bd549b72930/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2215253d0031fb9db27cec4c40894bd549b72930/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.e8bac95a.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-ww5vhyvcvAns6S61JAUtv/oArpioXjptCQ8DqyXuN/1cI65cNtY/hrTZKLCjuTU7sB75en3uvFSxV9wERwcaQw==","shasum":"ab242e8f3d8b20e64c5f22abe5d5fb05bfdeafb8","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.e8bac95a.0.tgz","fileCount":13,"unpackedSize":201265,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg+b6ECRA9TVsSAnZWagAA9L4QAJQpiSCjXFCpE+KQ8kQS\nUgAf7/vVbQ4L+AkQbzTeNv1V7BuU5ju9EClpHtfx4wIzfWdDyI7tHK0UvBRk\nrCx9yRkIifSdM4wxXuG4G4kiWi19T26xNQa4SeDUPFCnRlORfOjH6NluwlUc\n/A3QszSBsBSVS6qVkqI5KWE1wvN/6jEEbF7p9M3BRtQxZUCR5w4/kYGt6nyN\nhBJb7cFLuzL87Rm2Zv+CUCbaRr2CUP+B32lYScop1K4bgipYUCY4YklQzud4\ngnDeqRvbvPEgDN8mPOxbhnk5FtEKNJMFkicEyqHACzJQSoHf98eHfQjerIWW\nfJ4cayX99qVtf3Yon6vDA/d/EdUGfNHGehEepxmsgXX0yv4v0D/JmjY/QRW9\nRV66qzqHonow3qJcIwTXSDAGlshLE56DBLUrFcGkojycXINEDZqB14p88lin\npDMMPYkyvp161nTTc1XFmUTPm1WEYCxXYD2XJ/iayt7+DYDogleC28kTPlhC\noLMXteupfK2yrAfVhpXCd9fkb0nZg+ecFMaFFXWciJSgJcESaduDKBDMlEJP\niW6jYw7uVMDvFS/NUwNbhqfVOvXuH1aFdC0e1W4ueEAT4eP9sjCGFKFyValz\nBxDeuwRRok+8cs+yZ2i4Ie19A5L3FKEeuZUtwF7piElF/Pc69WIijckxvgQ4\nLI42\r\n=8+0W\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCqe7J08FndJfi2/5vZseOU/4TpcTHaLlbm6X5Q4tC9rgIgVpR81XeaZP9jl8VpTPNR0+AgG+A8brj+zInBsFpiWFw="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.e8bac95a.0_1626979972447_0.8695710927008822"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.38f29f8f.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.38f29f8f.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.90e08fc6b.0","@material/line-ripple":"=12.0.0-canary.90e08fc6b.0","@material/mwc-base":"0.23.0-canary.38f29f8f.0","@material/mwc-floating-label":"0.23.0-canary.38f29f8f.0","@material/mwc-line-ripple":"0.23.0-canary.38f29f8f.0","@material/mwc-notched-outline":"0.23.0-canary.38f29f8f.0","@material/textfield":"=12.0.0-canary.90e08fc6b.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.38f29f8f.0","@material/notched-outline":"=12.0.0-canary.90e08fc6b.0","@material/ripple":"=12.0.0-canary.90e08fc6b.0","@material/shape":"=12.0.0-canary.90e08fc6b.0","@material/theme":"=12.0.0-canary.90e08fc6b.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"484fc84b540f757ad561dbea442c8566694496a9","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/484fc84b540f757ad561dbea442c8566694496a9/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/484fc84b540f757ad561dbea442c8566694496a9/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/484fc84b540f757ad561dbea442c8566694496a9/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/484fc84b540f757ad561dbea442c8566694496a9/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/484fc84b540f757ad561dbea442c8566694496a9/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/484fc84b540f757ad561dbea442c8566694496a9/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/484fc84b540f757ad561dbea442c8566694496a9/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/484fc84b540f757ad561dbea442c8566694496a9/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.38f29f8f.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-0y6/jgyei6jV3IoubxJu0CjK7zcJ+rJF/ohpGhXQ08WaEQwqBb3DE5iOW+5f3k0pzl05SHs+GLII6rA9sbkyyQ==","shasum":"c303e8d9956a9e258c3ec4c7f3579d4ec38da936","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.38f29f8f.0.tgz","fileCount":13,"unpackedSize":201377,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg+wdhCRA9TVsSAnZWagAAqecQAJE0BbxfBuded8SegIaI\n62gAT8djEius98rRdKQqX6TJwlkeTf9UtS6p5gT+SoSkJchWJfYxZNaSALxP\n3ccupjzQUCWuI7oYLKVlxTlHSxuN/JutSJeFzxcMyA3LpsjWJ8YOfODDayL5\nbOO94S11kJTainMVOXK6CbV8gLU1iI6AfFk/tz/jtEH6eG9NZvLNEAvTVQib\nFtT6HaAF0c2augwdVCKXtSawGsmOwELrqEK4NVSTpb7gX2SKPgxjKMXWxTOe\nkcmFVWWlc+g8whoJMaLtcd1zL9vOn0b86VQ24K8suELO6l7/HBRVXXzAM1zm\nQ4oz99ZmuZS84oAC4zCWjBZ1geYFHHZtbtITI3moFwNgShcZpqMSLmwPtM/G\n0p+skCnIOa4D+Mnm+/mJ7aQ3Wyd/tA44zYrTtq7b9Kcx76CNEC9D3lECiucb\nVC98Hy43+YI0t7bqREFTV8HwelU6XFsctE7J7twMyCxXAAF0opFXOk4q3jlX\n4YnGQAIRaulNLpyPGcl1P7iy19FCxTw5JLQangSCyE8zZr9HZby6dpCvaFZx\nLj18WG1P+r7hZZSgoklBVtKpK2jfa+EDv8qAKARLehAlz9mRvNrA12BZLT+D\nWwyXjmr7JawSF1kE2m/IkUgqnSaH7p25PUYlARNGpVm135Z8gPlpYSCPUZAN\nQcW1\r\n=drqe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDZIB9sROyEg/eeU45DQe5IWU4WJkcZgEuGDa6ezD0QZgIhAIwfrGfqlrM0VuglX7oqw5pj0ObIsKxszMjOmV8FOXjj"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.38f29f8f.0_1627064161373_0.9461637680868136"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.e0693475.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.e0693475.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.90e08fc6b.0","@material/line-ripple":"=12.0.0-canary.90e08fc6b.0","@material/mwc-base":"0.23.0-canary.e0693475.0","@material/mwc-floating-label":"0.23.0-canary.e0693475.0","@material/mwc-line-ripple":"0.23.0-canary.e0693475.0","@material/mwc-notched-outline":"0.23.0-canary.e0693475.0","@material/textfield":"=12.0.0-canary.90e08fc6b.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.e0693475.0","@material/notched-outline":"=12.0.0-canary.90e08fc6b.0","@material/ripple":"=12.0.0-canary.90e08fc6b.0","@material/shape":"=12.0.0-canary.90e08fc6b.0","@material/theme":"=12.0.0-canary.90e08fc6b.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"dcaa39c4b4b0d5d5bda85df7a11ac1205f2fd669","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/dcaa39c4b4b0d5d5bda85df7a11ac1205f2fd669/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/dcaa39c4b4b0d5d5bda85df7a11ac1205f2fd669/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/dcaa39c4b4b0d5d5bda85df7a11ac1205f2fd669/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/dcaa39c4b4b0d5d5bda85df7a11ac1205f2fd669/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/dcaa39c4b4b0d5d5bda85df7a11ac1205f2fd669/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/dcaa39c4b4b0d5d5bda85df7a11ac1205f2fd669/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/dcaa39c4b4b0d5d5bda85df7a11ac1205f2fd669/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/dcaa39c4b4b0d5d5bda85df7a11ac1205f2fd669/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.e0693475.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-/NGG8B1TmWadtkYQnq6SCPuBwyAS3rthchei0oDZFV9ANxRvHPWXIFkVHHwHBNU9rjpYppkp8BUrbTEQLC/KbA==","shasum":"f85f68abf6cc5ece5d338a2b39b5c08dc2575eb2","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.e0693475.0.tgz","fileCount":13,"unpackedSize":201377,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg+xDKCRA9TVsSAnZWagAA3fUP/i2+Cumrb5EvnByxFtYC\nBNhogBxScOlTTg998/WwRjxMM7TMEX0Rkf22Y7++ISwbE/D39JDmAvREIkSr\ndH+tQGy0XkbU5Bl+hobB4yDPSoJvC4nvVm/4EsMAQYCvcK1++l5h7Zdp9d2A\ndR17hj6A4C3xwPqWiSf+nsb2RzyPyV12kvFcdO5VIIXA8gOj71swcf3N2T+1\nsndl0QaG7ekW6GcSZnSIEbysbWpBpxaR3VWKoP2M1RlEO8dtpZ2MdCjzeLFO\nyDcA7C/dU6d7vSDpS1xBV8X5I4+gtbSP9OFdh8ICPlxUnqJYCIdjpgWL8787\nHUh1iYZW9oPHk6/VOpT7YWvv9VDg86BHH2SZ0AkEVBXTaUWT412W/WA6JqrF\n86cO+2zQeWSXE/41SGhQug4P56H5qLfRqbccEglVv6sQ7RHpd3OUpEKt2nIq\nalDrjMIEYkO8l72FMM4YILaEG5fTPPvrnSeUs5F6JMrvduCYfXWVMUNaHZe2\nc9td8d9hPdteMoQB00YCeu5gxSejTGh1uXSxSOqf44opIPog50WFgTyezjvQ\ngKfwz+zqVPGthfK2HrsOC4F93XukSGa9nnoi3ZStTA5hhN3N6HTtVLRDDB1X\nVGZKXWLX2wbqDI6Jbcsh9g2VaDj+MpGVdBOFGb32Hll0zf4GUDZYVNx+sg36\nln4m\r\n=HH7S\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF3/0kIXJ45AkltciyhBJWu7GOnDYHBEeoRcEdxQ4uxOAiATPFONmGhAMolNnJJPlpJ/Wl4J90qFqWMPzyAz8C35DQ=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.e0693475.0_1627066570498_0.4495874991482083"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.d595e030.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.d595e030.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.90e08fc6b.0","@material/line-ripple":"=12.0.0-canary.90e08fc6b.0","@material/mwc-base":"0.23.0-canary.d595e030.0","@material/mwc-floating-label":"0.23.0-canary.d595e030.0","@material/mwc-line-ripple":"0.23.0-canary.d595e030.0","@material/mwc-notched-outline":"0.23.0-canary.d595e030.0","@material/textfield":"=12.0.0-canary.90e08fc6b.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.d595e030.0","@material/notched-outline":"=12.0.0-canary.90e08fc6b.0","@material/ripple":"=12.0.0-canary.90e08fc6b.0","@material/shape":"=12.0.0-canary.90e08fc6b.0","@material/theme":"=12.0.0-canary.90e08fc6b.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"7c8056c080cfa8a28ca6e2a5511b4db50a604a87","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7c8056c080cfa8a28ca6e2a5511b4db50a604a87/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7c8056c080cfa8a28ca6e2a5511b4db50a604a87/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7c8056c080cfa8a28ca6e2a5511b4db50a604a87/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7c8056c080cfa8a28ca6e2a5511b4db50a604a87/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7c8056c080cfa8a28ca6e2a5511b4db50a604a87/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7c8056c080cfa8a28ca6e2a5511b4db50a604a87/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7c8056c080cfa8a28ca6e2a5511b4db50a604a87/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7c8056c080cfa8a28ca6e2a5511b4db50a604a87/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.d595e030.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-M21BVfR0iEZvtXMWj2NC+1cf3jjmpjF8QtvjpmcMeoSy+SqqVmbg0LR/seQLdTGl0Dm5qgmaffawTnvrSnekPg==","shasum":"0d563a85e1977433115f29814ebe1b09b42ef39f","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.d595e030.0.tgz","fileCount":13,"unpackedSize":201377,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg+yw4CRA9TVsSAnZWagAA9P4P/342sRr5TCQDO7/22zK1\nDvi7MF2TwLXeJbjbgz+RswCoH4rpayNGtqRCGnnP0O+6Yn83DLzkQwINOToB\nRNMg9O2ncUgMJy50nZVvfP5Yhp148wG/UA3mLgCigAkn+jcnxZdCSF9V/pOf\n7i9NUBwjwoTGp8gZHN4kBxgQXYdHLkT2eXVP63WzZhh83HEvUF9QbMOznzck\nRPpjysO0hLs7ZVdb7ssuYx7C+Hs9+GMtdcLq5V8xmscghNtR6iHYeFZVc76h\nk9bpF+C0yMw8MJMrLpjTWTW1VxKMGQZEZWZmNx2slgIs9EJ54WM3mfEKB/KC\nzfW4Mm98h0Ln4+QDQfXCL/Y0/vOmxTe6oqWVgzAf4vOXcpeqhnOl8RvEPbxG\nuc2KMcmfr8yjDhL6Czq3WXdHiYYRVKJO9tMg0hycrRSzfu6BaSU29kIDDjNe\nHOVLCCf4mJqOSgWrbkpOybVsSIntwFfcslcZoJwpuDh3lUS9ucbmkRxhzlJL\nT3OWzjaOoUeiSMCwOmpqmiDr//fUlktvRW2UbXRqKVtty8v0Osamla/ejSmR\nReHXxMxpbhOxYOR4La/EJ0aLpOiWDBHty0ekCmYRlJUMTznTz1YUhmYVP+l0\nQ16HqpVdVsmu98YB1q0pZkSyXrwEOaoNkzhpWblEOeUEMBDqBeN4tgoEryGB\nC4Pp\r\n=hHOo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDjZMYAMbZa6z20fArJkzSr4LWHYVJPlO+SFwCYcFtIdgIgbZuV9kNkqhHLoFjivjxCiAuOUJvZ5Jr9lMmm+XO3uYM="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.d595e030.0_1627073592601_0.4406580051753435"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.fe7cca31.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.fe7cca31.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.3f36ac75c.0","@material/line-ripple":"=12.0.0-canary.3f36ac75c.0","@material/mwc-base":"0.23.0-canary.fe7cca31.0","@material/mwc-floating-label":"0.23.0-canary.fe7cca31.0","@material/mwc-line-ripple":"0.23.0-canary.fe7cca31.0","@material/mwc-notched-outline":"0.23.0-canary.fe7cca31.0","@material/textfield":"=12.0.0-canary.3f36ac75c.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.fe7cca31.0","@material/notched-outline":"=12.0.0-canary.3f36ac75c.0","@material/ripple":"=12.0.0-canary.3f36ac75c.0","@material/shape":"=12.0.0-canary.3f36ac75c.0","@material/theme":"=12.0.0-canary.3f36ac75c.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"45bb0797db4a64851859f8894864015974863643","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/45bb0797db4a64851859f8894864015974863643/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/45bb0797db4a64851859f8894864015974863643/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/45bb0797db4a64851859f8894864015974863643/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/45bb0797db4a64851859f8894864015974863643/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/45bb0797db4a64851859f8894864015974863643/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/45bb0797db4a64851859f8894864015974863643/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/45bb0797db4a64851859f8894864015974863643/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/45bb0797db4a64851859f8894864015974863643/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.fe7cca31.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-jypP8WMTpyXv3xFoCyfAxA6HEfvD5qgGGyph3bhFvXCEUlNfnOy53GiPRfv8CI2inic38aS9HKRgPdGgzwfc8A==","shasum":"003bf55cdfcb54eb55c71df003933740ddba56db","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.fe7cca31.0.tgz","fileCount":13,"unpackedSize":201377,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg+zseCRA9TVsSAnZWagAAkmUQAI8ZbF984IMGaRFcEQCU\n7PcezaydQvkEzkCI3EE6BtL1Jp7l1MoikXCA1ALrYtWLjmh1xuBkvrpCBRMz\ncTd1iSx+Fza6ev4EBbSC+gLlCNv8GW24cTy9vyjHQrgzTzzrNwqOVUs7k/sE\nz3NKhZmah/mwtgyy+dTc/Sl2n7ESzT7tWZG7kwr/FIN8KeWYw7vErPd6WeXM\nMalwlexvIFf8GfRjuh+fJU1OnWH9oTCYsPNHv27FVJ3ZVmM6t99W3LYk1Uz+\n9nqHEG37O+KAqZzADQQJ7pcX/wMKXf38buDeAlwxH9IP1vI0HUUVewy9J9EE\nyb6HHWWoWU+M9S94eCeZYKi5WJ35+EZaI/uOWwBiOjwJ0I4xvDYq8bcNZPMN\nWbbwX/AcDgZ35IULdkSjaHMtiXy6VpYMu0wop5nipig81/vWj083aZCUtTid\nWoeUy9PhIM7D09OvcJjjmz973Iu8q5foP1f2fA/00yshLCgNrlhvwOK65XSu\nuWXkPmqZlirKgQN0dPU85CezXLJ1XMo6aOibU2iT/xo3ieEnJPKfIqxhmZwE\nJMYz71CnHL3GZlXcCqrCRGbmzSSgRvzE1T/1DoOIGuX1pUQlSC8l8F5lsQMP\nNfh3dfmGEbcixLhEHgZKVRkheUsqv6F0PzQzbbdmrV7zZN2RWXHDnBTZ5gls\nHWik\r\n=nu15\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDSv5NqCUi7FQUEst3SyFCAtOmDOIG02zKYohZcU9yN7AIgOL7OABLts+hK9R/rd+k6i5vE0AtrGp/K1ZEqetb3I+4="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.fe7cca31.0_1627077406745_0.9322877772140832"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.fd9da483.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.fd9da483.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.3f36ac75c.0","@material/line-ripple":"=12.0.0-canary.3f36ac75c.0","@material/mwc-base":"0.23.0-canary.fd9da483.0","@material/mwc-floating-label":"0.23.0-canary.fd9da483.0","@material/mwc-line-ripple":"0.23.0-canary.fd9da483.0","@material/mwc-notched-outline":"0.23.0-canary.fd9da483.0","@material/textfield":"=12.0.0-canary.3f36ac75c.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.fd9da483.0","@material/notched-outline":"=12.0.0-canary.3f36ac75c.0","@material/ripple":"=12.0.0-canary.3f36ac75c.0","@material/shape":"=12.0.0-canary.3f36ac75c.0","@material/theme":"=12.0.0-canary.3f36ac75c.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"fbed5ae8e9a1f66ef1cd5e83dcb0db11c6ea3c01","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/fbed5ae8e9a1f66ef1cd5e83dcb0db11c6ea3c01/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/fbed5ae8e9a1f66ef1cd5e83dcb0db11c6ea3c01/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/fbed5ae8e9a1f66ef1cd5e83dcb0db11c6ea3c01/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/fbed5ae8e9a1f66ef1cd5e83dcb0db11c6ea3c01/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/fbed5ae8e9a1f66ef1cd5e83dcb0db11c6ea3c01/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/fbed5ae8e9a1f66ef1cd5e83dcb0db11c6ea3c01/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/fbed5ae8e9a1f66ef1cd5e83dcb0db11c6ea3c01/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/fbed5ae8e9a1f66ef1cd5e83dcb0db11c6ea3c01/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.fd9da483.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-QcypB3ZRcKciSg83zbbahNPx5HnKt1NPbfq/B2lSFVSmtZaWV8gwkO77sV4gCog0y4wQCWya8gP1hK2PChxCVA==","shasum":"3fa91f143f4e7cf8ac290b09071a1b57476113a9","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.fd9da483.0.tgz","fileCount":13,"unpackedSize":201377,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg/ygiCRA9TVsSAnZWagAADusP/2cM3djzaYfvOtEG2poP\nyZ/njwQULaQZqL2NlU9bcz19TICUoi9XwEyxnf8csec0hgNNxBKJ5LZNF2lj\nLGO0BqvUeAZt8RyO5VJLPDMpO6+uV9TbFaZ46hfOSHpC4w8OLPlB/7OPtGMD\negUGixwpA3i+2+0oWnjS7899EZeTXOkx91luM46/dsILjUOufcSO8aq+nW8R\nAYefG2renTlCtRXwTHnU2WOVFJmwW4AyZB+R1sNR5QcNRsfOiGHRXLHrtp+c\nYMqBtgwfBaZwuFKDikVdNjrPywP49s/tMBSjNKtnXXW0Xzy56bikQuDA34bS\nSIo8v3/Dy6WY6+y5KU3D0oLwSk5S1IQSHQMteugLs94ValGn1D37CDXlihcH\nOtnecIfetlpYbjbikvsqYOWvFtH6sg4OKqTOm9SUShklM29wOqaWvCWxoEF/\nB58Gp/FkmxVuE/htq8IayIUH7d1M5C5I5FoY0S2PJIKGb7H93zesgwe0Q3xr\nDLyNV0f55V1kesK5vALUnPMh1/ncbeGf6roJZtdgl/ptHD6B1bYr1mCTvbXK\nXuYSzfImmWEkg93qZJrYzVWzbxwWdrPRKuzKxKxwgMQNSdKnokTg/VDlgzH3\nxu2BwrWakcAaxWU9JCdJ+oYHDd6yU+YX/UX0hIhQvWWTU4u+ShPbRNqktLDK\nbvZb\r\n=ALZV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCwdvo4pWPfayuv8TtMCgFwro12mahAvoUirMctG1rmbAIhALPZq9pIAdlWpVFgGS3d/ksDj5KVCRDZbS8HTygcc/qv"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.fd9da483.0_1627334690745_0.4883515632276634"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.8a4c7e06.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.8a4c7e06.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.3f36ac75c.0","@material/line-ripple":"=12.0.0-canary.3f36ac75c.0","@material/mwc-base":"0.23.0-canary.8a4c7e06.0","@material/mwc-floating-label":"0.23.0-canary.8a4c7e06.0","@material/mwc-line-ripple":"0.23.0-canary.8a4c7e06.0","@material/mwc-notched-outline":"0.23.0-canary.8a4c7e06.0","@material/textfield":"=12.0.0-canary.3f36ac75c.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.8a4c7e06.0","@material/notched-outline":"=12.0.0-canary.3f36ac75c.0","@material/ripple":"=12.0.0-canary.3f36ac75c.0","@material/shape":"=12.0.0-canary.3f36ac75c.0","@material/theme":"=12.0.0-canary.3f36ac75c.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"4c98d35e959f2149e2a4ca8c8a4c5a7ad3070670","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4c98d35e959f2149e2a4ca8c8a4c5a7ad3070670/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4c98d35e959f2149e2a4ca8c8a4c5a7ad3070670/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4c98d35e959f2149e2a4ca8c8a4c5a7ad3070670/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4c98d35e959f2149e2a4ca8c8a4c5a7ad3070670/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4c98d35e959f2149e2a4ca8c8a4c5a7ad3070670/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4c98d35e959f2149e2a4ca8c8a4c5a7ad3070670/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4c98d35e959f2149e2a4ca8c8a4c5a7ad3070670/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4c98d35e959f2149e2a4ca8c8a4c5a7ad3070670/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.8a4c7e06.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-+K/xdRVote7jVCAzWyN6sDbFTKv/TDWV6DnMePDp8TGrfWORFJVU7NcTKjUz3VH8vnOlt2fhXU2AqexL6+xAjg==","shasum":"eeef655ee646d388407c13f62537468601174e7f","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.8a4c7e06.0.tgz","fileCount":13,"unpackedSize":201377,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg/zq0CRA9TVsSAnZWagAAEJAQAIG17m3cLdy6rjUivj43\nH5j7vJQ6L4w6FbxGf5+2ar5+E1xZhMFca/UXWWV8mD8YEchFtoP/mWIfj32D\nor5JisucRz+HgDXKicBbMFmZhc6yuqLZN8jwNN3KH/2SnQ939vHFyZsHznZy\n1RzKeEUicZp+DnS7w2m1AahhlcuejcZDLMyanbWm9JRLIIFuJz+J3GhYlK+k\nFVt3nxzwBElsWd+NgNwPEMf+ltRZVDaB+4JFFPyC5TcCDKxGeElKwNs1zQQQ\nFgkMoV2t6LAdV6f9mv8xaiWsOYI1c56Iiv+SdozSzWCqtSZSq7YEs43OKXAx\nwVuNKvOse/rMfEy1eF0rwHvbjj7vfAcka3s9njJ0tCDo0IaiTeAvAnxS4+F8\nCWxguXeNflHlcZX7SwvwqQBCWv6mq07VcLLg3OkTsTGU990xHi4HeSdQL1IE\nUujFzVp3MZIOzAQccyYlK0RbqjY0oZKNOYgf+/vT/oxxffTqxCoDHLDpRcE0\nNtPi4oDTeGnBrv/pc6VZZTsPTcxosIzmdBH9HwqEfcNyHPn7vndmIezkYp9p\nSaICcph30wjQcR3AKcSMvUE4LfVq47X3iFmrVEUsDGTyzmf9KUn/nuvHXmtF\n3siXUks0kxgpr98/zVZW2bDMV5cPI4AQ+rWApN/3lqCKmJo0mcpVARrFg4fC\npniT\r\n=h8+h\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCkMdCzMIWq/KtfiH6Sd5JrdUU20sJ/sSDhswAIaVETyQIgMmF3n3ViVoTVd3gYbrqHYtgPE+wys8SkjNx/bcUXIdU="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.8a4c7e06.0_1627339444201_0.8533904020418621"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.5b395fd1.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.5b395fd1.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.3f36ac75c.0","@material/line-ripple":"=12.0.0-canary.3f36ac75c.0","@material/mwc-base":"0.23.0-canary.5b395fd1.0","@material/mwc-floating-label":"0.23.0-canary.5b395fd1.0","@material/mwc-line-ripple":"0.23.0-canary.5b395fd1.0","@material/mwc-notched-outline":"0.23.0-canary.5b395fd1.0","@material/textfield":"=12.0.0-canary.3f36ac75c.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.5b395fd1.0","@material/notched-outline":"=12.0.0-canary.3f36ac75c.0","@material/ripple":"=12.0.0-canary.3f36ac75c.0","@material/shape":"=12.0.0-canary.3f36ac75c.0","@material/theme":"=12.0.0-canary.3f36ac75c.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"49947c20a93de615b923efcb7d30a23250ea6dbf","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/49947c20a93de615b923efcb7d30a23250ea6dbf/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/49947c20a93de615b923efcb7d30a23250ea6dbf/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/49947c20a93de615b923efcb7d30a23250ea6dbf/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/49947c20a93de615b923efcb7d30a23250ea6dbf/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/49947c20a93de615b923efcb7d30a23250ea6dbf/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/49947c20a93de615b923efcb7d30a23250ea6dbf/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/49947c20a93de615b923efcb7d30a23250ea6dbf/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/49947c20a93de615b923efcb7d30a23250ea6dbf/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.5b395fd1.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-QVO9W4sfpj+8YH8XqoE+w1Fty2vJQUw6jWF8SiEg+IMoyHK+ZzgDQ6GQjKeD/A5aVvXez98PRQNMEFOjy/SCzw==","shasum":"271116607f63861414c566ad06e1ddc3c06ab1c2","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.5b395fd1.0.tgz","fileCount":13,"unpackedSize":201377,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhAI5RCRA9TVsSAnZWagAA5DcQAI69+emLmJgGSntb8dpP\neCRonvbDC+UQHRCim5STZbO8LfKDviHE3Qc+ETWsbQHDCb7KqKbLTM10cdpY\nPQ2pUV8DvbDX9BZT7KsZWh959XuFf01odyoJO2NUPEzb4RDdnS2rMsVT3QDa\nhiQIWP8Lmy/E15nikw1pYymN97x1LUp2okyqdjLxP8Tnq3Q3kFAqDlPcL6Ae\namJhUvBTJov5YNSnHSsrVAmL3QDK1IHoJu3lLhewS4paJmZ5Ro4eyf3v3Lkx\nb/V3oG+Vvmmnw+eahWz3/AhF8yXXZbHfC8se3pM9CYbzTgcw8xFYbs60dQav\nkGRjdv//wfUTeBJNJkp+00M5NWmVEYR4tx9ilarrb3aNN83uwtNT++gLUUd2\nHHx29N4GHaQ7fz/0iT+/DH6qOQnA8OCu+LqJWnMMdebarOf5u662BTbP0avF\nlTnElFrlLVFXz6Dw2pJER7fJTicco92nq6kBdXQQy6mrh5vFYrvSqbEJWd/W\njtqIDgZ5JD17eFbVf/lllWEL9+anE60sdsdwCDbBYaP4IM2QSJX6z2Lm45XQ\nQnt3Urqj+q0eEJeh4aEH2iviwDoMalqx5S18YuHDUZtWNqTrD8z05XBgRBaF\nvWy4vR9GV7MVo42ca41bOvTezvQHYyuvOPbq7gQekqMRTxDP+cfakzQm4YWH\n0Gjl\r\n=m3e5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBdOCFadm808UlqfqXSBl/nKh65T5GcfsM8gjQc25VqgAiEAnS1pQC87l25F0N+coKEi0S8F9NeaTudgUJFI6YeZtlk="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.5b395fd1.0_1627426385712_0.7788492875871671"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.e5efdcc0.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.e5efdcc0.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=12.0.0-canary.3f36ac75c.0","@material/line-ripple":"=12.0.0-canary.3f36ac75c.0","@material/mwc-base":"0.23.0-canary.e5efdcc0.0","@material/mwc-floating-label":"0.23.0-canary.e5efdcc0.0","@material/mwc-line-ripple":"0.23.0-canary.e5efdcc0.0","@material/mwc-notched-outline":"0.23.0-canary.e5efdcc0.0","@material/textfield":"=12.0.0-canary.3f36ac75c.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.e5efdcc0.0","@material/notched-outline":"=12.0.0-canary.3f36ac75c.0","@material/ripple":"=12.0.0-canary.3f36ac75c.0","@material/shape":"=12.0.0-canary.3f36ac75c.0","@material/theme":"=12.0.0-canary.3f36ac75c.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"6ce7c9ba42d6630a9af68bb580b94e6fec508bdf","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6ce7c9ba42d6630a9af68bb580b94e6fec508bdf/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6ce7c9ba42d6630a9af68bb580b94e6fec508bdf/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6ce7c9ba42d6630a9af68bb580b94e6fec508bdf/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6ce7c9ba42d6630a9af68bb580b94e6fec508bdf/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6ce7c9ba42d6630a9af68bb580b94e6fec508bdf/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6ce7c9ba42d6630a9af68bb580b94e6fec508bdf/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6ce7c9ba42d6630a9af68bb580b94e6fec508bdf/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6ce7c9ba42d6630a9af68bb580b94e6fec508bdf/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.e5efdcc0.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-VsLOYTAJg96+HdjH5+kmbdTdqCcJPNH841udzVXPN2Pe2TPrnEn1ASd+yFgdn2hKsjAoetfp/JnKHXQSk7hxhg==","shasum":"f20ebe422a154510e6d882ca3598323cb3e5eba9","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.e5efdcc0.0.tgz","fileCount":13,"unpackedSize":201377,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhAZJQCRA9TVsSAnZWagAA5LQQAJsDEJMeTwm23rTmKXSL\nOz6RCjVdbGsvEFqe2PTjuC8YHAI40Tx3MxeBzsGLkYbwGc6UBN/ayeIJl7TX\nuDAuvhvOVYSUXNKoTEi7LG9v1FArKJwvKNoh/j+iJobTjL1kDjlk8PcY/irX\nvHSfoZPMbDrrYg4rKjCxiaJS9oVEu4ZG1Nj2EIWKnHcBEf+fRYBXd1ai7HwI\n0FyWF0jRlluvn+MdLQ+GuSRg9DZgxhQzVEdS7D1MPAcEpGnYYNC2jMyb4YGq\nF6DC3kDKIbJIx9YGhEGVpgQePy7D2VFMjZ/KrCvN3+reQGFLtsGSvZv54D/N\nb+ycDZ/g7GXtERo2d7O/qLPsRBlUNp1qrVPeDNaz5awf/kg9LlAAv3l9/zx+\njdznkKoMTrilZ0YCGM4qpLQgpI8vto0zaP6ROghYzR7Ut8zLJ7q/WCpwEy6B\nxu1l62+hMhk3guPoRitJvkeyL/uVl12HlJD0o02XzdBsR5w3801l4N/tWqoK\nYSE6RD6rV1iKpYcMREIeD9KEuesZRd4hD3JzfPqWTXbFI/baOEyys/WilFO8\nc8bEoFB0bPk42+PBmhmhFQcorisTaiSX4fgheBtBMZWVp8l0sEvNltkLqRy9\n9rTeRi8IalUhGj3nBtt8yMgfvp1HA4S9+jRsMCRoY4V0DiuL4pzQUvqcv9YP\nyc3E\r\n=lpJn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDrcR+vA011egtZstW9ClmX5ltbeT3KxiqFPWjJPiQZNAIgR+W1ozXpJ2qBNpEjrkW0Q9tVtGN97zP9SyDmTiFkMmM="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.e5efdcc0.0_1627492944365_0.007557042645303325"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.ab310900.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.ab310900.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.ae85f7eba.0","@material/line-ripple":"=13.0.0-canary.ae85f7eba.0","@material/mwc-base":"0.23.0-canary.ab310900.0","@material/mwc-floating-label":"0.23.0-canary.ab310900.0","@material/mwc-line-ripple":"0.23.0-canary.ab310900.0","@material/mwc-notched-outline":"0.23.0-canary.ab310900.0","@material/textfield":"=13.0.0-canary.ae85f7eba.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.ab310900.0","@material/notched-outline":"=13.0.0-canary.ae85f7eba.0","@material/ripple":"=13.0.0-canary.ae85f7eba.0","@material/shape":"=13.0.0-canary.ae85f7eba.0","@material/theme":"=13.0.0-canary.ae85f7eba.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"e3a3d97dc865cef9b5eee17c8842c3ef9be90dca","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e3a3d97dc865cef9b5eee17c8842c3ef9be90dca/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e3a3d97dc865cef9b5eee17c8842c3ef9be90dca/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e3a3d97dc865cef9b5eee17c8842c3ef9be90dca/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e3a3d97dc865cef9b5eee17c8842c3ef9be90dca/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e3a3d97dc865cef9b5eee17c8842c3ef9be90dca/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e3a3d97dc865cef9b5eee17c8842c3ef9be90dca/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e3a3d97dc865cef9b5eee17c8842c3ef9be90dca/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e3a3d97dc865cef9b5eee17c8842c3ef9be90dca/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.ab310900.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-MqAkrtQJKiLtaPTEosMa7SQydMv0kB7eAbR25m+fCuuQiSmWwyuBevGn+1NKUiAlPADA0/W2gSnhWYGk5cgX5g==","shasum":"607c1af3d203a8c14faff3dd3935016e52abf574","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.ab310900.0.tgz","fileCount":13,"unpackedSize":201377,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhAbxCCRA9TVsSAnZWagAALgkP/0Vy6rCEQrWWXAEl0bgr\n2d8eKhEdPfe6uwufx4n8TjbW1YKay1lDE+9/fdAuu5ElqSI1oVIGVNdsUa2o\nVlmoCRAFEj7RAETyrgRBtggw1GJVMtPMymdKpZ2BhDruWG+8c0R+HJIoUBNo\njZIrm/eY3ObQowgsloeqR3WVlmyctCsQhVovsT750vvsHznCqfxPssC1JKhi\nMZEN+VQxJsYTOWhdGyYSP6wthHc7rh8vKtmbki925iJ018WLZf3HYrQfBijm\nLaI30BTKa/F9GrUdAnSHaxvpbUejGTE8NyzYAvIoWEa8i9H72xFlJ7CQptaI\nPQOFodX3P7ah+q5m9xoThjAnJMFEjM/K3aJ3hx1hwusQcGiZki2sFRFrxDKp\nCnP50AR3jNTgJdrXL5oUCBXv8ingEh/GlG0erAdwiAkoA53tFcGmodOPRq7n\nDJlKqauYJ3PQMjqF33bD6ot2me13yZC8Jnxlt/w55RSk+6tHFyZYZ6m5Iw4P\nsCq0nzCI2h4TKoW1QBYQzSqZgoEh2G3sBusDW/yc0Z8s5UzzPgrNoutb+DmJ\nlw/rlg+3e4Jpql2mrFmgclMis0BFnolXvqPbOfZ+YVSFeEzZiQY6VqiXYA0+\nPj7kaHVBzcKh3VMGi0ZIRMdJJ22Om0BOOB2qKht2QUBQ7bNq3TfX/AG0sZXR\nLQW0\r\n=CdKY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBukmKEft6UZT+IKGWRnF5VLJXOvEryNoiVxltubfsITAiEA0av6NoCzrbjK1yGBk38KgNfh+cw401NPPt761jKBCJc="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.ab310900.0_1627503682033_0.10790429173875737"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.21dc9bc5.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.21dc9bc5.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.ae85f7eba.0","@material/line-ripple":"=13.0.0-canary.ae85f7eba.0","@material/mwc-base":"0.23.0-canary.21dc9bc5.0","@material/mwc-floating-label":"0.23.0-canary.21dc9bc5.0","@material/mwc-line-ripple":"0.23.0-canary.21dc9bc5.0","@material/mwc-notched-outline":"0.23.0-canary.21dc9bc5.0","@material/textfield":"=13.0.0-canary.ae85f7eba.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.21dc9bc5.0","@material/notched-outline":"=13.0.0-canary.ae85f7eba.0","@material/ripple":"=13.0.0-canary.ae85f7eba.0","@material/shape":"=13.0.0-canary.ae85f7eba.0","@material/theme":"=13.0.0-canary.ae85f7eba.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"cfae2d30a40b9717e93cc7842d29f51de61c497f","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cfae2d30a40b9717e93cc7842d29f51de61c497f/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cfae2d30a40b9717e93cc7842d29f51de61c497f/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cfae2d30a40b9717e93cc7842d29f51de61c497f/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cfae2d30a40b9717e93cc7842d29f51de61c497f/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cfae2d30a40b9717e93cc7842d29f51de61c497f/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cfae2d30a40b9717e93cc7842d29f51de61c497f/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cfae2d30a40b9717e93cc7842d29f51de61c497f/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cfae2d30a40b9717e93cc7842d29f51de61c497f/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.21dc9bc5.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-uRHQtVzNSZdmWurBQ31E3a9FRPopVPMsTHbl3uSnpgP6BVnNz+kpTsDH4iedEo490VMKVBnQlE80QolqQ9alkQ==","shasum":"1f78987f514ca4d45f5e82f9006f83d9e67fbe9c","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.21dc9bc5.0.tgz","fileCount":13,"unpackedSize":201377,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhAb1eCRA9TVsSAnZWagAARNUP/j7llJsLxfrPdn5GpNtw\nl1OTqigdrAZwhrk24nJUfTrbq4V2Rex4aytp5P0QHZGZsY6Y0KQD5Ed1iQLB\nLKhsr/k51CsStGf/lLvIi3pAQmWFMueGzmzY/y6HoVRpOgszodEaT8OObTrM\n/NQltheU6JZ3biZA7N/UrzsaBs8Ehk+nOSwRS68r8UbYRifWp+j/U44oNyD9\nCBQgFHbg+COgip5m1bmGw3vymaT80haEdmzOAQG7GiLImSBhUb6Wk2Po8ZHN\n3PiufUl7RNMur4aGUrl458DCXic5dUnvr+XDd4l8pH1g+qMMiwngXttknXTS\nUfh3npRGhQUGrg989dDvHwfX9M1r6XQWzvQoR6EsDHIqWPUQaFPXSzxmVzoZ\nEDufCAXjy978N0H/t2Piwa+mayoZyDzjuOOMjbbUlvfBSg+toeVE4w8BEhpj\nNW/FpBizwGDY7WLEuGOdpEiTtiPd9sA2sKibPH6kEOpJ1pj+kOKRXCj9CWfa\nveH8D9LSzngqHeAE+c/8EbgSGHPInzmgpjqlSOepqQFfVXZLfp6oTL21b1tc\neseEgQqQtDr3cj+8HWKTdzUfKsBeiQN+GiRx7yCmhqNAfYUOaPwmg5sM6WF3\npXsIpnP+dv69q+/5gEfuRhtqDw5wked7+abIJjiFDAzlFBRqsL+1Zs3SeY9/\nOlv0\r\n=pqDf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDqHHq0glM+vrv1qAU7cpAxIK8tIY14djOGbaCORw6xCwIgLbmZS+QZigQUhs5Zzqx/u8I1Jy8pEGjhuTgJ/EK6TpY="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.21dc9bc5.0_1627503965912_0.24532724325186073"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.68c7fe5c.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.68c7fe5c.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.ae85f7eba.0","@material/line-ripple":"=13.0.0-canary.ae85f7eba.0","@material/mwc-base":"0.23.0-canary.68c7fe5c.0","@material/mwc-floating-label":"0.23.0-canary.68c7fe5c.0","@material/mwc-line-ripple":"0.23.0-canary.68c7fe5c.0","@material/mwc-notched-outline":"0.23.0-canary.68c7fe5c.0","@material/textfield":"=13.0.0-canary.ae85f7eba.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.68c7fe5c.0","@material/notched-outline":"=13.0.0-canary.ae85f7eba.0","@material/ripple":"=13.0.0-canary.ae85f7eba.0","@material/shape":"=13.0.0-canary.ae85f7eba.0","@material/theme":"=13.0.0-canary.ae85f7eba.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"d14f788b501a8e9e77ec19d160f45c10e76e3a31","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d14f788b501a8e9e77ec19d160f45c10e76e3a31/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d14f788b501a8e9e77ec19d160f45c10e76e3a31/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d14f788b501a8e9e77ec19d160f45c10e76e3a31/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d14f788b501a8e9e77ec19d160f45c10e76e3a31/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d14f788b501a8e9e77ec19d160f45c10e76e3a31/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d14f788b501a8e9e77ec19d160f45c10e76e3a31/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d14f788b501a8e9e77ec19d160f45c10e76e3a31/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d14f788b501a8e9e77ec19d160f45c10e76e3a31/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.68c7fe5c.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-Wz/dIrDu+4I2xk+NhLpEby2/OPzrEYPQv6Op3x/SKR/mt7Xt8l6ip7DjXaPASn8mmQq//hy6avHInoJxT7heNA==","shasum":"22a2bc464e362ed596b421526c49f0a2a47c2d02","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.68c7fe5c.0.tgz","fileCount":13,"unpackedSize":201377,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhAvQVCRA9TVsSAnZWagAAvtUP/iRmePe3S2T+3XEakJRt\nolB5NYsnJndd28IfKaKUzfjXGBxSGEyiZadYbuEUINUbM9P2Mc9g3uoWG2Rg\n7OyBCye+5ZK0npPDRbU16kWbTgnwUVtQBShcmcBVG1j6htnR0dcAE5oHt+pC\nceMhcxjkQAxse2zfLdC2cmNhPmQ5B6NStsDwclxMa0rHmVI7JNKT/jl4MBqu\ncxqRs4XQvqVrZlFj7fIWenBz9+zMFknsJw9u+K3ho1JGWGFzSUIQbiW6BaCg\nURDCIibBCSjdC/z0rlcXZqYdXs9DF5rCY9HPBMq0ExsmDFnuhTxo2fDQruXf\n1tETAaeYSz9IsNSU7oFjxs5+Kr2U4CQxXog3XGRxO2bo9mGng5eKP82RnEc2\n3NQn7oBMTqbETyIWkbeBGFVn4DXTTTWFxdvwGYVp8+fzrf4U/TYiyzD9b+sU\nkfsdlBYjgLLeUV+/BIdciNKtvPlkoGzVWnpl5FbGA3PcTvI2eA8rD/LQ5ekV\nh//aJLWN0Ywk+6Ik8/7bXskWpy5SCp0c/16sJA5XXIHBMNLs5bFV6qjC1RbK\nMzk/047DUUa4hSiH9M1HoX0fuPlQzsjXmZo0+1YPmd0t8nSGFZZ11pQCKd7m\ncqfL82cJJ4YiExiS2Ps4PoAvYBOp4nNVI+8cBDulPoZUjSPYwG7J6B5c71L2\ni86l\r\n=WVbP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDZTuKkTPq8E4L5AprCPzlJ1KXpmaNFE2RvEww4Ene+bAiBajyMEoX2+P6sDPSE6Rk2lWSUuL8WzfYWlveiwK7D4YA=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.68c7fe5c.0_1627583509056_0.47389782177268813"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.aebe39e8.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.aebe39e8.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.ae85f7eba.0","@material/line-ripple":"=13.0.0-canary.ae85f7eba.0","@material/mwc-base":"0.23.0-canary.aebe39e8.0","@material/mwc-floating-label":"0.23.0-canary.aebe39e8.0","@material/mwc-line-ripple":"0.23.0-canary.aebe39e8.0","@material/mwc-notched-outline":"0.23.0-canary.aebe39e8.0","@material/textfield":"=13.0.0-canary.ae85f7eba.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.aebe39e8.0","@material/notched-outline":"=13.0.0-canary.ae85f7eba.0","@material/ripple":"=13.0.0-canary.ae85f7eba.0","@material/shape":"=13.0.0-canary.ae85f7eba.0","@material/theme":"=13.0.0-canary.ae85f7eba.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"d28ef9fbd1251f2664f6385efd6cd33d59bd5a19","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d28ef9fbd1251f2664f6385efd6cd33d59bd5a19/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d28ef9fbd1251f2664f6385efd6cd33d59bd5a19/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d28ef9fbd1251f2664f6385efd6cd33d59bd5a19/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d28ef9fbd1251f2664f6385efd6cd33d59bd5a19/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d28ef9fbd1251f2664f6385efd6cd33d59bd5a19/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d28ef9fbd1251f2664f6385efd6cd33d59bd5a19/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d28ef9fbd1251f2664f6385efd6cd33d59bd5a19/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d28ef9fbd1251f2664f6385efd6cd33d59bd5a19/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.aebe39e8.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-RTKxnLH3KJvwG1QJLBJ9RaQS7+pC4MI5rIimJHHw9QXTgtmOsuXW1B6ThZcUxo7Ta91PmvCBFOMz4dUGGGQzvw==","shasum":"3bb73931a8e79a77ef6ee351aac76beb804e0944","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.aebe39e8.0.tgz","fileCount":13,"unpackedSize":201377,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhBE9qCRA9TVsSAnZWagAAoHMP/3t4aoPzilUygu8t61GM\nWuOYlKaHHtEK1xjXJcQmDccU3gHi69/AcvLfPuLdYGzUWEezHR6L6mkTxj+s\nbmZYfx86VmuYB6Y1dFrzwZ4fg0DyBYRl+oc/vRQWb+oY9JQL5wZbRlD1XaOH\nK0Vn8zRgC3l10Pdz+NRD6vX9MQCCQoGsco7aNDIe2zcwAcDEqYajFiYqy45g\nProtj3R43B2IhCV9PK7XdXj6ZsfQJGbCCKr1H5zAh9fhIzX/qPTy7U/TuTM+\nnYVIW1WCNYCJ8agY27HwB9gc6OBxMlKx9lVI3o/HA+ZA0ClfwEprayXMW9iR\npcr4fpkjbcec/ManLyMKy4aJdOIKXljkFt1jfO3UmBTHXAwb/V7sVQu+IUx5\nfssa35VUgQU4GVn++WuieP5RszPgLNwRAfV/Y40L2yvXNpjlbcO8MCE1pKl6\ntqRKWmd7+r+XDYetYcpq9zQa/2YgsnOYCY6N0E0XwPukQ0ulssR+xqAxYN5F\n2do4JtZsZ73pHvlZhewMTh2vRMsalgREk71AwQyskjSIQgPc8EFlTTuDxpH/\nABRDu9kHvq1iD+xAlqI7M+ubd82vFCA2MF3kexXY/IQhEoNvVRQ5Ujj+uWH/\n4bmhh7blT001QJCgMRCgF18rIklV74dxp9bLaVkjUDdfEqt5YIGQTjgJXmPd\nrNQz\r\n=WiQ7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGkXyhABiU7cfvnnMYifw5v3ZyOGiVcemVchfAdV9M9XAiEA/PbGU02e7w+17DBGN3lH1WgZkHOq63ozjLhmMcD2dlY="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.aebe39e8.0_1627672425903_0.26924986555999775"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.ea889c69.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.ea889c69.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.cc5377458.0","@material/line-ripple":"=13.0.0-canary.cc5377458.0","@material/mwc-base":"0.23.0-canary.ea889c69.0","@material/mwc-floating-label":"0.23.0-canary.ea889c69.0","@material/mwc-line-ripple":"0.23.0-canary.ea889c69.0","@material/mwc-notched-outline":"0.23.0-canary.ea889c69.0","@material/textfield":"=13.0.0-canary.cc5377458.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.ea889c69.0","@material/notched-outline":"=13.0.0-canary.cc5377458.0","@material/ripple":"=13.0.0-canary.cc5377458.0","@material/shape":"=13.0.0-canary.cc5377458.0","@material/theme":"=13.0.0-canary.cc5377458.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"29d32f8e88155014cd9963c5b4fa346d8e3d28d1","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/29d32f8e88155014cd9963c5b4fa346d8e3d28d1/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/29d32f8e88155014cd9963c5b4fa346d8e3d28d1/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/29d32f8e88155014cd9963c5b4fa346d8e3d28d1/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/29d32f8e88155014cd9963c5b4fa346d8e3d28d1/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/29d32f8e88155014cd9963c5b4fa346d8e3d28d1/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/29d32f8e88155014cd9963c5b4fa346d8e3d28d1/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/29d32f8e88155014cd9963c5b4fa346d8e3d28d1/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/29d32f8e88155014cd9963c5b4fa346d8e3d28d1/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.ea889c69.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-uIQWSM2euE8UtDeK80FeTRukPlrlV9tkXJ6I/WhW9H+OaLVpCd5r6xgzJVu1FvRHBrLo54jRlDBEt4oPPmmLmw==","shasum":"c83f7aabc65efbcc473056981f25863b025ee72e","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.ea889c69.0.tgz","fileCount":13,"unpackedSize":201377,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhCY9RCRA9TVsSAnZWagAAj30QAIE9vOoF8ce2udiNrg7H\noruPqRDCR1iUIDbQ0iCWcTjCJGKg9rR+Lo0Y38WEGOODdZqOUlsSODT3eTte\nhuW+StOWb0dJ41AUBRPgs71HdzwAs/g72JnXUATdqrnsFm3Ssp/CeWatCy0+\nKBi6LuUTd7s1ztoeYbSa7ftWpMgZLfWjzKTFt3Bx/pkNhDnV6ry6v1XkG2Rj\nB6XzBUTp98E9OFhX3Qr45CR8cxTzfQGljFZJ0DUir3/uBpYL6UImpVm699az\nJy5bfFHsYdBbBK2qzlAI6JzQaJ72Zvl7rdEPAndEkQPme3JlVBe1onMRcSNu\n1jXS8c59tJUmNR2bOnmNEQH1d2mlzeErEEbksAKTSVKdUHTQYMnSB7lMVM5H\nGS85Qbbc7i5CqTdH72cvbsZGIdt5fuaAwf8aSH4yNp6+nOqhoeNXND2PKMjC\nJCKv6EYWHO0ygeHXqc2wjVOIhwH6B35zwcWiDY4gMck+Wq00ARts5w4p8UQU\n9Gbv5tJlqep8wx2R+g1wY8tLtItoX4jH4Qdhw7avep6afbnJGAiHPhk4lc87\nR38QLsN4zrwSASqAQ/Urvg7clKAvfpBazxXEXun8yQwl8JnfQ9L+Fw54heFu\ngsYtsdISM2v1dizz7w0ls/cXBdJzYUEwTwbVvy9mahCJKLiEMdB7GLc0hZuB\naeFE\r\n=IDJO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDCG7gtTWT5DUkWPHtmj9s5VXj3K18IibbDIMQq1MCZ/wIhAMZviWqQLLnyCw94kSUsIGDA5JtPOk47gjS82wLGq/N1"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.ea889c69.0_1628016465667_0.838586467873109"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.21918905.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.21918905.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.cc5377458.0","@material/line-ripple":"=13.0.0-canary.cc5377458.0","@material/mwc-base":"0.23.0-canary.21918905.0","@material/mwc-floating-label":"0.23.0-canary.21918905.0","@material/mwc-line-ripple":"0.23.0-canary.21918905.0","@material/mwc-notched-outline":"0.23.0-canary.21918905.0","@material/textfield":"=13.0.0-canary.cc5377458.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.21918905.0","@material/notched-outline":"=13.0.0-canary.cc5377458.0","@material/ripple":"=13.0.0-canary.cc5377458.0","@material/shape":"=13.0.0-canary.cc5377458.0","@material/theme":"=13.0.0-canary.cc5377458.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"b4df0dc9ece9df56af685bbc48963988f2cb45f8","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b4df0dc9ece9df56af685bbc48963988f2cb45f8/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b4df0dc9ece9df56af685bbc48963988f2cb45f8/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b4df0dc9ece9df56af685bbc48963988f2cb45f8/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b4df0dc9ece9df56af685bbc48963988f2cb45f8/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b4df0dc9ece9df56af685bbc48963988f2cb45f8/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b4df0dc9ece9df56af685bbc48963988f2cb45f8/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b4df0dc9ece9df56af685bbc48963988f2cb45f8/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b4df0dc9ece9df56af685bbc48963988f2cb45f8/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.21918905.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-s9iE/q4qWTrhgDY6xvKmT0Q+sPWxSMXY6NBrZqbIuRwwa0J7aAA7lGL/OUa9TRbv9Gn8Y2hpu+J2pdLkjMnx5g==","shasum":"2feff7b5c73dab9c042ad595988069f808a15626","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.21918905.0.tgz","fileCount":13,"unpackedSize":201377,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhCbGzCRA9TVsSAnZWagAAm0kP/0e8jOGdIFF0aAWrK5zI\nREMuT6+xOu1XpZkjlh4OjJiiFnAI7LV7Bt/l1ECLnoEFAGkvWO9gYrt6fVKe\nCJ5pFPe5viv0ll6YDjr5f5XGh9Hh5+Ak7l1xl+CN9NwJ3N1SNIVaNMzBiuGp\ntXKpDblUuzWnYF62NHiulpPOtdafZwAYGnQW5LllFxLECHes0AFH7APbK4+Y\n1FMgbe7jtFvyIFuukQLewpsp2ASYldMAXAf/EERJqeS8moTMCNwWsxHlsvlE\nDqt9RVWgtz+4a05SdNmtKyTULkD6328RCuIWiGTVYczEY0qehS5hbIOZ4xaY\nE4MyCozChU8iHcx0hQ8mNSIyLOGOJG4rvKpL5kNtpR832KKaHz34CWTGvohT\np35LdQmItQ29fGC6WkUjtX8jHmAZLBjowq/fe0lEaVeG0WNrJPCZNmcyVlS3\nseSYo7B/Gd/3hnKDTXl/+1oKsq+9e0Jl3iP1SK/LtX6VSo/+3raUo0r2nW6u\n7ZuEYXsLUhQBOWUS4WBgg+QoH02fTr8zR/xO/k+sKENFcwq3EWY5AuPDPqtE\n70WcQiOacgPvRYluR7mkAkAesYAZzZ30UM06ICIhuFufYNWGGEnZ6TnhdeJF\njS7toFebQSLujt2BHjrmSPat58cx90DT5QQ/ZXmahKKLnkA6NK/HmoWf1hEt\nS+PH\r\n=8xIy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDrqwh3RFma6RZwDfWOfLKF6EPdwkspFkeEfnNnhsPCvgIhAJTFEUCsgQh30rXfK8zhKyCjZoZwTCsTk3m/Wo0w5a0E"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.21918905.0_1628025266885_0.9103437374432222"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.193c87be.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.193c87be.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.7c96e6b98.0","@material/line-ripple":"=13.0.0-canary.7c96e6b98.0","@material/mwc-base":"0.23.0-canary.193c87be.0","@material/mwc-floating-label":"0.23.0-canary.193c87be.0","@material/mwc-line-ripple":"0.23.0-canary.193c87be.0","@material/mwc-notched-outline":"0.23.0-canary.193c87be.0","@material/textfield":"=13.0.0-canary.7c96e6b98.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.193c87be.0","@material/notched-outline":"=13.0.0-canary.7c96e6b98.0","@material/ripple":"=13.0.0-canary.7c96e6b98.0","@material/shape":"=13.0.0-canary.7c96e6b98.0","@material/theme":"=13.0.0-canary.7c96e6b98.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"62c9e4344bd3aa4983c1eeddc83cc2dbe9ec6644","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/62c9e4344bd3aa4983c1eeddc83cc2dbe9ec6644/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/62c9e4344bd3aa4983c1eeddc83cc2dbe9ec6644/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/62c9e4344bd3aa4983c1eeddc83cc2dbe9ec6644/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/62c9e4344bd3aa4983c1eeddc83cc2dbe9ec6644/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/62c9e4344bd3aa4983c1eeddc83cc2dbe9ec6644/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/62c9e4344bd3aa4983c1eeddc83cc2dbe9ec6644/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/62c9e4344bd3aa4983c1eeddc83cc2dbe9ec6644/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/62c9e4344bd3aa4983c1eeddc83cc2dbe9ec6644/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.193c87be.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-70uVXCjfaImw6YN/ulGuRJYWR6pURqISZtLuIxRGlqFN5ZexuhPZChIJRa9bRGQ0NUjfvKJP51axEezXe1a/KQ==","shasum":"11e41679854b8b7538f83696306bf7be1c669f49","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.193c87be.0.tgz","fileCount":13,"unpackedSize":201377,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhCtdrCRA9TVsSAnZWagAAmDQP/3/2dD6AdCUXYFl/7aJ3\ndF2XeDz523njJa6W5CMf+Jd7eoOzi9/oejiD+TKc16pQNgO6DAHw5I4Rlhwr\n4bmyJOW8Sc1LlYi9uPpvNlAq4L790yEDfxsnVS9shHyEks/n3iyZDVX/axTN\nQQgTJ3/hWc4iJOJ98BBvKUNzYpAsCDDtcBpfwv5LB7860RpJYkbPmguPvzyU\nSWNc/EyjJQgv0jRo5j1G9W3V1QtF7yFwurdoj2gA2BXSoCtMgwnWl2Q5Ly41\nUusrFSgOFx2+TR3XOcK0gXdSJzY0sEvnK6fJfpxK84+DmTEZsFewM7iHjoWZ\nZO8WwUcdUNYp6M3Q5KrGJHrAhJdQ9aRTabn4OYCaC1swsZSQQBU2BVc5/6KP\nVMrKF1oQWbIFy5j+jM5GrhdIod4FfttxwLvkr/bGDIKAiCLnVE0EnU328Fb9\nzG68IhROWbdhlK5UUIob9Ul4Xn4F9+9Gh/omPKnS9P+jJ4A+nQ6sE5Ft7+7z\nUst7lgLR2pDvJHEut2hc92PwtVdU8kHsI1Gtk0b1gzMYOQ75yJ4mlZgmE4MF\ncBnok/78DQE94CNBsSw5vHdS0i9e0jxntJmV2eJEEUMufOrx87PnYHJkUtGO\nJ6pKPlPCVBH//lEMoXwEvUaXKyzMiDTrz3Re3n3z4pf1OiQRnVnXA1g92t6o\nzLwk\r\n=fRY4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIETe0QFo49elHW3Ov6lP2CYwCaukZkq9fLi10FgJA9CXAiBbOv+HkyxRvONs4ADHvwpZyn//3R9YEwQ67IcWpHtvZA=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.193c87be.0_1628100459608_0.8687409039548113"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.6fc52d8b.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.6fc52d8b.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.3dd611091.0","@material/line-ripple":"=13.0.0-canary.3dd611091.0","@material/mwc-base":"0.23.0-canary.6fc52d8b.0","@material/mwc-floating-label":"0.23.0-canary.6fc52d8b.0","@material/mwc-line-ripple":"0.23.0-canary.6fc52d8b.0","@material/mwc-notched-outline":"0.23.0-canary.6fc52d8b.0","@material/textfield":"=13.0.0-canary.3dd611091.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.6fc52d8b.0","@material/notched-outline":"=13.0.0-canary.3dd611091.0","@material/ripple":"=13.0.0-canary.3dd611091.0","@material/shape":"=13.0.0-canary.3dd611091.0","@material/theme":"=13.0.0-canary.3dd611091.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"d70f6897dfb89d87fb73b1e96c8b4164ca76734a","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d70f6897dfb89d87fb73b1e96c8b4164ca76734a/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d70f6897dfb89d87fb73b1e96c8b4164ca76734a/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d70f6897dfb89d87fb73b1e96c8b4164ca76734a/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d70f6897dfb89d87fb73b1e96c8b4164ca76734a/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d70f6897dfb89d87fb73b1e96c8b4164ca76734a/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d70f6897dfb89d87fb73b1e96c8b4164ca76734a/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d70f6897dfb89d87fb73b1e96c8b4164ca76734a/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d70f6897dfb89d87fb73b1e96c8b4164ca76734a/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.6fc52d8b.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-s04ZZ6mkMC2k9IHSXcIWkoX57TYEwAwb2Q5VQIoYlDCcAnSy/NNc2e45OA6m8Ffaddh8QKCacITLh9aVR/X7AA==","shasum":"aac324159212d9308c8e41e43f6720dda4b3bff6","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.6fc52d8b.0.tgz","fileCount":13,"unpackedSize":201377,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhDCmtCRA9TVsSAnZWagAAkWgP/i5Go2VaMBC1feSXXzpT\n8PdJ33R20Go9wBjRgeVdRlRqTNKNGUjSIfJfffftHEQ3oqHgHwMsdmCOBXSb\nR0tqMDd2UZFJCL2Yqy4tlBfKjHh/9ClfQxBc40dd+8FRnsUpUnSE1cwcyRS+\nwo706pVVw/M9DJbAPyBqfE3jTZLzgeRXvf2KFtBuvixTCmb9GOHrzs5Jgm6e\nfEWZ1jVvnRgM/cWSDp7DZZ35f7t1nPrIzNA8JvYAFZ6fhTgtiVDpV0GDP6zw\n7S9LL+CwSCS2n9puwNDOAIaqQf/gohRZjbXEB34alfgtV3tZt5CbmQxXcImt\na2+5pMG3zIFO+1FhM8evuLuiXzFJkqFB2SqefaaIEbsGL6wHoKNDDb4e+TYy\nanchlNODNJW8lUQ1EVTj5DLcyoyp1NDAs77ZpWQLgK39f4SetFxRUUZmbw2m\nIbSE7GTzWe/keJ5EU2Ma6zsPXfnnExku3E+c+K7ZP15hwCF5OJe/c4Wpruh+\n0kpwqr2PMvUeogImtX76Niqw43/L8Pp5ixviKBHNnR826Z98vUrVUQXS7RtI\nd7JTuVQdBCF+dvvNfQwEdNGn/KDfYm7g7gGEBiR0xbBDLg5Ccsyo1S5p/lGl\np+zo95Bq/x4aKiBGSbmSOH9+qWGyC0RlXvFFU4vpb5PFSl1/Li6W0KiBw67t\nwlKA\r\n=64ka\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBB2t3I1esgEFGIjvnbFivALiTmrzrZS5yJRNEqM69flAiAupdBgVVGXnnvUOYIebVX1Oc4p5uFqoKRNdil3LFmkuw=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.6fc52d8b.0_1628187053344_0.3933938580768068"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.e2e9777d.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.e2e9777d.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.b47dd37a6.0","@material/line-ripple":"=13.0.0-canary.b47dd37a6.0","@material/mwc-base":"0.23.0-canary.e2e9777d.0","@material/mwc-floating-label":"0.23.0-canary.e2e9777d.0","@material/mwc-line-ripple":"0.23.0-canary.e2e9777d.0","@material/mwc-notched-outline":"0.23.0-canary.e2e9777d.0","@material/textfield":"=13.0.0-canary.b47dd37a6.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.e2e9777d.0","@material/notched-outline":"=13.0.0-canary.b47dd37a6.0","@material/ripple":"=13.0.0-canary.b47dd37a6.0","@material/shape":"=13.0.0-canary.b47dd37a6.0","@material/theme":"=13.0.0-canary.b47dd37a6.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"cdfa31e7045c5004a0ebd645c1096ddc7724ba28","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cdfa31e7045c5004a0ebd645c1096ddc7724ba28/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cdfa31e7045c5004a0ebd645c1096ddc7724ba28/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cdfa31e7045c5004a0ebd645c1096ddc7724ba28/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cdfa31e7045c5004a0ebd645c1096ddc7724ba28/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cdfa31e7045c5004a0ebd645c1096ddc7724ba28/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cdfa31e7045c5004a0ebd645c1096ddc7724ba28/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cdfa31e7045c5004a0ebd645c1096ddc7724ba28/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cdfa31e7045c5004a0ebd645c1096ddc7724ba28/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.e2e9777d.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-9YlxJbvLCss2SO5fMPzf1ljMnUV2VDAX6sEK6ote79/Yfx9+Ke9ohuKQbIWgSO63RQUzx3Nx6VIzmkPGhLnFgQ==","shasum":"ed1b3e65f76a74eeca86526a1018d0db7114f301","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.e2e9777d.0.tgz","fileCount":13,"unpackedSize":201377,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhDGp/CRA9TVsSAnZWagAAPS4P/j/r+O64UVN+uudgtGlR\nGlUvv+C0i+Os0qsn3oO7vE697wF9Pz+6+O0cMHThdorm1SO/7aHk37JN6PSi\n6IcyazrvlATr8N1SoKajj9O8kjti0PC67RWTd2HitYlI47AUf/vvL/L72stX\nuFE6gUL25cLcQBi0g0rA3rbiKWFs+3AFtYhgaKc3giuooSjCDgYYEKvCDdha\nlJ89l7zdBXrPK2la5BtxFBwPECL0lR8ogydq0wAleiSv0/dL0f8HudGI0u4h\nFu6Xq8Cv44qx8VRO1kQueG5D4DjjELezV/TZ6bsdIR7qRKHZe8rxUZDbCSL8\n1eFreBJPeUXvVKjYBp3NjTIGd5Za8u6yn+OEiEcw/suwzCYJdJoA8xZGc5Mx\nMx6GHpJW5GXEabiUtNhFUAa/d9LRrkQTP3j1HdYVaA9cMJBjB8Lh70EfqtVY\ncvgrUO0mAwyZHYNoV/w9Lx8iSOoC1kj+KpR9ybO6oCoHW76xSyMxXixXzwWj\nDNETMFPzJ9zylqdvcIH3UCxh5YUXLr0oLqmBuKx5B0sV0ZdNAXyz3AoiIunu\nlCXqFp8PogW/TDBj7pd9sjr7slrPadUhbOMDnrvSYZy7P6UJCFb9UZ7wYwSS\nJWyOvQA8NPDQv4wSCDY4qaL9MCL+svexjSw52vjnLPcuxhW2SQidhnjtW4tn\nSCeP\r\n=0mxn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE1MAVgxgnyJyVa6mTNoqlSn/0hBNmX+GFaRXCCATibFAiEA5lTXflSnP5kb/Vtm69qI63Jb8mpF0+1VcqclS8SJz1g="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.e2e9777d.0_1628203647061_0.09868770819850203"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.72ff1e68.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.72ff1e68.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.b47dd37a6.0","@material/line-ripple":"=13.0.0-canary.b47dd37a6.0","@material/mwc-base":"0.23.0-canary.72ff1e68.0","@material/mwc-floating-label":"0.23.0-canary.72ff1e68.0","@material/mwc-line-ripple":"0.23.0-canary.72ff1e68.0","@material/mwc-notched-outline":"0.23.0-canary.72ff1e68.0","@material/textfield":"=13.0.0-canary.b47dd37a6.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.72ff1e68.0","@material/notched-outline":"=13.0.0-canary.b47dd37a6.0","@material/ripple":"=13.0.0-canary.b47dd37a6.0","@material/shape":"=13.0.0-canary.b47dd37a6.0","@material/theme":"=13.0.0-canary.b47dd37a6.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"efaa4c0f4dc1cfea004a7f4dca613ec666b1106a","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/efaa4c0f4dc1cfea004a7f4dca613ec666b1106a/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/efaa4c0f4dc1cfea004a7f4dca613ec666b1106a/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/efaa4c0f4dc1cfea004a7f4dca613ec666b1106a/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/efaa4c0f4dc1cfea004a7f4dca613ec666b1106a/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/efaa4c0f4dc1cfea004a7f4dca613ec666b1106a/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/efaa4c0f4dc1cfea004a7f4dca613ec666b1106a/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/efaa4c0f4dc1cfea004a7f4dca613ec666b1106a/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/efaa4c0f4dc1cfea004a7f4dca613ec666b1106a/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.72ff1e68.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-8LVPhAuMzdtcWdK5FaUYwOzPSRj/R22AX2xyh4GQbVmJXIiszoid9ypAW+JBfxIGunYWzQSGEdZS9r7AqUhWWA==","shasum":"5b459dc258cd966b0ec1cd0c33631608cee01e75","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.72ff1e68.0.tgz","fileCount":13,"unpackedSize":201377,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhDaAxCRA9TVsSAnZWagAAv7AP/juPdEfPYhqEOMrNL3VY\ngY12fsCHoxZI1Wjeiq5MHK7JCO3LZMfHx7Nb0UtPPYiZLRFgHhXT1+cAMUB7\nnHYeKX0GF7bhvcUsZypjP9nC5ck/q5kyciIVCCRnvPbXgtOFyOFWwfpw0VH/\nP9bJ62cBlbIIQRwH/bniWrTbz3VAVtFByPRdmlUzCuStVVn1BYfqcdVP6OY0\ny5k6w1UJvgIjKbddC5qEJh2m7fwylj86xqq4ISIHkKzJJrzBYPDmuO4XfUAF\ny+Li2jokQ+rrfmbGFz02nUrkhJ2VwPxVqDQFWPk5L2dA8Lcem+7oAucP0pZW\ncWi+cA/H3Gf5MfRujFYvtYw2Ap8hTFkdbH9MUcrVu/9Wff4NxrMAc9KPQ2Z7\nYfPZ0AwPwZgXn9bygTauPqaLauLBmJr/o53HU1B0XA584MbJJSv5J+Ax/wve\nn+dBA9Cs/WFo47IRcQ1deXYy3vFs3a3WBZYmOTEnKX2IekYx5sT1HPhCS8+P\nj3I2200mlqaRmY83+w1xKIS3ZA7Ram10zjn69/9rJcONCga9ryPYb6RtxZhY\n4X+DULIqOlXH+cqmRPyfg2zwrspNP7bNAfIDoN6VvyPX/axfjIS7QrtW1pp3\nNdasNZSNrkk4/FTAWnex4JLDUWt8XcHAsn8z8XTuKlTsbAfFVPc0NzpMq9vN\nvQuK\r\n=wDa/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCVxWsHo60nX59McZmAlqzw0td0oXPQk1giq/aYF6rplAIgWgcmCU/IlLmshryyp51oUGMRjYIjIupCzMUHuxqJuxk="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.72ff1e68.0_1628282929053_0.899103796083808"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.c527e93b.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.c527e93b.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.b47dd37a6.0","@material/line-ripple":"=13.0.0-canary.b47dd37a6.0","@material/mwc-base":"0.23.0-canary.c527e93b.0","@material/mwc-floating-label":"0.23.0-canary.c527e93b.0","@material/mwc-line-ripple":"0.23.0-canary.c527e93b.0","@material/mwc-notched-outline":"0.23.0-canary.c527e93b.0","@material/textfield":"=13.0.0-canary.b47dd37a6.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.c527e93b.0","@material/notched-outline":"=13.0.0-canary.b47dd37a6.0","@material/ripple":"=13.0.0-canary.b47dd37a6.0","@material/shape":"=13.0.0-canary.b47dd37a6.0","@material/theme":"=13.0.0-canary.b47dd37a6.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"5f7d2f863731a86414f3b6d188833c46053b72c5","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5f7d2f863731a86414f3b6d188833c46053b72c5/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5f7d2f863731a86414f3b6d188833c46053b72c5/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5f7d2f863731a86414f3b6d188833c46053b72c5/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5f7d2f863731a86414f3b6d188833c46053b72c5/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5f7d2f863731a86414f3b6d188833c46053b72c5/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5f7d2f863731a86414f3b6d188833c46053b72c5/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5f7d2f863731a86414f3b6d188833c46053b72c5/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5f7d2f863731a86414f3b6d188833c46053b72c5/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.c527e93b.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-dmWmj50eUzNsvJGPd0uWYo/KCmlvwwZKtbwCf3UDuFJcX2aF6RKojrpU6lZoZ6jIZjTtyD18+cwnsrgFGMPmKg==","shasum":"5ccca65215871bf01111753c320bcf3694c59f2d","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.c527e93b.0.tgz","fileCount":13,"unpackedSize":201377,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhDaVGCRA9TVsSAnZWagAAtUAP/iO1zQTkv7C/ykueqfdC\nb3koYn2aOhd7QqyeOY7oasj1DP7fLMNxa3VA3WRIPdg904wJXUnZPeW/LMoY\nZymRxH/phXRE35/jIC6rl2PpbHfwFACSUzFzohKPOnLNs4grq/kCh79wYq47\nDcdYBqU3aRn+xdtBN63rJ5nlNCq+6El2Bwz+kdutNX2rb6CmfwK9YPuXsEub\ngfJ8nepMsdKEho6TxPYaKUFQGMB1RQPQSsMt4pW28f5LzRuJgS/Zqg7Cttpy\nM1mx6G/vWsTtoBxKA/dBUTNhLcB/EQBKJm/uY4uaJdB1JAaGL1g81FDHiNNR\nf18K6o5tT4QNubgdBK90R6ADLzjADOK5GvTk04W7tP0hgM8f0Dp/U7LFDPdT\n8p5MpEtnQY5OnGmBg8Gx463pdu/pVPI5FLMlf8O3iBITo6eOfcZwg5NEc0Mr\nQtlB7hruIvDrD8EdmgPEpr19tT/6nlVjGb/kCtz5Reh2XfybFPf+XB9BWjTs\nRsVFnw+AVMMAsoYcavzX6ra380jzXj0cCSyPDEMz69O5x4aOkUwmHm7Csnao\njANcQXM9z2UOGFynfsXt8P5t9rGeopImfem10LtUKp3wagxaT5PokPOJNrT6\nHpezvPluHzZH2cXbWsn/+J/rMkOeNcAZHYHtJO8QU0Eqe40stwSKTB5YulvG\njh1I\r\n=azNI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBwvODF4qDguNSxmwTIYP2iznCJhj/TL+GzNfx5B284IAiAKgUL0qMHW4NPJT1J/HDd3vRlJ/A0A/TUl24mY3gr8vg=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.c527e93b.0_1628284229975_0.9609202095040035"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.78b1eaac.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.78b1eaac.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.b47dd37a6.0","@material/line-ripple":"=13.0.0-canary.b47dd37a6.0","@material/mwc-base":"0.23.0-canary.78b1eaac.0","@material/mwc-floating-label":"0.23.0-canary.78b1eaac.0","@material/mwc-line-ripple":"0.23.0-canary.78b1eaac.0","@material/mwc-notched-outline":"0.23.0-canary.78b1eaac.0","@material/textfield":"=13.0.0-canary.b47dd37a6.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.78b1eaac.0","@material/notched-outline":"=13.0.0-canary.b47dd37a6.0","@material/ripple":"=13.0.0-canary.b47dd37a6.0","@material/shape":"=13.0.0-canary.b47dd37a6.0","@material/theme":"=13.0.0-canary.b47dd37a6.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"6052db26d383ccd469e4c4f6cca3c1d2e4533696","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6052db26d383ccd469e4c4f6cca3c1d2e4533696/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6052db26d383ccd469e4c4f6cca3c1d2e4533696/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6052db26d383ccd469e4c4f6cca3c1d2e4533696/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6052db26d383ccd469e4c4f6cca3c1d2e4533696/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6052db26d383ccd469e4c4f6cca3c1d2e4533696/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6052db26d383ccd469e4c4f6cca3c1d2e4533696/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6052db26d383ccd469e4c4f6cca3c1d2e4533696/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6052db26d383ccd469e4c4f6cca3c1d2e4533696/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.78b1eaac.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-laZAz2RBDNKTD7u2y9zRW6zZEJSEuEwW101P2EIjkAA+bFjvsxA8xRafoDC7U3rgvjdfAgFGlDrcFYK1bReM/g==","shasum":"17b29c548b0328805f3835de82b7df9475570cf3","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.78b1eaac.0.tgz","fileCount":13,"unpackedSize":201615,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhEW4JCRA9TVsSAnZWagAAhx0P/RjeqN43znysrF0I6qtg\n51THkFTVeZKLOjEbmbLRD9gfTHRgNTIvvKiNUEhDrB5law8j64uXEdqOhN9m\nEwgOuDVxro52DBlYSxJRBWEZ+4kOUSUsvW2JozTDKMqKpGChj6yz32AXEXsV\nlbj4y2RT3ijUTL8Z+7rHZpH6fwjeEZ/0JdTs7vNihCWHkVl5SK0YVvHwoQxS\nE2qdMgXoX6+wXT0TUGcbnuy+rtdT9lDkTT26lnc8t9dYOGexP9/J4W79T9Vy\ngbVWN2+SY3PyNHfd9Gx7Km1yMJm97ihLVuThtWymV+vIi+l90eDNJ1sXfo7F\nEbJ9aJLXEtysn1wb/sZHbYDriRqsXCBgOTrpG/dfhrschX3M/a/5l73aavKO\nxYxS8/XDI1laBxVB9+5vxcDkMcpTG6fKboF61Y/5Os7bk7YxwRh09kYI+FH1\nITe4UDKfcIEEFmgSVBqW9IIQhf9xhq5IqBLrBd7tEHrkmPBTUL+bGjZjp5RG\nSveMUVxUZUumDIf/+47+XU5WiQcAlFq2hKeJcKVX3Tcp8hoqjS+xRJykKUV2\nSEa+URQgtaFD0Ml2ex4WBQKVjQPGhVn1xNK3xzWIgcb+VFIps9Ac6VGKXyDf\ni8zEjVR/P3yCHLWuEJmH6tUHYEJFyRn+gtfGS8d/5P+0j+VxcyjKHvUvu1ep\nLqFp\r\n=c4S7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICv54ukipYRJhQpDKK8Qbsqrqaqis5pPWIHPFxlNIxmmAiBV19ai5Lwv+7SS+a5xQrR86lE8m0u1xAP1RGX8ugnlDg=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.78b1eaac.0_1628532233372_0.428136921678389"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.a8a4ddc9.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.a8a4ddc9.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.7249a3060.0","@material/line-ripple":"=13.0.0-canary.7249a3060.0","@material/mwc-base":"0.23.0-canary.a8a4ddc9.0","@material/mwc-floating-label":"0.23.0-canary.a8a4ddc9.0","@material/mwc-line-ripple":"0.23.0-canary.a8a4ddc9.0","@material/mwc-notched-outline":"0.23.0-canary.a8a4ddc9.0","@material/textfield":"=13.0.0-canary.7249a3060.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.a8a4ddc9.0","@material/notched-outline":"=13.0.0-canary.7249a3060.0","@material/ripple":"=13.0.0-canary.7249a3060.0","@material/shape":"=13.0.0-canary.7249a3060.0","@material/theme":"=13.0.0-canary.7249a3060.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"d9658c00d9d10361ed16fd976b03d6652cda9ef6","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d9658c00d9d10361ed16fd976b03d6652cda9ef6/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d9658c00d9d10361ed16fd976b03d6652cda9ef6/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d9658c00d9d10361ed16fd976b03d6652cda9ef6/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d9658c00d9d10361ed16fd976b03d6652cda9ef6/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d9658c00d9d10361ed16fd976b03d6652cda9ef6/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d9658c00d9d10361ed16fd976b03d6652cda9ef6/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d9658c00d9d10361ed16fd976b03d6652cda9ef6/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d9658c00d9d10361ed16fd976b03d6652cda9ef6/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.a8a4ddc9.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-3u1oRAX2PI8od/0csq1cN4vgQEnYNbsSGjDw7dsaCeGCZBjCPP2lea/tT5XANyZMShAG1Dq5H3FJhPp1jou3PQ==","shasum":"2303dbd839da37c8787dc3034a1f4d2b9656f779","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.a8a4ddc9.0.tgz","fileCount":13,"unpackedSize":201615,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhEsmhCRA9TVsSAnZWagAAduQP/35sRdGExPLOhk8g5D5v\nsVB+Jo2oUzmbG3jceO1ZYK8VXykN+QaN1Ez6QRp99n9mhTn+mcldUYp0yIAF\nK4aJq8eDrjkf7gdHdhMy/QXfJNOocPpRc85wNPYs8mgrIEGTeoacHzuK0+vA\nvdL+JBzc7OiwNolu+jfkuAJ+RY9b6RlNoH+Y0lktVjyVjGKV+dOyLTUKJJQz\nNBlb9Pe9jg14rgbAQnDDJsOQvqWHj5jS/QQ81bijevgeqAkOJI6MGt7bfwii\nPjphH7fhij85nOB/xl1vJ3fDM+EdTzRHOsWDptzyLkcm+bVQniwcU7NLAdR3\nZB5HrrN6kIQsupWvTu1WSF8c0tsMrheYfup1POuxvvt1HT2q9TXwLvZj2iBF\n94xl3Z/mmZwTBlczF1ZzvTHXCgkWCBxz9ojyUM3X+ic0kZrRLCMdywJTlkMJ\nYq2X1SKDvJQT5wM9hRW6iOIy+fKEkhHPBrwq5tVSPBX8IYW5Wleqqzl88734\nujhj2oUvnPHalogFFgoBFBxMaBXNQ6p2UgQbsELIWtoFd5AUZ4Yo+WnYBgkW\nLF5vHHWBkeZRJwzd7aaM3zI9y6leyoyaaHAqc+KnvXm/wKbUrdQgrBPZ1Yot\nEYBuFoUa0fbVBUZmJhBN/pEC8/JaqrsTJExc6sXzbq0OSl+PW2XN3M0VtAgu\njCbq\r\n=j3Pv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEq+Ydg5ejwvQFQbHjMtkMKRXDeCz5yLYmjuqGA5rN7nAiEAqmyNb70LZlID5u2ErhLRqSOoY33YHl88f5YoIipSfwk="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.a8a4ddc9.0_1628621217364_0.15392303638491023"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.99fc0632.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.99fc0632.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.f4241a42a.0","@material/line-ripple":"=13.0.0-canary.f4241a42a.0","@material/mwc-base":"0.23.0-canary.99fc0632.0","@material/mwc-floating-label":"0.23.0-canary.99fc0632.0","@material/mwc-line-ripple":"0.23.0-canary.99fc0632.0","@material/mwc-notched-outline":"0.23.0-canary.99fc0632.0","@material/textfield":"=13.0.0-canary.f4241a42a.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.99fc0632.0","@material/notched-outline":"=13.0.0-canary.f4241a42a.0","@material/ripple":"=13.0.0-canary.f4241a42a.0","@material/shape":"=13.0.0-canary.f4241a42a.0","@material/theme":"=13.0.0-canary.f4241a42a.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"1182c7b11008cbaa2e6a052092cde8c856306942","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1182c7b11008cbaa2e6a052092cde8c856306942/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1182c7b11008cbaa2e6a052092cde8c856306942/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1182c7b11008cbaa2e6a052092cde8c856306942/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1182c7b11008cbaa2e6a052092cde8c856306942/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1182c7b11008cbaa2e6a052092cde8c856306942/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1182c7b11008cbaa2e6a052092cde8c856306942/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1182c7b11008cbaa2e6a052092cde8c856306942/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1182c7b11008cbaa2e6a052092cde8c856306942/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.99fc0632.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-bZ7U0YqfSTLQrphMAcSPFbXWZRoluYddPojAusikyaAQ0xYqjytiz3vIj9AAfWLG89dyhH92C+BLXD8AJciLpg==","shasum":"f64eee17a2f7382fb6d818ef40e949d245248141","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.99fc0632.0.tgz","fileCount":13,"unpackedSize":201615,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhFE1zCRA9TVsSAnZWagAArEEP/2AhcNQibdkFuSCYOd28\nV3ihO+zbBz0yaMhclza1+c1TpDJMks4jeKaZjYG05l4A4ZkHVzTwb+OXq0SI\n/q2bWED9J1b+kIJFevputNGhtGgXnOtvvS+2q03p7zK5E6oicRlnruVVF9xT\nPeOwY0IhKMXTzMD8xm41kDYClD70L0SgZHz6ICrQRAmRCsyHogEO6+9StoJ6\nrTx2bsXTaLxjaBNtIiRJ/PJTvIZrKaUr9u9OiN7UjLVvwQQZSZlou+emnq3W\nT97HxGS7Nt7nnUY2gViWlecEmuCJZJK+XFae6zXrm/vu4hhUShqGxJ0erdxP\nXCS6OHmkwdtuPnom+qmOr7JrNhfKJXVk6HTNhj4tKYcxVgyClEUSUq3DfmZ2\nE9hKWgM+1vvb8VP4TDpAUF9iWLrprTdNvp+cV1waHzOG+t7PomBg8frCMh9k\nmzDwfUUNlbwIEb59KBeD4VYL+YXddn/w5xUscvIYq02c1HZORvk+fZGS7r8H\ndr9iAZSUB4PoJriH1fd9oSiILYPIy62Z7v0vyqNtWWIfEeBa+wU67Cs4lti8\nyCsh/lKrglUE4Kg3OurrIhF750LdxHVQj8m1/YXLQKeLTKeWq38maVm8RVsX\nupX170zwgbqA2V3gFKw30Ia4asZ6SoAiEIWmzGWxURqZrMDl4pvA8i0EJwvg\n8Ihg\r\n=ohCM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDwmMk30S+qckakvws3Xzoerm+iIY3k3GmRxNLAsil2CAIgNBNepUffopuFJVVEN3jN7HrizP2h8lWg64l0xd4XaQ8="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.99fc0632.0_1628720499326_0.12208026449012088"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.3f47ae57.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.3f47ae57.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.0ad12ed3c.0","@material/line-ripple":"=13.0.0-canary.0ad12ed3c.0","@material/mwc-base":"0.23.0-canary.3f47ae57.0","@material/mwc-floating-label":"0.23.0-canary.3f47ae57.0","@material/mwc-line-ripple":"0.23.0-canary.3f47ae57.0","@material/mwc-notched-outline":"0.23.0-canary.3f47ae57.0","@material/textfield":"=13.0.0-canary.0ad12ed3c.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.3f47ae57.0","@material/notched-outline":"=13.0.0-canary.0ad12ed3c.0","@material/ripple":"=13.0.0-canary.0ad12ed3c.0","@material/shape":"=13.0.0-canary.0ad12ed3c.0","@material/theme":"=13.0.0-canary.0ad12ed3c.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"edf4f3bc9066a2b36444c8a434994a5482e8b500","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/edf4f3bc9066a2b36444c8a434994a5482e8b500/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/edf4f3bc9066a2b36444c8a434994a5482e8b500/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/edf4f3bc9066a2b36444c8a434994a5482e8b500/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/edf4f3bc9066a2b36444c8a434994a5482e8b500/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/edf4f3bc9066a2b36444c8a434994a5482e8b500/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/edf4f3bc9066a2b36444c8a434994a5482e8b500/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/edf4f3bc9066a2b36444c8a434994a5482e8b500/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/edf4f3bc9066a2b36444c8a434994a5482e8b500/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.3f47ae57.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-X2zzRkUDsOpi/6Nl5E6uVCfm8yiLRKGjzwC0GcgMLuuu88Ml0X2+q8vEilf6adGq304fEDZsMj2sYmlCvZXTSg==","shasum":"4b1025800c479907fd7d35465cd78ed77ad05b84","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.3f47ae57.0.tgz","fileCount":13,"unpackedSize":201615,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhFWGjCRA9TVsSAnZWagAAF24P/AuYIHg0jm/0stJl2sKm\nwEh+XbvaikFQL4s7hNsHJID/rgNaXkzkIZbn2lcFhJhKXL2Yvjrh5gHiAgso\nHkkfOQndRtl1n2Pke+QEuNky4aVLqKBO7CVd43wq2i22vT9BbjJVdy+lD2eT\ndflBxW7kqov4qmzM+Oc5ebkZ8D5JI5UzaUika+TQq5IIZ5kwETh7IV3NZqSo\nOfw8VM5LEmTFKjyj96hmUw3aSbq7OXNo9+oKct4uYkVDUK4t3FRBRWILePwe\n/Mzluk6BrnYfdNfQQ/hk5TuqFa2y9QqLUpcwRrkZBakGu2UYSNcrbcphen8Z\nd0hjSRMYHOCtTS/Kxmg29qb0A9nofU8aUEHyaPj9jgeSSrPmdWpFvYmFsreI\nojRTM53lwDjhRKAcW9j62NVcrvQwDloSkrb3UOoNFhX0zJVFfJtCqELcr0bh\nP6vgf/jbejG1+fQwqpiGouZ7UGOGaes/VpykTOCiSNLfe3Q1VFAcPrAj+M2u\nFjX00RnWzgZfe7DKRlNmU2Xg25kN7yjly8vbTUaYkU8pmL9VYt8iagA412IK\nb9pmMquJe2l4cP94CX5Q0DztZw7Qwr/b3HvWRL+IcpRXQl/j4fWEGDjAotZa\nfLk2uM2NmLcyI2y8YZrxrcEZWER6mI/ospFsZs4A3UAnrSYtMc1OF/25ydkf\nRPBv\r\n=nz6R\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD2ykgEif3cGKoojZJuwmvDQp2150xBQipGK20pxowfgAIgTTQX048xPLH3v7yK89HJ1IdNb+ETzpwJT31b35vyjmI="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.3f47ae57.0_1628791203015_0.7047369839082123"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.6b9bfc32.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.6b9bfc32.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.077dcfcfe.0","@material/line-ripple":"=13.0.0-canary.077dcfcfe.0","@material/mwc-base":"0.23.0-canary.6b9bfc32.0","@material/mwc-floating-label":"0.23.0-canary.6b9bfc32.0","@material/mwc-line-ripple":"0.23.0-canary.6b9bfc32.0","@material/mwc-notched-outline":"0.23.0-canary.6b9bfc32.0","@material/textfield":"=13.0.0-canary.077dcfcfe.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.6b9bfc32.0","@material/notched-outline":"=13.0.0-canary.077dcfcfe.0","@material/ripple":"=13.0.0-canary.077dcfcfe.0","@material/shape":"=13.0.0-canary.077dcfcfe.0","@material/theme":"=13.0.0-canary.077dcfcfe.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"2479bbd88c9e53b974ec7671345a52cd8ac0e907","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2479bbd88c9e53b974ec7671345a52cd8ac0e907/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-components-web-components/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2479bbd88c9e53b974ec7671345a52cd8ac0e907/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2479bbd88c9e53b974ec7671345a52cd8ac0e907/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2479bbd88c9e53b974ec7671345a52cd8ac0e907/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2479bbd88c9e53b974ec7671345a52cd8ac0e907/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2479bbd88c9e53b974ec7671345a52cd8ac0e907/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2479bbd88c9e53b974ec7671345a52cd8ac0e907/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2479bbd88c9e53b974ec7671345a52cd8ac0e907/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.6b9bfc32.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-70aKrrtWLWItalt4yHizatrua7ZacrxQxaOS8gMWy8i+COc8PwU2OMAFVl6qdtb1Etv1myre6BFDLxGECNeSIg==","shasum":"50426a3fa162e9d29c87cd5f2f778d3effe2fff9","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.6b9bfc32.0.tgz","fileCount":13,"unpackedSize":201615,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhFWdMCRA9TVsSAnZWagAAD0kP/jt1g3Yoqb4I0eIkUbbw\nKVW5lEvyFvZgGhKFsv7E1zwgP3h4a9odiEpW2cO4ppBkVaPdKZnPQPy57bb1\nXSyMq4WidvX604C4ZyPbtbP/s8GrTeMZ55M6xCgRBFsS9f+ZczzH5OHdFF4Z\n+qZqwMExe8A1vCaJ7LuF01XZ+yGA5jHQeslP318KGrP8AA11v1vYzfW7yB2P\ns+teH74qVHHe/w6GT/gILGOvCqi2WGO8fcrtvokOigAts+68chG/m4pRWYDE\nZhyq9ztZ8VJ5rROWFEXCvm+MWJvCfl0qsdystWPfKifvJwNgjSfdGgVCejKv\ntEvogpzRMBGtsAAFiGtzLyl/+mf5+LIypKVuxBy5NjHHMmy7gvCGLTrF/m1b\n8v0WI1eigqy5aGpWp5wmecJNJHfZSMEBB1Zk02lfttXuzIWVt8cTEhr1t5NR\n2SsNAtZ+wOsLpdcWsddlQy4wgZCkprcoIb3kjfxjH5w2w1PIwafM1znCVm1d\nTkDDZ9eTI9qYONgkOUtxcmKifsNKRDrwJ0M0CqBu1JqZpnlHI0YYbNEiID2U\np0TLBROnAUzfEnEh5VA6HRuxb7WtNtmWRUMLg0cI0uAoZV/0pPOE6NL49J8w\ng1i/58aPcJjZBBW+HiRfkTZNCSeJoYbGvY39Ee1Bie/uDkOLuF76Pch8867o\n9qj5\r\n=AL21\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGJ4IHnqv2PQtszFUOYV5lh6HM6DWqqCzPsgmXVcSpIoAiA/49jcNxfFW0lf7qEaBq1LvlOS+16CVOejIu2Duk37cQ=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.6b9bfc32.0_1628792652216_0.424493578580053"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.c89ecc63.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.c89ecc63.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.2fb068fb0.0","@material/line-ripple":"=13.0.0-canary.2fb068fb0.0","@material/mwc-base":"0.23.0-canary.c89ecc63.0","@material/mwc-floating-label":"0.23.0-canary.c89ecc63.0","@material/mwc-line-ripple":"0.23.0-canary.c89ecc63.0","@material/mwc-notched-outline":"0.23.0-canary.c89ecc63.0","@material/textfield":"=13.0.0-canary.2fb068fb0.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.c89ecc63.0","@material/notched-outline":"=13.0.0-canary.2fb068fb0.0","@material/ripple":"=13.0.0-canary.2fb068fb0.0","@material/shape":"=13.0.0-canary.2fb068fb0.0","@material/theme":"=13.0.0-canary.2fb068fb0.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"aaa5bd89f698007e7af19bbeeea7c1212b851c35","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/aaa5bd89f698007e7af19bbeeea7c1212b851c35/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/aaa5bd89f698007e7af19bbeeea7c1212b851c35/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/aaa5bd89f698007e7af19bbeeea7c1212b851c35/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/aaa5bd89f698007e7af19bbeeea7c1212b851c35/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/aaa5bd89f698007e7af19bbeeea7c1212b851c35/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/aaa5bd89f698007e7af19bbeeea7c1212b851c35/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/aaa5bd89f698007e7af19bbeeea7c1212b851c35/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/aaa5bd89f698007e7af19bbeeea7c1212b851c35/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.c89ecc63.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-OG+oRH1WSEaRtQJ9x/9yQ/z9PnziOfp0S1UKA1wws2aMJ0U/p6pJbtpsg05SO/WJM630lByW87Xl9t+C+IvaPg==","shasum":"5c6212b6e076145122e0f2d2419255ef71da0911","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.c89ecc63.0.tgz","fileCount":13,"unpackedSize":201593,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhGp2LCRA9TVsSAnZWagAAMSMP/iaCeu5jmBBRo2kJWyrZ\nHRza/P3ZNNSxazu6fkWEx6D61lHtzEmf0S6oEAd0Os+z5GOyT8SIXokJW4AQ\n1RkTKSfZf4o4zMnabuRAYLvKCL36BU0nGIADqEYp91Qyi7hyXcu1LlyiN7i/\n5j9cAbb6RZttYpCTXzlpF9TMK88dU1s3DaWzA98W2B9g7OGT8p2Gjj5s+ZVD\nJLFRuuJQ8cTbdyAqnXo64oCQqWlOrmOKF4DQnhWGpEeaZaUSH0sp6gVfMdOa\n5BqpVZxnXYu+1+eW6o3QNDqYwTYYquZXXTaBqEv58QtJkYVEwhfg4CO5DD93\nb057r6xSKhtaAdsq/hl5uhvaPK+fkxJdkvk7kcJmUpAO+ZTVV8QKvlLBhoLn\n571dnSEIO2XUP+i3ngXhGd7kWoD0c1mXfUOyllNvznXV13BYWLlCSX4Vo4vG\nLxberT2AV1N/Wcmozt6rZvA4ICm03kqHModveeUmnhFsmpLkNbC6j2pdiJlm\nffcPvxdNODpnGTu88xyJj51SlqBz/joTFWAmWjFxXZtqkQnpwYiGkTGDNbMe\nP3xPcutL+9jv17gagFAz6CNuwqkZwh0aAdqOVGVe6aWztlEdgdlckpqnp3se\nA32kSWstzevCnyHpebq1G9U3zsyXOigURc17PiD81N3mhR9NTRq0gRNNmza1\n25zy\r\n=s9QQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBtVRjH3yiyJM7QUjLwMOodCgpKEYb20Q/8wKs9jEgAGAiEAqLIGlaqWfFzXAjvyYWRbDAQHoXd0PxsmGhJ3VXGgWXI="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.c89ecc63.0_1629134219234_0.13565690047872025"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.59de86bd.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.59de86bd.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.457d89aad.0","@material/line-ripple":"=13.0.0-canary.457d89aad.0","@material/mwc-base":"0.23.0-canary.59de86bd.0","@material/mwc-floating-label":"0.23.0-canary.59de86bd.0","@material/mwc-line-ripple":"0.23.0-canary.59de86bd.0","@material/mwc-notched-outline":"0.23.0-canary.59de86bd.0","@material/textfield":"=13.0.0-canary.457d89aad.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.59de86bd.0","@material/notched-outline":"=13.0.0-canary.457d89aad.0","@material/ripple":"=13.0.0-canary.457d89aad.0","@material/shape":"=13.0.0-canary.457d89aad.0","@material/theme":"=13.0.0-canary.457d89aad.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"ac639cd83d2e2bff117ac2f85b2cd2641560a85a","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ac639cd83d2e2bff117ac2f85b2cd2641560a85a/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ac639cd83d2e2bff117ac2f85b2cd2641560a85a/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ac639cd83d2e2bff117ac2f85b2cd2641560a85a/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ac639cd83d2e2bff117ac2f85b2cd2641560a85a/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ac639cd83d2e2bff117ac2f85b2cd2641560a85a/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ac639cd83d2e2bff117ac2f85b2cd2641560a85a/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ac639cd83d2e2bff117ac2f85b2cd2641560a85a/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ac639cd83d2e2bff117ac2f85b2cd2641560a85a/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.59de86bd.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-VwBLTj8+ggxkWv0pbFB867k+KMIIILHXjqAkr3YYB7G0546KG6gNnQbPubviEwlTXMGXJAgCrohV5aa4mtqznA==","shasum":"78564fd62388204909976566e084c0248837bffc","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.59de86bd.0.tgz","fileCount":13,"unpackedSize":201593,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhHGSRCRA9TVsSAnZWagAAsosP/RrEUnQ0LPPkUmFVWquh\nhMFly3UKVDVgg4XQ7relKfcM2ytfWf/d0ZgrSuJ092yQK6yjcx41i98kEBKK\nxbxq+v1pFaKrtaJUkHeJGArmdC7xrAQxWB4BSu3NAA9Nj7wqfa9wqG94gyDh\niBreKXxC/p2XiN/MWG3Yn6S8ZacXxChmy3oAxkA2oXGxo7VNFj+El1RxCO1e\nuvZVBZfy823deSJqmIwn7ywGq5FqxOslyd/gc4QKy3dhCrwQvOCv5uxT2g7a\n9o9JroiF0wgU/yqXtPaZwOArHxME4YpMBtLhx2rxecSqci6+ojmhMDQf6zs8\nByYSbd5BfzoVJBJn1uEwcYfvIVIc3eXXwnqu3y8lE3vZ1q925kLgKkllIZx4\nFQAByOOTufm2SrmsaKhoIOYMwbqdp+dPDEVZhgvag/5EVK5kRHJD7gzMrAdx\nw0+Pq3+5U6qZWqqyJ6q1Yh/WiztdE/aTgOw0QmhTFiL4QtxUCwV4KhpLGgUK\nljo9Wswbj+FBV5uw0GcwIOsNuKSkYw/ISoh3Eri+BrZ3P46U+gL+WVxewfIx\nSzMgIb2O+u69mKtiyth9QPt/+EoQPD/b0qICHShUUlrsBWXAVmmqxqwAdFPF\n+Eqdi/bsvREpDJgzxl9BUGGO9H26msGdg19u6lIY3mxdegC8/VWZIb8408p1\n+kCb\r\n=rRX7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCItrAy+LvaLadyf2SClfnvWYUCIFIVJzZgDgDvTRLwKgIhALyBGlQB+KfSZXFm3ffxkfkLX8G5l24EHP91LtMnyQxf"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.59de86bd.0_1629250704964_0.3207539845813112"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.dcda879b.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.dcda879b.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.43d2eed2a.0","@material/line-ripple":"=13.0.0-canary.43d2eed2a.0","@material/mwc-base":"0.23.0-canary.dcda879b.0","@material/mwc-floating-label":"0.23.0-canary.dcda879b.0","@material/mwc-line-ripple":"0.23.0-canary.dcda879b.0","@material/mwc-notched-outline":"0.23.0-canary.dcda879b.0","@material/textfield":"=13.0.0-canary.43d2eed2a.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.dcda879b.0","@material/notched-outline":"=13.0.0-canary.43d2eed2a.0","@material/ripple":"=13.0.0-canary.43d2eed2a.0","@material/shape":"=13.0.0-canary.43d2eed2a.0","@material/theme":"=13.0.0-canary.43d2eed2a.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"ab309abf464fd85bb1f234aaf8a2ccd35b8e7635","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ab309abf464fd85bb1f234aaf8a2ccd35b8e7635/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ab309abf464fd85bb1f234aaf8a2ccd35b8e7635/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ab309abf464fd85bb1f234aaf8a2ccd35b8e7635/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ab309abf464fd85bb1f234aaf8a2ccd35b8e7635/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ab309abf464fd85bb1f234aaf8a2ccd35b8e7635/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ab309abf464fd85bb1f234aaf8a2ccd35b8e7635/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ab309abf464fd85bb1f234aaf8a2ccd35b8e7635/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ab309abf464fd85bb1f234aaf8a2ccd35b8e7635/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-components-web-components/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-components-web-components/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.dcda879b.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-ynLGvJ/v1YiRn4pmI2pg6c2HIv8KZhvMC2sFpw8rDTXi7CFd65wXvKAIlIjFHnzeUxqMbVxIx2GmEQAyzO0E6A==","shasum":"f5e7b2ceaf44beb3daacce0eba44b7e197c27f84","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.dcda879b.0.tgz","fileCount":13,"unpackedSize":201593,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhHYhYCRA9TVsSAnZWagAA+kIP/0/MtmIZAk8pbyocAStX\n2wusBPyYrce3xBLuHDjM3czgo2DL5TpcIFwayfEAhdqhhjxomB+k2WPXX3Mq\nCQBMctf4Cc+LdKfLbg1Esg6rolz6ppjKK/EMZ9/CAAp2gRMMppVcTHr9HTuZ\n0zE2kr4tqTmp5rgDtKj+zuIBDg06lGjq3O/L1HdeAbDj/csH+6Pcm8Ua9oGB\nf6O5HISB3HpwOZvFPJJMhB/nzOHrKa0IEC4JhZgk7WXfW43xfa5Qfr4kq/Ct\neSl45w02wSSWGzASqwhc2gAxgB/D71Px0iJ9Thz301DmCOhy+E19E3deRdgM\n+tzS+NfBh4AcN5qtTHEwdneBvo6JgZbcYa6IrxHLvGICweBJz26zxLDyFM8w\nHREX9RChTgU1NALbgrUBFkWxqmWUFJxPvN3WHILimf2sT+UaxclOJjgK6Dao\n1DvwKlgVF80ddzao9XIuM/7B8R0QOLUiDruxBKfgcx60j2odVggT3HEG1HBf\nO5l/rXlB3kxzLRczYx5YURwTOkH/YXeKN0gpw/VHwiTdXFxsyf8kvDx4ckE4\nuYwb/4GV07hvwFZOFb4sTUj2t5MQu6PBzNRrmz0VM9XWyI30WcFN0DLJIuRz\njGMyrb7t5s7OCYU0UeaxyMEOZBTy/hC29eeAu3Z3/8qZe4Bb4LsB4uTouSMJ\nzSCn\r\n=c7Z8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDWlP2sDy/sFbAfHpR75F9ayrT+M9F5hv9mOZotVEKwwQIhAI6ef/PTzozz1dHlHUiUP1xHxOzB0+B1zg23r73XxzQE"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.dcda879b.0_1629325400114_0.04345837886299564"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.dbb8b366.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.dbb8b366.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.43d2eed2a.0","@material/line-ripple":"=13.0.0-canary.43d2eed2a.0","@material/mwc-base":"0.23.0-canary.dbb8b366.0","@material/mwc-floating-label":"0.23.0-canary.dbb8b366.0","@material/mwc-line-ripple":"0.23.0-canary.dbb8b366.0","@material/mwc-notched-outline":"0.23.0-canary.dbb8b366.0","@material/textfield":"=13.0.0-canary.43d2eed2a.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.dbb8b366.0","@material/notched-outline":"=13.0.0-canary.43d2eed2a.0","@material/ripple":"=13.0.0-canary.43d2eed2a.0","@material/shape":"=13.0.0-canary.43d2eed2a.0","@material/theme":"=13.0.0-canary.43d2eed2a.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"9def9b810923fb3cf5946b62d7be5df5ae926fe6","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9def9b810923fb3cf5946b62d7be5df5ae926fe6/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9def9b810923fb3cf5946b62d7be5df5ae926fe6/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9def9b810923fb3cf5946b62d7be5df5ae926fe6/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9def9b810923fb3cf5946b62d7be5df5ae926fe6/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9def9b810923fb3cf5946b62d7be5df5ae926fe6/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9def9b810923fb3cf5946b62d7be5df5ae926fe6/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9def9b810923fb3cf5946b62d7be5df5ae926fe6/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9def9b810923fb3cf5946b62d7be5df5ae926fe6/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.dbb8b366.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-qtrY8tK92S265WD9yMpto5BDeXfB9JTvU3cqMpQdNcFA3SQPQmwh/gn34LID74yQkxXbaKWJNWt7kiCDpAo58Q==","shasum":"c120c807e42e534ec06ae43dd406a976aff05072","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.dbb8b366.0.tgz","fileCount":13,"unpackedSize":201483,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhHuKGCRA9TVsSAnZWagAAn5sQAJnXggxKZIABZfO5Yf0h\nTRLUs7soLdL7Ef5g6AXZRfydxxnu1ds81rE4Y05r7KYt/L2TWKSpKJ79KpL1\nd4TdAtk+5nNu9AJkEJZC0D/0kI+/MWJ2mWWNnE3vcMsMr4vB4hWky0fNYuE1\nlHG0Xd08qE2S6W5gNrO6VRurQamGyzA5+0KHdPN+mgJWsz/dww+KNHrCD3nT\n1aZAYAeLrnUxn+JoKuKNo833k/RRsnQsvXa5uNG2+hpq8rBT2E4gReHzxmNe\n76LbFK8/3FHkVVSy5DrbOOKgOi9SqL3WL0jbo30lYCmKrZAlLWO6K94LzXVf\njac0c+9hO6C+K/2CAeM/tJP+dRfG5nbuwNnhsVyYw1eTrk9UPWRrsPPAUHJ7\nPc8GAMVkI3YhUeWdLQTZ896R1PRJrnYPEtlfu88ZAZBdCAc6Zjdp2VVX6vZE\n35lQyylTwBAS2kTJRH4RlKVWJB/LbSbmnJcKbTEUe3ky1OlwDkcwQ1EZ6p/v\nbT73lUtt6c8Ek8NOeR2wpF/B2FgEXMSEJDGHLVk+T/8+vzP8Hh9Xk7l5kVtw\n4cWuAPlNypGM336EEG1SU1HN3Sfxco1AfA/dC0kWsSyRo4+doSnoClOsO+4a\n59NvGivwD4qdvbVd7mw7ZPyv4DoB/o70aGalfhxEIWhbkxDzYKKvsk+I5civ\ngnvH\r\n=BkXE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAJjEiWxqiiVQ1VA8/lpfuICYbn4LGrcCPcBNBlJcVW3AiA3kp6m240up3ulbH3SRWPf3LsyVVW7y9vTQEK1ePU8ZQ=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.dbb8b366.0_1629414022578_0.24255784495520838"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.c6e3060c.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.c6e3060c.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.43d2eed2a.0","@material/line-ripple":"=13.0.0-canary.43d2eed2a.0","@material/mwc-base":"0.23.0-canary.c6e3060c.0","@material/mwc-floating-label":"0.23.0-canary.c6e3060c.0","@material/mwc-line-ripple":"0.23.0-canary.c6e3060c.0","@material/mwc-notched-outline":"0.23.0-canary.c6e3060c.0","@material/textfield":"=13.0.0-canary.43d2eed2a.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.c6e3060c.0","@material/notched-outline":"=13.0.0-canary.43d2eed2a.0","@material/ripple":"=13.0.0-canary.43d2eed2a.0","@material/shape":"=13.0.0-canary.43d2eed2a.0","@material/theme":"=13.0.0-canary.43d2eed2a.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"2c417f32674c7318ccfdfa842a3a2cb3d57853b5","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2c417f32674c7318ccfdfa842a3a2cb3d57853b5/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2c417f32674c7318ccfdfa842a3a2cb3d57853b5/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2c417f32674c7318ccfdfa842a3a2cb3d57853b5/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2c417f32674c7318ccfdfa842a3a2cb3d57853b5/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2c417f32674c7318ccfdfa842a3a2cb3d57853b5/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2c417f32674c7318ccfdfa842a3a2cb3d57853b5/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2c417f32674c7318ccfdfa842a3a2cb3d57853b5/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2c417f32674c7318ccfdfa842a3a2cb3d57853b5/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.c6e3060c.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-DQroc6zwaOd6JmlSmvCdujrf1PMVDkHy/0UXYbPSQq1S/wdtBaaLKDYwEual5YY+np0N29SSHMl+kKyIX8Q5mQ==","shasum":"afae3016970c1d3c672968cd7ad93aebed429250","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.c6e3060c.0.tgz","fileCount":13,"unpackedSize":201483,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhHuL2CRA9TVsSAnZWagAAo7QP/3u7pKKlI9UOF5XI2hqH\nmsnE1nI8UwhOjgiZ43RVRKi448c7QTuVnLbf445s9NgmlH0cVcAAAJ/kTMEt\nvmay02KDEi3kEvK0lveChw6easkxGjTdsYYP5fkvPSc9UOYJetxyzJMgXyQl\ndmPHx+t1HruexnSNkC6tjLADYIM0iDdRSJzDdxNCPFOseryXhzldD2C/suph\ngS7ne7zKHyoXg0mna/gDyp2Sit3ARE1cgh4tBfA24Zhw7lPio2mcZAAP4ct3\noHs+gVQaHsKho3PbPaioGTvc61BjyMJlIByGj2r2LXGTsqEumj2Zqvgnv8iB\nCc5gjAsJD6h09ezcso8C4l7YKMo900YHoyc9deAwNIrJArlgq0IavHBl3LUA\n3spSGYuY+s56ke4EKPj/vU/Tjr6aOungZ1h0MNjEMC30k4cV8eflSq7ebdcp\njWPl2xxUdPe/XirUDon+VvNVHqBswKqiEvibsUm5QlUsYdE5KzbQrMhifBFG\nHwWOr+b+Q3XEARyYjj5iyeeNNIbayfTgllDj8YTcGrIQ41qBuiPNmeGaJ3Xr\nk8b9821uvk5ah3LZd+PPPsObJenhTut7ykUMG9ojo67niSCN3+LJqG4ya7CX\nclzZzDIz48V8DxoOSJY1YXwwnHAe+KkWz65nh8w50icG6sEC5narOMHjAqqw\nowhC\r\n=Cwk6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBDNVIdHp/iA2+8BJiE17fWafMeJIGUYwBv35GmKaiZYAiBkpxGBwmaxCTMgd2Omu9KtGYEyr7JINpKw+7sMCGzm0A=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.c6e3060c.0_1629414134131_0.719390744693081"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.03120b7d.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.03120b7d.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.0a9069300.0","@material/line-ripple":"=13.0.0-canary.0a9069300.0","@material/mwc-base":"0.23.0-canary.03120b7d.0","@material/mwc-floating-label":"0.23.0-canary.03120b7d.0","@material/mwc-line-ripple":"0.23.0-canary.03120b7d.0","@material/mwc-notched-outline":"0.23.0-canary.03120b7d.0","@material/textfield":"=13.0.0-canary.0a9069300.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.03120b7d.0","@material/notched-outline":"=13.0.0-canary.0a9069300.0","@material/ripple":"=13.0.0-canary.0a9069300.0","@material/shape":"=13.0.0-canary.0a9069300.0","@material/theme":"=13.0.0-canary.0a9069300.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"ba0dc47ad891e00a21e2d69aec6ec4c6dc83e003","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ba0dc47ad891e00a21e2d69aec6ec4c6dc83e003/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ba0dc47ad891e00a21e2d69aec6ec4c6dc83e003/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ba0dc47ad891e00a21e2d69aec6ec4c6dc83e003/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ba0dc47ad891e00a21e2d69aec6ec4c6dc83e003/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ba0dc47ad891e00a21e2d69aec6ec4c6dc83e003/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ba0dc47ad891e00a21e2d69aec6ec4c6dc83e003/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ba0dc47ad891e00a21e2d69aec6ec4c6dc83e003/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ba0dc47ad891e00a21e2d69aec6ec4c6dc83e003/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.03120b7d.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-folwx1j8UTQpjg4rPHUcWC/hHKHYN9sV8i0/WGScVrCqFOrcs3R/sBzESkBYmME7URbwwY8SX5Z7Oahpv8pgeA==","shasum":"523801b2f98bcd8bd9eeee1a12e575b07982ebd5","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.03120b7d.0.tgz","fileCount":13,"unpackedSize":201483,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhHvblCRA9TVsSAnZWagAAgiMP/jt4S7XWmEQpxpUdpmGF\nsiwW9z4N6hHN0Yr2yq5VcGKiAy7iBQ2LCRzRhJESUw3WFj8KAgXd73truRGk\nzhDcNo8kI9pdQXxKSFQz1u6uIi1FJ8g/8KQysfnS49LPaQHa9UDt0oC8cWaz\nZZjrYWdFB4zGzsU9uXVdlNtUo0pHKWiGMvP7H7DG5v07KRCfXjcvZmGv0PhN\nF2JqpE2toFGYgGhiHGFNWOyTHl6iQz7MWYEozKBr8h6CWCLcupleR8rHMCwP\n3ppyHudvCvVudiQ9CPBeeAV2usUoH07UEPUYuO24FbfW3oJy6KE+PMIT69w6\nqOwVggc+f6VezOr3oYAHjhbGg4twyMWQWwOxduQDLKZym1Pa0BVnd1Fcl475\nDlzsjL9NS95NnZRoltevaybX9gok8VfpKkBVFKI63RGnyfo+KMHnsVr2NguY\nDSPtM+uDKnH5upK4FLAPOEqIs8oSmDlXPMAZ44+5nkYQFSSsawzUR7xtJ8Rp\nwITXc/lSwuUx4e6NAj3cW+wMRZbXtTJVLiuvaagCWsNpEYnUU2j2mQz3/XY9\noINeoYEldcndgWcMA8lBvClsGvksgt3NDZIBmf9fp1x2LEBdBx55tAj0yOd8\nnirUA2f6n2GkkwrjDRnGlsIAvOftGGzkMrhBczlStgX1226MiMjYc72lF+p6\n2OxA\r\n=6VAp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB/5LbOEbCAZb1dPKBIeKMoe4CgzvECI6WNBqs/WXN2RAiEAi8OZasE3mZUewi0yUqhnDeIQKOBV9o5gcSEuIAfLQcU="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.03120b7d.0_1629419237041_0.5554996394753837"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.d75a5f74.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.d75a5f74.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.0a9069300.0","@material/line-ripple":"=13.0.0-canary.0a9069300.0","@material/mwc-base":"0.23.0-canary.d75a5f74.0","@material/mwc-floating-label":"0.23.0-canary.d75a5f74.0","@material/mwc-line-ripple":"0.23.0-canary.d75a5f74.0","@material/mwc-notched-outline":"0.23.0-canary.d75a5f74.0","@material/textfield":"=13.0.0-canary.0a9069300.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.d75a5f74.0","@material/notched-outline":"=13.0.0-canary.0a9069300.0","@material/ripple":"=13.0.0-canary.0a9069300.0","@material/shape":"=13.0.0-canary.0a9069300.0","@material/theme":"=13.0.0-canary.0a9069300.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"ffbe861a3137fecad60074a6f36ca1061f940cf2","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ffbe861a3137fecad60074a6f36ca1061f940cf2/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ffbe861a3137fecad60074a6f36ca1061f940cf2/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ffbe861a3137fecad60074a6f36ca1061f940cf2/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ffbe861a3137fecad60074a6f36ca1061f940cf2/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ffbe861a3137fecad60074a6f36ca1061f940cf2/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ffbe861a3137fecad60074a6f36ca1061f940cf2/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ffbe861a3137fecad60074a6f36ca1061f940cf2/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ffbe861a3137fecad60074a6f36ca1061f940cf2/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.d75a5f74.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-+M0I6hTdaEg6wkqdbRoC+ho9KCIMwTJ1BfKNi8dBsXNMd6OZMrU63ec6Fb2NOWU1RpDQYhecQQGlTCSvI3mjPw==","shasum":"d52d3e4d165d78e037670df96df451ee98950950","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.d75a5f74.0.tgz","fileCount":13,"unpackedSize":201584,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhH2AjCRA9TVsSAnZWagAADvcP/ReeN2EBdqF8oUouIf/N\nsgfUNs9voqR7YlJR8o6ylkXNXD4828B4NdSMTi5T2ev5Lz39wYNJtHA54ueN\nwjvYfXVXHd2NxHRufLiq1lW9Iu3icNsh3Ri6tVpLyMTv7nj0ZsrpBFIJfda2\n9LAtgNUl6dgIIfJHQFIMFje9dVIIcGkFSMI7xTKm0TDeNX3JQzwt8viZixOV\nrIPNlOuNxgjqDavjk7fk1s1dKcY9EPsXljLgHbQFuawbYiGKiWeHcKGd/fK7\nBNCeTS/qHhKynn5Xgio5IScJISAnPRVhle7qDDtlPytapL+xyDhuIQGSNPGQ\nrKwhYrMLAWvM85A6F/GAETZhzt4O8XFBjXWvRJnxZ/92d9bineYzEF6gw6H/\nkgQiQ31J7BKrLfZUCvRhQ2YG3ibib3NY1tyyOb4QwJ9e2TWlTuy3ZyUJHA9Z\nMxAb4VPbf4Ic2GrWPGusgiGAH9ls4nzOG4ZfncEX9Rd3Z7jBLhBGN1kottlN\n4h9hZ/GqXdAEyJqdfZUzsw7Q08H7c6f25wTIbDI/BiIKBgurhCq32syC0cJ+\nFGrI9tMgMlDoy1uxxXOZtdqpI/AX+PBFnW9BmW8D5q8eBUC3Zlmq1MqNn5nN\nSK/7ywBzwJdtC6j9mUnqSR9sPuTbdUoCl5/rVZYqrR5pOjpiYm1D6JbDBjyL\nbQH4\r\n=qKpH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHxeK9DCJAO7zH69e6Es+HpELzN2ZlNsfSEoks3DtNB1AiEAmIq7YiaBFZPLt+PIrj46sYhwgRjT13YgFfovRkZQ/BY="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.d75a5f74.0_1629446178885_0.5196284322762907"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.3d79ffe7.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.3d79ffe7.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.0a9069300.0","@material/line-ripple":"=13.0.0-canary.0a9069300.0","@material/mwc-base":"0.23.0-canary.3d79ffe7.0","@material/mwc-floating-label":"0.23.0-canary.3d79ffe7.0","@material/mwc-line-ripple":"0.23.0-canary.3d79ffe7.0","@material/mwc-notched-outline":"0.23.0-canary.3d79ffe7.0","@material/textfield":"=13.0.0-canary.0a9069300.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.3d79ffe7.0","@material/notched-outline":"=13.0.0-canary.0a9069300.0","@material/ripple":"=13.0.0-canary.0a9069300.0","@material/shape":"=13.0.0-canary.0a9069300.0","@material/theme":"=13.0.0-canary.0a9069300.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"4d51b5574d0d1d8166f9358a39a5d3f2b4c728db","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4d51b5574d0d1d8166f9358a39a5d3f2b4c728db/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4d51b5574d0d1d8166f9358a39a5d3f2b4c728db/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4d51b5574d0d1d8166f9358a39a5d3f2b4c728db/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4d51b5574d0d1d8166f9358a39a5d3f2b4c728db/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4d51b5574d0d1d8166f9358a39a5d3f2b4c728db/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4d51b5574d0d1d8166f9358a39a5d3f2b4c728db/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4d51b5574d0d1d8166f9358a39a5d3f2b4c728db/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4d51b5574d0d1d8166f9358a39a5d3f2b4c728db/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.3d79ffe7.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-xFkpwcTXDGt77QOuecHiBi/ZDT62ciIh+m5hfhMBJixnr8bLpux/8LU1Oy06EWWcYjBgEt2DL6HrZNSgz8DItg==","shasum":"3c575c13799964aaaf8e11aa401acaaeb76168f6","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.3d79ffe7.0.tgz","fileCount":13,"unpackedSize":201584,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhH+SbCRA9TVsSAnZWagAAOnQP/3cOWSXLCzNIaOgcOFoI\nDToxlETM0EsNMq1MixkgC6WNU1k7RVbTDfgnzdYmFz42lqsUiQV/+thlEjCT\nWcX3THVbwOFQr0SC2eRsloA3M5hx1gON3q0N6Zo4XkhhSJaD6nKKLODlD8TD\nZa25kpo8IxlpaNCsw6sXjKNK93ER91I6smiev26uZqyOg/4HF01XVse5dFAM\nuhTgj2fTYRaesk7vK7VMzGNZVy+hT4KrKGE1JEZ13BxSfrkTiGCejqY9SkoN\nZxnJv0PR9APLiUdkeall/hwA2nxG76dWtaQSklLBS5xdiuxQQMRcjT6zDprN\nmRmP2F1YhKIcZyd1Qs9VKnqjlD4Hmy3j91lsPNjQTVKxqgg7N+AxOsPrF3LS\nPvb6GIWFR7mGi9hQeGLkK3+1zGGueI72MMkZ+bIyB5HVoaR6eUNwFyEUtodw\naCua8uFjs4Xp/pwq6rLmUbBrtdiX6bvFPCC+uM4eGMObedgtvf8773LUERkN\nxrXQ78bNgUD7JvHi50u/x/YEuew7xvMEK+cJ8HvRjsiFwEa9gQJ4h52YX0IT\nZsMDwoYz1KmdnEahTnQTn4wgFZpsAmfBhp9LuF20BBcehTa/wFLY1FbieiL7\ncIiFftjBvTw2zxcTFleQHiaJvPEIoRgtc3kUYpjtT9CHJ8MN7VqOOI7F0vYt\nJ6ni\r\n=iM3u\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCqJaqkeqTABAIIb2fsOWoiqK4POHmPqP3NWrX2PhfO6QIgWm+vGRFI7MBjJ5jP3KwxZlZcgoKuvlRmbKU6l+9qpIw="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.3d79ffe7.0_1629480091392_0.04119357481697339"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.02213ebe.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.02213ebe.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.0a9069300.0","@material/line-ripple":"=13.0.0-canary.0a9069300.0","@material/mwc-base":"0.23.0-canary.02213ebe.0","@material/mwc-floating-label":"0.23.0-canary.02213ebe.0","@material/mwc-line-ripple":"0.23.0-canary.02213ebe.0","@material/mwc-notched-outline":"0.23.0-canary.02213ebe.0","@material/textfield":"=13.0.0-canary.0a9069300.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.02213ebe.0","@material/notched-outline":"=13.0.0-canary.0a9069300.0","@material/ripple":"=13.0.0-canary.0a9069300.0","@material/shape":"=13.0.0-canary.0a9069300.0","@material/theme":"=13.0.0-canary.0a9069300.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"fb5a30909287b897d793fe4c7cfca2cc93cae697","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/fb5a30909287b897d793fe4c7cfca2cc93cae697/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/fb5a30909287b897d793fe4c7cfca2cc93cae697/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/fb5a30909287b897d793fe4c7cfca2cc93cae697/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/fb5a30909287b897d793fe4c7cfca2cc93cae697/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/fb5a30909287b897d793fe4c7cfca2cc93cae697/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/fb5a30909287b897d793fe4c7cfca2cc93cae697/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/fb5a30909287b897d793fe4c7cfca2cc93cae697/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/fb5a30909287b897d793fe4c7cfca2cc93cae697/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.02213ebe.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-z1SWdOB7anT+0msPoGoyturQU2ztQEMAWgNYN7/CPi7Utb5WB0ftgDaLtg9K8FaQDlkJqEt4n8K/53nMXgDHPw==","shasum":"5866bce527ee4c81533b91974627154746a433e2","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.02213ebe.0.tgz","fileCount":13,"unpackedSize":201584,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhH+W0CRA9TVsSAnZWagAAvgAQAI+5FTf7e94y5vn024BD\nDKYL/mm1LjReiTA27HR7cTZTIWHRc4k+mPZgZSYUU5DHYwtw+J+vwJ9M1TdQ\nQZ315+Zhs8ZTo0nKnHXqAOSMPwVW/hmPLcB19sWtixkxOsh5YaqfxQDB6Y8a\nzbt1o9ydNUn9N1jSC78Sq9maA3anavxjcqNQNb+hfyZCcDULF9j6TTHY5SVT\ngPmIBVOdjkZUwlNhRBay7Z9EPAxQyq5x8TDPjkaxIhLGSu6JJqJ2dvilADiJ\nySWhWMm9lQaLL7EO8//1R0BJEDXGoPZjVNduQv33JAmiATZGmWknI4DTOhTH\numNjiKbsDTGT7QX35ydt7TrEmQed+0NACJ/SqPjxsFEVuRyGXgdai9rQtDVB\nF4vq9pqTLyHWlH1p5CXqrMXATY2Yg/wedTcpY0z8+9qnEPer0ROnhJmxr4Ui\nw+JUvcyKj4ugDFB3/jrfxDd72GPXXJdGDhWkZWS8aSt2FlmXzJlcT2Ieh5k4\nRwJj7ebcc0NSt3/wrwAHnWh9MJVuXFGUEWjP4ioaX/a54GABV42ElMTUZxAt\nW8qpbvDxQRz8iVCpYmeQWlpRIzqch4IY5Z/YxYu4xJx49JydXB5WGyfdyn9T\nr6WB1Qh/ynemiYTfNVdn16GbbamahEcYxpj5Y5/gV7GDir/yFyEax5IUQlEC\ngAdx\r\n=3/Xd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC9iLV9WD+6MQj5gYRRPS4rTCEBoBflTNJohRH44NqDqAiEArgWp3OhDNrFgbfvGWC7WgBanCxwNvFNl7IVr80DniZ0="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.02213ebe.0_1629480372387_0.7855972186440054"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.90a999b9.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.90a999b9.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.7da413ed8.0","@material/line-ripple":"=13.0.0-canary.7da413ed8.0","@material/mwc-base":"0.23.0-canary.90a999b9.0","@material/mwc-floating-label":"0.23.0-canary.90a999b9.0","@material/mwc-line-ripple":"0.23.0-canary.90a999b9.0","@material/mwc-notched-outline":"0.23.0-canary.90a999b9.0","@material/textfield":"=13.0.0-canary.7da413ed8.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.90a999b9.0","@material/notched-outline":"=13.0.0-canary.7da413ed8.0","@material/ripple":"=13.0.0-canary.7da413ed8.0","@material/shape":"=13.0.0-canary.7da413ed8.0","@material/theme":"=13.0.0-canary.7da413ed8.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"2c4d7acf2d3387438092d8cf5fa7ba37ca3a8b8f","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2c4d7acf2d3387438092d8cf5fa7ba37ca3a8b8f/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2c4d7acf2d3387438092d8cf5fa7ba37ca3a8b8f/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2c4d7acf2d3387438092d8cf5fa7ba37ca3a8b8f/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2c4d7acf2d3387438092d8cf5fa7ba37ca3a8b8f/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2c4d7acf2d3387438092d8cf5fa7ba37ca3a8b8f/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2c4d7acf2d3387438092d8cf5fa7ba37ca3a8b8f/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2c4d7acf2d3387438092d8cf5fa7ba37ca3a8b8f/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2c4d7acf2d3387438092d8cf5fa7ba37ca3a8b8f/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.90a999b9.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-4T21lQXhv2Wr5o5r4IfKvywbDBKxuR+22NTP6RY9AFciZ1+7QQ6aw7CIEiLkx5tkzgAX+GXF1ffJr6z6RitC7w==","shasum":"2f816dff293398324ef2e7120d26b2d93a4a1c74","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.90a999b9.0.tgz","fileCount":13,"unpackedSize":201584,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhH/efCRA9TVsSAnZWagAAiWsP/iMNPfVVIkP7HRbzzL1L\nPn4VTalYJMw2r/laFUE3UsL6YlXR8M+4vImtNJHtrVJhwcXODfexJMW3FhE3\ntNTurDY3jG9vjRHHNqH8WaaF6ZLV1HlRChTBqRT/bRVRZ64+9cbmriHJ1UTF\noXUL8dI+eSUbTRqWwvDHXcvuVi71WZSQKlI+L1L9dRAY/a2KXkDTOMjqoD9z\nliD2YFxpk3cSwvnm3/bcNdyU+t5BOS/QMKQvKhNfnPtPM0OQHw5LDi5jZiQ6\n4xifEIhgWv/yACm8u1xCzGIv8BEHzglM5Wampdyc4g6R7F4CwhAn+HqmFANb\n0SnhMmdE3LoqMEpH8H8nzlQjWN0aciNxegFWGPyysbCcYEaCcH+jHD1pE8qj\nXj4OPuI+i5+0X4uqiEd6Et8Y+oASwveS2JxXHicuL8U13wuGPKJ2TPeY8Zj/\nr3NcV/SO0BcV1N3FaH5izuG6GzbYGy9W7f/kgP9aDHUtjuZ/gLB5378a8jp4\nxjqsXX+HQIyMk5td0SEh6uK6N83RkB+SWOmteNYAsV6ppiKuq5XAtfcCu+sX\nr0/0AUS4RnRom8schCII3HHfmogQBFkV2QRvkNBljILhBS5gwl8YjJtA2yFU\n6RQPEBYzf6ziyN6KJ0u5D3rTwf+aKIKPpL9RHjMhJDSwVjSgfOx3PVXD2uSr\n0poG\r\n=7+eu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDTCifpgM0USJkrYXaXCDLFbT6eSIX6aFYzni9OtcPhaAiEAg/xX0+0unY8KbVbzVF9+u9G1DGZ1b/lxaCQ2UXgxG2w="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.90a999b9.0_1629484959696_0.3549807644999745"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.6db58716.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.6db58716.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.7da413ed8.0","@material/line-ripple":"=13.0.0-canary.7da413ed8.0","@material/mwc-base":"0.23.0-canary.6db58716.0","@material/mwc-floating-label":"0.23.0-canary.6db58716.0","@material/mwc-line-ripple":"0.23.0-canary.6db58716.0","@material/mwc-notched-outline":"0.23.0-canary.6db58716.0","@material/textfield":"=13.0.0-canary.7da413ed8.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.6db58716.0","@material/notched-outline":"=13.0.0-canary.7da413ed8.0","@material/ripple":"=13.0.0-canary.7da413ed8.0","@material/shape":"=13.0.0-canary.7da413ed8.0","@material/theme":"=13.0.0-canary.7da413ed8.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"187faecfb35a3d9f67ae8a6ae1c83b5f796d3158","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/187faecfb35a3d9f67ae8a6ae1c83b5f796d3158/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/187faecfb35a3d9f67ae8a6ae1c83b5f796d3158/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/187faecfb35a3d9f67ae8a6ae1c83b5f796d3158/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/187faecfb35a3d9f67ae8a6ae1c83b5f796d3158/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/187faecfb35a3d9f67ae8a6ae1c83b5f796d3158/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/187faecfb35a3d9f67ae8a6ae1c83b5f796d3158/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/187faecfb35a3d9f67ae8a6ae1c83b5f796d3158/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/187faecfb35a3d9f67ae8a6ae1c83b5f796d3158/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.6db58716.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-69y9MWm7/oa2DBp8H72EqmUGH/7MQqpjLj5oxegZySVEIn72KYFzRnJ4l4oC07IrBJjJtS7XVCiEz3vEeBNfPQ==","shasum":"cb9b186e41bae412b601d7277f5ec077c98a5830","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.6db58716.0.tgz","fileCount":13,"unpackedSize":201584,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhI2VuCRA9TVsSAnZWagAA+/oP/R6qb+vxpE7cseITcDcX\nCKCKuEykob5hTGL+9sectBF+I56Atgfx7KwO17izUcL7WB4JYv5Ec2jaEgdE\no9/9+wHbMJzKu3l9BsoOk1nA7U3sqfQBjvKWFJNjZn3y2LIUoUthiUpGq0uS\nRdogyhpvRxuf1ZzNcDJM2KeaXvVJhF6L9UPG77swPYc5RQ1y2I80qiZVQIyD\nEKxPsjtzay4y+hYxoobcAgpLgVkR3zpp6yCMwwlkzt9ltTOpCr5MYnreZL+5\nxka3OSv8RmJNEFcBpTnjXHbOMHp2ST+p4patGnyI6H9r3xovBFJdwdow952n\nnNBtP+PYD4EacVFcR+rpDR6hC6ny9I604xgBmEYAw14Wq/8h009vVK3mnXDJ\nh6qtyMaS3dvrHcYnWnReUt4R9dDAfZT/J++M1QF7xioe+NCp4f4jN5PGGdvR\n/q8hk0H5sqb6BSbk+fN3nNEMYA7kzOPd3KOYzuSJ7tj3gdvBce0Zy8/msoKA\nLhg0ilRCH/kWXq+idaVM4JFxkjyY32ZMEmmB/qoRN5driY0R4N7Dglo/B1No\nfWXozRezYi+wc773JU7U8ToqkEkqQyUpgA2T+gqXjq/6t9CvxEl+KzwlNWHN\nkSSyG1rE5V3i+18ygDR6Xr98ybKQjXIxdK14D++pDp5m5x4Xmssx8fRMabQP\nISR+\r\n=+H0G\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDYxssZ6UOeDGNYjJ8sVHjJznvt049ILtz5XkPah/AOwAIgcebFINSFvyoEvpAMyIOgIm5+jp+++RpRGdT9gzNxUz0="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.6db58716.0_1629709677983_0.2558798922546548"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.9fb5bc35.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.9fb5bc35.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.7da413ed8.0","@material/line-ripple":"=13.0.0-canary.7da413ed8.0","@material/mwc-base":"0.23.0-canary.9fb5bc35.0","@material/mwc-floating-label":"0.23.0-canary.9fb5bc35.0","@material/mwc-line-ripple":"0.23.0-canary.9fb5bc35.0","@material/mwc-notched-outline":"0.23.0-canary.9fb5bc35.0","@material/textfield":"=13.0.0-canary.7da413ed8.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.9fb5bc35.0","@material/notched-outline":"=13.0.0-canary.7da413ed8.0","@material/ripple":"=13.0.0-canary.7da413ed8.0","@material/shape":"=13.0.0-canary.7da413ed8.0","@material/theme":"=13.0.0-canary.7da413ed8.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"492fb41175c44033912a37c69d8362579b70d081","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/492fb41175c44033912a37c69d8362579b70d081/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/492fb41175c44033912a37c69d8362579b70d081/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/492fb41175c44033912a37c69d8362579b70d081/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/492fb41175c44033912a37c69d8362579b70d081/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/492fb41175c44033912a37c69d8362579b70d081/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/492fb41175c44033912a37c69d8362579b70d081/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/492fb41175c44033912a37c69d8362579b70d081/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/492fb41175c44033912a37c69d8362579b70d081/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.9fb5bc35.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-oCxUWB2MrGSkO/yXvqRvWD95kEIrM9DptlXsWGU0L6gykQKMlJfvDg6AlCkjQbOlgNAuXE1I16FOXfx8muVSog==","shasum":"de2b50ceca5e0cc658fc16560d4b515187cfeb34","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.9fb5bc35.0.tgz","fileCount":13,"unpackedSize":201584,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhJCYoCRA9TVsSAnZWagAAtikQAIqcV2yeDGbxCnm57U93\nENbIStnuq6+X66X7m3OKMD1LWFZ0cBCzUjp/xdXkeAQfxfRtpZ/IXENsVzvo\n46NmMAj9xLg5jU38LxaBa0fTt9RlpG2ufHLB8r7UqpzMYz1for5Pbqm3MjCN\ngJ3Qa6bt63ggaHCJWIkhoRLnYpunod14sSVkRTcfv8VEgNI+afSDlILxCKw6\n59mM4iRHfoSmrGpJsf9g+ik0dvTaS9FICPYSdDayc6kb7EF0dgT2yCSe5EgK\nxeqN9Tnli031GvEPQyz1YwbgTIKQc0z+z1UQOQU4QJahQo9AMgLuMSNcw8EN\n5pqqshbFMeT6Oe4HfiY5zXdruQmYOHtE8Do1M5p4YDjErVtRqk/YOLtgslp0\n38ywylf4EhpH6oAjkV1RprDg49ybjLdbCQab4GBhKz3RK7T+RU7xjxx6UXC6\nxkmD4KTH+Jz17H0Ouozf1jcQ1zXIppUoPRNeoGWJK9fA0tntE6WZ95igcP/k\n5Cmc6Py3WOvGbN9FflDOZGEi78KU5zIiQ7H40KLIVOYcxIY3H5YE+rsi4pYN\njPIs6Zp/uvYd2/ybsbBRBWuVIQr/YbjcWLG1rDoQT5nE9f8uvAM6CrRH7i8z\nKB1aVQLQextA55yqHJsIdm+4UTvbrCj6Ovjooh8ia6OAZt4kUHPHqRvEr//y\n0Onz\r\n=Cz0f\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEPjMGm4MWq0YIpw0I2opPVVCHN+jyVhPESVAMvvcU3eAiEAj23T+jU53QZH4mr2M4r0JkPPBtRWv0VszGZUyzRbARA="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.9fb5bc35.0_1629759016318_0.631937180448148"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.ddaa5d8e.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.ddaa5d8e.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.15981e9d9.0","@material/line-ripple":"=13.0.0-canary.15981e9d9.0","@material/mwc-base":"0.23.0-canary.ddaa5d8e.0","@material/mwc-floating-label":"0.23.0-canary.ddaa5d8e.0","@material/mwc-line-ripple":"0.23.0-canary.ddaa5d8e.0","@material/mwc-notched-outline":"0.23.0-canary.ddaa5d8e.0","@material/textfield":"=13.0.0-canary.15981e9d9.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.ddaa5d8e.0","@material/notched-outline":"=13.0.0-canary.15981e9d9.0","@material/ripple":"=13.0.0-canary.15981e9d9.0","@material/shape":"=13.0.0-canary.15981e9d9.0","@material/theme":"=13.0.0-canary.15981e9d9.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"b75a351219e35d414333913249ef19e87282526d","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b75a351219e35d414333913249ef19e87282526d/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b75a351219e35d414333913249ef19e87282526d/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b75a351219e35d414333913249ef19e87282526d/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b75a351219e35d414333913249ef19e87282526d/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b75a351219e35d414333913249ef19e87282526d/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b75a351219e35d414333913249ef19e87282526d/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b75a351219e35d414333913249ef19e87282526d/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b75a351219e35d414333913249ef19e87282526d/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.ddaa5d8e.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-P3wLdalga0I/4tM0EFVRIhWVFZhzAT5FqqS4s2aS5yYJkC14E98Ea6bRJESxdg73sGVMseob2DzqzHjWCiN7Og==","shasum":"6f394d7a61fa948cd7c938e7de70d203865a5f34","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.ddaa5d8e.0.tgz","fileCount":13,"unpackedSize":201584,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhJT9RCRA9TVsSAnZWagAAFHAP/0u2zNRBGq0aT8ctNL4Q\nvCotyUSOsFj2yF0+gciFb6czzDhzod//mZz+xfWnrUqR/FiXThuezVhMMqht\nNcZxKUPrY9IwSFWXqzp94fWJQf1HfrWEtslLBXSeb4pNWOC9Y1lDgMJ2dtox\npoqahuIsyNLahrmU/2VbmAw76b6b2Yn2esXXPmK/2Z2rFxjVocbWW4OCwmIF\ns6zLFqbzkkNX49siKkC/F/sd2kv36wvzMEEPMIYJKvAfHuh/8ne9QvwevGcx\nsESxgElHlPic8GvAvw8i7yTSu+6MAAox/eZ3zpIzTNE2veDprPaV3a1/BdNe\nQUykAh3u7aRCeUWDGQWl1H748bH/2lKW3EJ+otUGn2N+3/Uhpy+ZoQ4PtiAb\nfEWNVejI5qkJymTrgW7crllatdDVpvh22jrv8MtBkM3NYPyMyR19/6dWErcE\n/jtowXJlx6zpyTD/Zma6IB4hH7TLSW7o14q48b5jOD6XINZ6jEq1KoixCVV9\nD7qJ32TsxCDyVRgJ8lirgleVDcIiHtJk+dt2e9EeRkoT7JvHChUEOGIYkQkJ\nDql7vDRRmeFNc1DLhvz4pDZp5nf1Bm/5usdQev98stiLHYkthDQrYt6L7+yy\nEQuPWpEzfXGc79QRUKYYqOSb4sECBU+xaBd0IUKa+e2s7voqRImkrno5O4hY\nXgLZ\r\n=6rjP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCfo9M/OCb9INb6eNygJNZAx4PHkHeuQA6g7V8rgux6pwIhAMjm0CtfGYcTwnbXxdu+INj2b+AKv4HUYwppTjFqHXLl"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.ddaa5d8e.0_1629830993363_0.5728500005847383"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.756208fb.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.756208fb.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.15981e9d9.0","@material/line-ripple":"=13.0.0-canary.15981e9d9.0","@material/mwc-base":"0.23.0-canary.756208fb.0","@material/mwc-floating-label":"0.23.0-canary.756208fb.0","@material/mwc-line-ripple":"0.23.0-canary.756208fb.0","@material/mwc-notched-outline":"0.23.0-canary.756208fb.0","@material/textfield":"=13.0.0-canary.15981e9d9.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.756208fb.0","@material/notched-outline":"=13.0.0-canary.15981e9d9.0","@material/ripple":"=13.0.0-canary.15981e9d9.0","@material/shape":"=13.0.0-canary.15981e9d9.0","@material/theme":"=13.0.0-canary.15981e9d9.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"f13e06c94f8ec287642a6c4a258c32f5be7a17e6","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f13e06c94f8ec287642a6c4a258c32f5be7a17e6/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f13e06c94f8ec287642a6c4a258c32f5be7a17e6/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f13e06c94f8ec287642a6c4a258c32f5be7a17e6/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f13e06c94f8ec287642a6c4a258c32f5be7a17e6/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f13e06c94f8ec287642a6c4a258c32f5be7a17e6/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f13e06c94f8ec287642a6c4a258c32f5be7a17e6/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f13e06c94f8ec287642a6c4a258c32f5be7a17e6/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/f13e06c94f8ec287642a6c4a258c32f5be7a17e6/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.756208fb.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-lvmYbfnnfW54Jf9tj5/TsCmlSsI28mHCk2ui92mNKGEH31yIdXbmvyAmVamV6LQjqVys3LWkCIx7qtAkVRS6Ww==","shasum":"3b391c67c2eafa808faa4447690e7cead0063482","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.756208fb.0.tgz","fileCount":13,"unpackedSize":201584,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhJp8QCRA9TVsSAnZWagAAQDUP/iOniq5pepMnX+ZywVA3\ne3CMEsVgRSCURKDYsisQpO7nm9d7+A3Rm0XroB1hwx7NpA5Fl2VPft+FXQws\nhVQXbCXAa1Ovatpx/gx6yA8JpFRytGflrpXxNbFWmHDkXmAvOP4+2yoKX4Bn\n9sPsSIOW4TydTYMfWzYe4avnKsNIetQFjzp8yKmA661g1r9i7eQCuffg5MTw\n+wFLRttYdrAAh31yRDGrASFnWGMbiXqFWb5Z7/dBQwla3MiPrL6eHAOooJ0/\n3uRqVtChTucK9i9xwm99wGkusMBvucHMpd/jtNduaW1NgpO07zjCNf8FOVMC\nJzeyyJ4e7JafQiNICNTA6+tfcBh3D0QCG0aLEduZO81JyOT7uZBSzq0B+Wsn\nWsPsYjew+6VMt/SN+Pq+jEywssy2L7jkN3yPVgRQWUdS8V4ue4IOxbHJoQLv\n048O+dDnhRIet/VhB6J0IlKIP0GFs9r3u5b9mwRWnuTbX4rsRQTftfFFpL8s\n5c5Kdsnjyzmels6j0u/H82p5BGeE325uzJpHLqubV2vfaD7X3Gj+4vn8PcFc\nq8en6oOrqD4xGOoo5lDg0J0aPBwkLMRVX8jDoOE45JcSzkNCm9XK+L29NmvO\n1YseRAiraPnmZIf3BPeoY1zOL8tPRX/t156EWDiyRF7Mql2Lcr9z/7AonCBx\n2yVU\r\n=qwtd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDT+nAUqbu+B2yHxoM6nRewAEY5v6Wg0sT+qUZju00opAIhAIh81WTCD+TzhIWNlWSUjYUQtjCIK7XTADEgOiLY6Utm"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.756208fb.0_1629921040069_0.7041263698775491"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.9576dcd9.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.9576dcd9.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.15981e9d9.0","@material/line-ripple":"=13.0.0-canary.15981e9d9.0","@material/mwc-base":"0.23.0-canary.9576dcd9.0","@material/mwc-floating-label":"0.23.0-canary.9576dcd9.0","@material/mwc-line-ripple":"0.23.0-canary.9576dcd9.0","@material/mwc-notched-outline":"0.23.0-canary.9576dcd9.0","@material/textfield":"=13.0.0-canary.15981e9d9.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.9576dcd9.0","@material/notched-outline":"=13.0.0-canary.15981e9d9.0","@material/ripple":"=13.0.0-canary.15981e9d9.0","@material/shape":"=13.0.0-canary.15981e9d9.0","@material/theme":"=13.0.0-canary.15981e9d9.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"0d9211bc7f0c9c96cb4dc480ff59ae633f722977","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0d9211bc7f0c9c96cb4dc480ff59ae633f722977/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0d9211bc7f0c9c96cb4dc480ff59ae633f722977/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0d9211bc7f0c9c96cb4dc480ff59ae633f722977/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0d9211bc7f0c9c96cb4dc480ff59ae633f722977/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0d9211bc7f0c9c96cb4dc480ff59ae633f722977/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0d9211bc7f0c9c96cb4dc480ff59ae633f722977/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0d9211bc7f0c9c96cb4dc480ff59ae633f722977/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0d9211bc7f0c9c96cb4dc480ff59ae633f722977/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.9576dcd9.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-4yAWY8BGWkP/BU0Sa7jpCdEX9IPuJpn7lHEgu6vbphqARGg56m3QKunkzUQwZ/9NYHfKpbqNI7r71Zck6NKaSQ==","shasum":"3e02ff88d4fa839cdb2c310d13cf6664ec76a9eb","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.9576dcd9.0.tgz","fileCount":13,"unpackedSize":201584,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhJrmgCRA9TVsSAnZWagAAliIQAIWg4+LcoycZKzy2UhLc\nV1P3xoLYYXHOYb3+gvmE6rJAmF2f+ET7M5e0PuPq3DVXZoPc3m/2BC1RRJWt\nhtdNH2IDYZwiHuu8HqVDGFmwy2cT8+KujvHg26e/R8pM0owlUJO0Sbt6/2/5\n6cEfoZ9ZhTWoyT20QNslebPxgmIyxDR7+FJEqIsEsWBG534/TgfQcW9Z7qMG\nhgJzMtvSKOcqrq1F0O83Zl2r943FVMCpctTkaMeMaOVIdLdNgkXcf9x/VynA\nH4x4IwBwzreWbmfRbR3FBfl4bHIS2A8XYSjZCsuzF7gePD5A8NTx0syRzOcz\nSBBuD4xfbC89cfQRgo5Z8zhx+uwEAygJv4OhhXNvc0AAB9DaqlbkOSnFhbpL\ngMIGoh71MFcnMtRPNbFQqJGnQBoV9/TM8eOfqjmTubB0SNhYt+GYw+xHJbFa\ne9qP9do8vdQW+MQUjzf5+Y5SmbCAKOg481+fJLyCh4e/mQqLAln0+YUUadkW\njSnaaYawd/NRPQVCBxiZsfmeCOCvMelON+y8KjsIrabTMya4tdOhAEL0UjNV\naCGCRWARI1hSrh/lC2qJI2DEeDTm+ahM0trfnavsBtpYf0Ned5PyEU0Z6IBa\ntTR12mRPbM5iO0+nXAA7ukSXQkDQmjtchZuWy3ZZqCincd0PTAKk7UtV/43m\nDf3m\r\n=YZ1n\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBKRrZ1HRjvcByNA2G6EUeA9QnoJPVqoVZBEbGruO3C4AiEAvGBpjU0auMCnbvneEd0+ebzgjB1Uw7TCswC4q/81Z5s="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.9576dcd9.0_1629927840024_0.6978594428711415"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.7531cf97.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.7531cf97.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.15981e9d9.0","@material/line-ripple":"=13.0.0-canary.15981e9d9.0","@material/mwc-base":"0.23.0-canary.7531cf97.0","@material/mwc-floating-label":"0.23.0-canary.7531cf97.0","@material/mwc-line-ripple":"0.23.0-canary.7531cf97.0","@material/mwc-notched-outline":"0.23.0-canary.7531cf97.0","@material/textfield":"=13.0.0-canary.15981e9d9.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.7531cf97.0","@material/notched-outline":"=13.0.0-canary.15981e9d9.0","@material/ripple":"=13.0.0-canary.15981e9d9.0","@material/shape":"=13.0.0-canary.15981e9d9.0","@material/theme":"=13.0.0-canary.15981e9d9.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"1baa3308fe03250097e96c18c61446a8c8014706","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1baa3308fe03250097e96c18c61446a8c8014706/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1baa3308fe03250097e96c18c61446a8c8014706/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1baa3308fe03250097e96c18c61446a8c8014706/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1baa3308fe03250097e96c18c61446a8c8014706/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1baa3308fe03250097e96c18c61446a8c8014706/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1baa3308fe03250097e96c18c61446a8c8014706/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1baa3308fe03250097e96c18c61446a8c8014706/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1baa3308fe03250097e96c18c61446a8c8014706/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.7531cf97.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-9fSKe0oJ7tGVb9iV/gKzfAqau48DziIjWje6T8V1oXxOTyWDB/N/spUbziLCILzppJkGOwterpbozyutYG3+2w==","shasum":"36c5659dd912d3be1de45a88f0b3d42bcc4be13f","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.7531cf97.0.tgz","fileCount":13,"unpackedSize":201584,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhJ862CRA9TVsSAnZWagAArrYP/2KblWJEg2iwM9qrDcET\nXmdqP84xwgihLH+iwieFMknL7vq6XkIDPlkxogf5+drejFNtVIup1UfObk6d\nkcE260KEaz/hbizfczMXfi3ZETnoaUAsbdQG7JWedRhV1TWCR3lqbzGWB041\nJCJT7uwpbPyXkUTvE4og11OW+Fwi91N2TI7iOX0YE/Q6vLdXKkuLq0N03d/l\neqLpq8PyBtApfv6LNpdEfgv+iyE04MxnW+imnFEhCvSkrO7BpT8RwJsKB+mg\n3csAm1taneV53sc7XqnAmxp1u/sW2cR65XCxP+/oLWJ9PVNx9WS7nwCyFi3O\npTGeu41hENdhtXIT2kJckYoLIRocHsQAvLqe9swBzhouOz2R9GCj2qSsie+x\n4nb2Xm8fgJyTvMN7oj+qTrBKe2FI2f2p0qLx3VqZlCyQKpL3GFOz/jmP1fqH\nrjOcevxDMwPMN7Al+mdP9m1KY+wdSqhUpjOPFRsHXmjiEsZE90TcM3efHEcF\nmVLzd5uB5cLAGF8vTsCWHHwE3IQYlPO+W7G77od4q14jfQKXWc1u6vswHQrI\nRS7AHz3rTnozLZbp4kgQrmhDCWcv+oDvKvKbGzH+ryuAATwW79WsiCLE48kN\nzTpNKKtSJwlJNxujKM4pIvEF9MvR/3GjzhA39CoHkja/I1jXrj3MaK9NyNuZ\nF4IS\r\n=WQ9M\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCnz8JLjCtqvc67hBriEzFikfVMNvE9fTnchTTNKrkngAIgAUBGwqgS4aePOMyr3fI/WA5UC+9wbBB2QmzTrg9sJqI="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.7531cf97.0_1629998774201_0.9218044374578482"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.3bab26b4.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.3bab26b4.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.15981e9d9.0","@material/line-ripple":"=13.0.0-canary.15981e9d9.0","@material/mwc-base":"0.23.0-canary.3bab26b4.0","@material/mwc-floating-label":"0.23.0-canary.3bab26b4.0","@material/mwc-line-ripple":"0.23.0-canary.3bab26b4.0","@material/mwc-notched-outline":"0.23.0-canary.3bab26b4.0","@material/textfield":"=13.0.0-canary.15981e9d9.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.3bab26b4.0","@material/notched-outline":"=13.0.0-canary.15981e9d9.0","@material/ripple":"=13.0.0-canary.15981e9d9.0","@material/shape":"=13.0.0-canary.15981e9d9.0","@material/theme":"=13.0.0-canary.15981e9d9.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"1637f7d8d3b8a228e1a957d94d122d9a840a63d1","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1637f7d8d3b8a228e1a957d94d122d9a840a63d1/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1637f7d8d3b8a228e1a957d94d122d9a840a63d1/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1637f7d8d3b8a228e1a957d94d122d9a840a63d1/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1637f7d8d3b8a228e1a957d94d122d9a840a63d1/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1637f7d8d3b8a228e1a957d94d122d9a840a63d1/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1637f7d8d3b8a228e1a957d94d122d9a840a63d1/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1637f7d8d3b8a228e1a957d94d122d9a840a63d1/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1637f7d8d3b8a228e1a957d94d122d9a840a63d1/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.3bab26b4.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-hSdbZsv8WMsmYh2yNxUINF03Envdw3PVQ88l0xBRbawWuu6uK9ellF8Jcc5saCZpY7kt8gl23d/6m3l8x916Xg==","shasum":"c802a83bb66e50ffaecbacffd67e179a617b67a1","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.3bab26b4.0.tgz","fileCount":13,"unpackedSize":201584,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhKAtVCRA9TVsSAnZWagAAqBYP/R5/Jzp4r4F+oHqCoaRk\n4yNmPSk2CGwkc0FaXlKDj4MLGFoEsvPNIWuQ/8XneTyDdu+UjGDMOAzz7gnD\nLJWbFT3ZYVLBtT2R1XsI7z110wC31vVwM26MebyRIM0vdfawKNB3vqFY5MN/\ne1jKz7ovskvBQk++u8nlHJUjvHq2BpFlF4wOaTHOI836hCuBLXranHc4HrtE\nsWXerwOyXiE1mkbGd+G+M/r8LCSf00/Z5oihF3coEBLTRVTY6FuEac+yq4NG\nBljQPBhqc50jRSmMFo1vaPi+T5O50twLfRVR1pGT63fe3CNaOkIwRndaMN6V\nfbjQQ725FlPC4TpwAfQztlvif7HzyED7z048Dbi1A3tV13xMLBZV8W6Uef0H\nZaHS8G+WlS0p4C+jPzzFaC7TcrZ9E98AzihJ8v0oWWpORLQZKtPT+W76Sy5I\npAXMQZcsU/v9QZNeVtu7uK4Di/S6PX/XgK9LfGNiBD/MPCapBzTPzavGzkB2\n4fq/0exrB4eS/auICHPa1hplmvwRRGtiknDlS0WkeQ3e4dCPwxd3p+4XuMba\nzAwRhoBkvtxuiqpimhNzRQihPbhcRxNe7m62BR8fKuaFYCxOk0EMZVo36lf4\n0OukVcLzYEYe6T92NLI2ZjLD6FSq8h799awPmxhJGWo8Njpj6DBjWMSVXvU7\nm6ca\r\n=+w4a\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCUuG3dB6M19BESfCQ3Zo/VFWbznInWaFck96bsMn+SjAIhAIE5u2DF1m9m3x6Gh+6AboOAPNrlQVzz//CjzvBgOnro"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.3bab26b4.0_1630014293467_0.5538274149461861"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.fab48bee.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.fab48bee.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.15981e9d9.0","@material/line-ripple":"=13.0.0-canary.15981e9d9.0","@material/mwc-base":"0.23.0-canary.fab48bee.0","@material/mwc-floating-label":"0.23.0-canary.fab48bee.0","@material/mwc-line-ripple":"0.23.0-canary.fab48bee.0","@material/mwc-notched-outline":"0.23.0-canary.fab48bee.0","@material/textfield":"=13.0.0-canary.15981e9d9.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.fab48bee.0","@material/notched-outline":"=13.0.0-canary.15981e9d9.0","@material/ripple":"=13.0.0-canary.15981e9d9.0","@material/shape":"=13.0.0-canary.15981e9d9.0","@material/theme":"=13.0.0-canary.15981e9d9.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"4c3b20e414501a7103cbb2397163d4ed1c7d041a","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4c3b20e414501a7103cbb2397163d4ed1c7d041a/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4c3b20e414501a7103cbb2397163d4ed1c7d041a/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4c3b20e414501a7103cbb2397163d4ed1c7d041a/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4c3b20e414501a7103cbb2397163d4ed1c7d041a/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4c3b20e414501a7103cbb2397163d4ed1c7d041a/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4c3b20e414501a7103cbb2397163d4ed1c7d041a/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4c3b20e414501a7103cbb2397163d4ed1c7d041a/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4c3b20e414501a7103cbb2397163d4ed1c7d041a/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.fab48bee.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-Z8EUMssMKysTUbs4XECm0SFQUvqSDaLOubkNfY4E6EWapehFSCGZPcpkkShabsmUsLcbXf7j7DjsmDUxo/dfmw==","shasum":"b03c2505e82fa4b284ce220e674f39ec957d8f6d","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.fab48bee.0.tgz","fileCount":13,"unpackedSize":201584,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhKBCvCRA9TVsSAnZWagAAN/AP+QGEQoOf5p1KhWVFg8t6\nMauwaiFy5Pk56CqWEeSjzcQCuVsZR7G2FU5QCadrh9UTTqcnjbzqp/lu1E6s\nUiZaP+qs6mQ6LoIn5R0MW6fnGkas0/mgHOrrqj3aV2r23vVBhyawMrQsRKbb\nRPI6zvfN31LI+1Ob6VykuMjaFaHo5uPFxO7+SIYUMzCEOmh5WIzYegkeUTOT\nSegwXIjUFNSttV5Jc/IJ4tlXslXu2oSQS+KMexUyqolZCYNhQzO5OxuvtVcE\ndobcPLs8WphaH/HT4651K94KzphQ0PG3n9W0QKSAZ+j0xdvv9Q0UeaHaAfBY\nfEMp3Zk/DV5TxEsfMzRhA0LEZN8pAdKxXd0Yz60SHO2TUNYAOce1GUNPPoGg\nyv37VcqvdqZX4H5aWGguPufiSh8k7zQ278hYId2r+EHzMCjybfO+idDsthFx\n4cjMqSVrtgEiaja+AX69+bnyTkRUVMH1DQgBr4N97N01skPaYEHKy6GbJSo3\n234VrUcWF7DAO9U5kPiZaGTQzZ9aOkSv9MBsvDxbgTgDHAVcQWO9vVL3m8Ux\nUt7bbvfeysy0Dd9/KRmRVTsAR/ImBZbzIcxof1SQQib7EZ0Z5RYKfEVKiMF8\nB8F14Hg3T8e0dsNcW29TM68+QbcBurHl3ED5+StqtPqD5/ELuAgfyxWZeBQs\nrgsz\r\n=mqcv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD7XF4j8AHPla2rENFi6XTI1a1tPQf3wRpAdT069vvZvgIgA5YHxjboFiuLR+QVAEWMMIIBERvhKn4O+98YfOHLEnQ="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.fab48bee.0_1630015663001_0.24323078067536308"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.dec18df7.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.dec18df7.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.15981e9d9.0","@material/line-ripple":"=13.0.0-canary.15981e9d9.0","@material/mwc-base":"0.23.0-canary.dec18df7.0","@material/mwc-floating-label":"0.23.0-canary.dec18df7.0","@material/mwc-line-ripple":"0.23.0-canary.dec18df7.0","@material/mwc-notched-outline":"0.23.0-canary.dec18df7.0","@material/textfield":"=13.0.0-canary.15981e9d9.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.dec18df7.0","@material/notched-outline":"=13.0.0-canary.15981e9d9.0","@material/ripple":"=13.0.0-canary.15981e9d9.0","@material/shape":"=13.0.0-canary.15981e9d9.0","@material/theme":"=13.0.0-canary.15981e9d9.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"5fa2a5aa7531af47c2a307010d92ff5fd27006c4","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5fa2a5aa7531af47c2a307010d92ff5fd27006c4/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5fa2a5aa7531af47c2a307010d92ff5fd27006c4/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5fa2a5aa7531af47c2a307010d92ff5fd27006c4/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5fa2a5aa7531af47c2a307010d92ff5fd27006c4/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5fa2a5aa7531af47c2a307010d92ff5fd27006c4/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5fa2a5aa7531af47c2a307010d92ff5fd27006c4/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5fa2a5aa7531af47c2a307010d92ff5fd27006c4/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5fa2a5aa7531af47c2a307010d92ff5fd27006c4/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.dec18df7.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-f4kqAKBEVV1pBqon42qJzW1NboZAecjAPZieUzHAB163zUGVyrfHShlj+M/xYQLMiJdcV9dgXLpfWDL0ZXDauQ==","shasum":"f16159e6fb1ff7269051f5a08052add896524209","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.dec18df7.0.tgz","fileCount":13,"unpackedSize":201584,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhLJbKCRA9TVsSAnZWagAATNMQAIMQ1jf1HpXvrClbNy4O\nUsSlogbMSqOokP6ofJ/Gv3dWDRhX6NQIms8yoqXloSuZuLK9xFgrbvfF1wC7\nWgk4BOexRQkOEJ4kaTORAnQ0DGfSFsVVacjmUZTTQuW0x7pDZrriFqPVRGNb\nsnDu0VD3kQdkR2+O3Hu5zDwkzX/WEr3sB38uD2p97+d3jmIBY2z2nsfJL7Bt\n4VE8ONRqbeBEfbLK/UBjZKfaUQmLMTs2Nt3qS92DPwYSf6JsdWmbR8MhRmM8\nWBpGnEiWZ6DgOnmFlYsc4ogN1koUxYqmG5ccoWVMDKw2qixa0Ay5UXHqdVIZ\n3AW3gU2/zEsVy0G5tqDxSuV+aHS2H5l+cdE7Ghq0BXSHq3PwtCK2KiejdLXf\n9SAEYsf+V0GjWaKmSXio6j6j+7n1Az+QcLcdpe/quN9q6d+/q1MLJuCfvfmk\ncEt2QqDYLXIuaVjo0W4ZiM8wCLrq1FVulMGjsp6OaVCDVLNy5CcpjwGFu/xp\ndN96M7TOQmMjxak3Eeuq51sMf9jhn5e5w7XSUZ+jYdyRqb5ijFHqiRKgsJAH\n/bpxCEz8FAbb+SBFUYoun8ba3eEdjVxxfBBAWfetdu6jcWF/9rjJYKz4tCQM\n1nA2z3qg97Erry+f08oFbjwDjnM8joURDqaK9DOm1PEIJwr1x9yjgbBjxU3M\n8goO\r\n=QVPd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC/Lpux6YvJPWTz9DO5XpeEIv0+ab4TqRUGS6ovn/mLAwIhAN6XZbrxXe/OTDVoLW5p9CdNspfbU8BTDJ5SBWmUI8kI"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.dec18df7.0_1630312137882_0.9041484409966449"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.61fe5b17.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.61fe5b17.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.15981e9d9.0","@material/line-ripple":"=13.0.0-canary.15981e9d9.0","@material/mwc-base":"0.23.0-canary.61fe5b17.0","@material/mwc-floating-label":"0.23.0-canary.61fe5b17.0","@material/mwc-line-ripple":"0.23.0-canary.61fe5b17.0","@material/mwc-notched-outline":"0.23.0-canary.61fe5b17.0","@material/textfield":"=13.0.0-canary.15981e9d9.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.61fe5b17.0","@material/notched-outline":"=13.0.0-canary.15981e9d9.0","@material/ripple":"=13.0.0-canary.15981e9d9.0","@material/shape":"=13.0.0-canary.15981e9d9.0","@material/theme":"=13.0.0-canary.15981e9d9.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"8d712401a1af774c1e4dfbf07ceadfd36aaeb5ff","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8d712401a1af774c1e4dfbf07ceadfd36aaeb5ff/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8d712401a1af774c1e4dfbf07ceadfd36aaeb5ff/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8d712401a1af774c1e4dfbf07ceadfd36aaeb5ff/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8d712401a1af774c1e4dfbf07ceadfd36aaeb5ff/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8d712401a1af774c1e4dfbf07ceadfd36aaeb5ff/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8d712401a1af774c1e4dfbf07ceadfd36aaeb5ff/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8d712401a1af774c1e4dfbf07ceadfd36aaeb5ff/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8d712401a1af774c1e4dfbf07ceadfd36aaeb5ff/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.61fe5b17.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-qkJFbjycRfnXg87pSaQdrriJgoZk1dVMZAYDrkEsbYfzZ4qjZoEVqbyp0ydVdfBz+i2sxLiEcOYHH3DRxJE21w==","shasum":"4d7bd8c02b4957a86b44e64f5b2aedb435292820","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.61fe5b17.0.tgz","fileCount":13,"unpackedSize":201584,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhLTFsCRA9TVsSAnZWagAAVHIQAJV8TkJfOAANugvJOHR6\nsUc1ebQGRy22S13tJkY2mWQIxGXuA6TiboX9kXcZoC+cs+iLiAUiWwxM0Ei3\nOMm6aYqcogwjPd/1utksb+1ljCzBYrz7HyxeFXY6lBE5gWwdwm9/dceNcXTu\n2nQjbtr6d97mw5eC/LXdvc2gLEwxbyoAmYPjHlx6NLidRDksCJ0Sg8sRnlt3\nK0EZVI/F16odm6owkw6/7izJJcFN2JUl5yO1ve3ONmSOhunK68xEcYlefotU\nWK0kDscWevPWW1Z3tN1Q6OvEeJDyNwmCSNm65YDc9z/e3PvbsLZ4w/e7O/H+\nigbv00HgRja3cYG/LpEF47gQe3Bevru9DfgA15Mksq9LE9sLp4jrqKGftBUy\nVvU1lZ+f76M3BT3ecmPHAedEEIx1w7uppNDp9cqEOmeQc4S5EFR3HsU5Tw3O\n8tVdqEt67ASp6GBkHJ8xc5SztqDG9ceO8dtuUa081RnYvGF+k7raF9rSTPkH\nlM85hb4DvG6g0CtB6gDf+mnVc11sp59xJj5tpkNFYhMP4wOz7dp7wMxhGnzJ\nk9sTjU5D+Um7TA96S/XajbDw1AQVlIaAP6dxvofIVUm/pGn8Sb77Mqj+g4k1\ndswAXKJ9wdrWrVQLdMzzziwq0QAu98rHBpptUckbM+wkgyqnOnEXuzkVhTll\neHO7\r\n=vEzd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDteuzVn0tY/7sTa3J5sWATozVerz5h2Utiv35v8qxp9AIhAOR7q5Lk9u5NDR2lsxOhUPotbQ95WSX0+qtW3dNC9KT3"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.61fe5b17.0_1630351724396_0.5865181849399674"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.a8c31f54.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.a8c31f54.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.15981e9d9.0","@material/line-ripple":"=13.0.0-canary.15981e9d9.0","@material/mwc-base":"0.23.0-canary.a8c31f54.0","@material/mwc-floating-label":"0.23.0-canary.a8c31f54.0","@material/mwc-line-ripple":"0.23.0-canary.a8c31f54.0","@material/mwc-notched-outline":"0.23.0-canary.a8c31f54.0","@material/textfield":"=13.0.0-canary.15981e9d9.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.a8c31f54.0","@material/notched-outline":"=13.0.0-canary.15981e9d9.0","@material/ripple":"=13.0.0-canary.15981e9d9.0","@material/shape":"=13.0.0-canary.15981e9d9.0","@material/theme":"=13.0.0-canary.15981e9d9.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"7c390fe40361133076f70c076acba4dce24e84bb","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7c390fe40361133076f70c076acba4dce24e84bb/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7c390fe40361133076f70c076acba4dce24e84bb/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7c390fe40361133076f70c076acba4dce24e84bb/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7c390fe40361133076f70c076acba4dce24e84bb/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7c390fe40361133076f70c076acba4dce24e84bb/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7c390fe40361133076f70c076acba4dce24e84bb/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7c390fe40361133076f70c076acba4dce24e84bb/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7c390fe40361133076f70c076acba4dce24e84bb/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.a8c31f54.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-VuxPNva8FmsrUW5rmPK8VQBLrgh+UNTLGCs8Ba5J0eljIOqQa8cMYmlWAIAfBDzNYEnVxw4eXeVGo38NaTrHnQ==","shasum":"21ddddcc73c4109dc7c26dd78d393c9cebc691ec","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.a8c31f54.0.tgz","fileCount":13,"unpackedSize":201584,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhLUAmCRA9TVsSAnZWagAAiWwP/RR5gjwNgLVDMDk2Zjr0\nDwrFFXRMsWVLKMQxrxXIRki7KIkGUfTsHcRXWvjxWc86ib9s5+VUcV0tq3qy\n2uFggRMtTBx6Z5oUVZSPGGovZeQvobhXpiB+qOglW+lT81adklEvVRgd8Jcx\nFmzOzYfn/ziSFt5WF3G4+Xu6peRC0PgO6sBEGnwsfKqBa3XZf3XXcgvqj189\nWKnyBSan6xE6OpUkuaG4uyIVKgKJNQj4ONpCE0WNX1j3VStbbwy/e6qb+MZb\nYKH/nkVb6Oeu1hGbKn4HGEFeyUscRHPkxnC07d6DIcP/lewDOteng/nF2B9k\nfwXMv/IwoD7PFFJ/EBS/HXVOJttBFzDPnNhIEXFeG/M8dn/ovFN6nBCboPyf\n8p0JEYAIFNfQ8G4JVurGn5LFZqP4a0Q5iPnRNZsr3AUzxiB9feExqOQHr5Fz\n5KXO3C5axKJU6husPOxBLhZHIn+Qth/b2G0dNQvvJoPpI0662GxE0pDryeXF\n7lSPfhbJlwpCVJxBUf/pgw5CtaUVbNrP/sls31IxhTo67ZudgtvPC3TmeL1+\njWFfDFFc12CUA54Z4Mp/aivu5Inzx5BRuVma6Vl6YZibN08UYqime2M4FU14\nZwKK8roum3T+w4V2IP38C0Iq6HSfsDfJAXeXvG1lrly9+qbBPO+kBPt3iEEE\no1+P\r\n=g+11\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDcRHxQX02ONDGTG22MHEl2U9/o8iqhZvvBU2P/pCrbgQIhAKmqxq2px9Z6QTEKUHhCCbtN4xptO3DBe4ey8reYMfpn"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.a8c31f54.0_1630355494050_0.06464029932990978"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.a096dba8.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.a096dba8.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.15981e9d9.0","@material/line-ripple":"=13.0.0-canary.15981e9d9.0","@material/mwc-base":"0.23.0-canary.a096dba8.0","@material/mwc-floating-label":"0.23.0-canary.a096dba8.0","@material/mwc-line-ripple":"0.23.0-canary.a096dba8.0","@material/mwc-notched-outline":"0.23.0-canary.a096dba8.0","@material/textfield":"=13.0.0-canary.15981e9d9.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.a096dba8.0","@material/notched-outline":"=13.0.0-canary.15981e9d9.0","@material/ripple":"=13.0.0-canary.15981e9d9.0","@material/shape":"=13.0.0-canary.15981e9d9.0","@material/theme":"=13.0.0-canary.15981e9d9.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"0979a05922649d16cee4c4ef15ed0c3c3e9670a6","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0979a05922649d16cee4c4ef15ed0c3c3e9670a6/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0979a05922649d16cee4c4ef15ed0c3c3e9670a6/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0979a05922649d16cee4c4ef15ed0c3c3e9670a6/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0979a05922649d16cee4c4ef15ed0c3c3e9670a6/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0979a05922649d16cee4c4ef15ed0c3c3e9670a6/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0979a05922649d16cee4c4ef15ed0c3c3e9670a6/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0979a05922649d16cee4c4ef15ed0c3c3e9670a6/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0979a05922649d16cee4c4ef15ed0c3c3e9670a6/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.a096dba8.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-CC0AZuGSFc6dtixyJ0Wcx66bepLaRDch9Fp95GhJQHCSfisCdN/St/vQdtrPBD6vswG2ctQ4S1f7orCFUqRTBg==","shasum":"f27283adfeaed0a1b9232561ac67c6e5df589e7b","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.a096dba8.0.tgz","fileCount":13,"unpackedSize":201584,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhLqrSCRA9TVsSAnZWagAAIxoP/30wptdcOioQhRsSu2vQ\nNfUjSfCSyWY1ng/Lpge7A+sdN5o7XMx5WR8MsO11uJa0kvw6qtLDVpF7N1VU\nAdQBDxhUWRkrwqVloD5WEQvuO7LNQQGc7XKh2R6Snw04EUaWOxp5Wpvpxxex\neqm1q5z5Mchp74fHTwRfVaxqSSw1A91ltfXcUdWkNP4SMQ4IU+Zabe49ey//\nwIscdjViakdqVROMIhIuJbsunMwJwyEod2HcFKAH8/t/UpAuP7e9Hc7lBMEl\nT7xJhtwys5dX4wah0E16naMOV6caXJ8OXXpl20aMFjJqgre4YpDu8zicK6xI\nRcN3YyazL2S1nflhJ+x+bICccjyyr8RdzmgndeMnnMZAtEQHjg2CpYtatKgI\n6Jffycprmv3Gq0xfoy0GpbRrEqwPb7OhUNEcG18XebUIYlY25X+P5vIndTwb\nb3H25qTgxLq/bml6RtQLH/t9XVPTpcC7LrL3Sg+g/8sRXWwwtR2XCXzKtGZ0\nbGJjTX1UGUdE5qWVlR3pDLh8eHKeWLyeniUCwkdVQCRbyd6GraEwYfN/Pwt0\ns4wzUjh3jO235FF3uksNfx/hgp943+ANpTrmWZN+OzdtbfnZK2+PjZ3CtaU+\nZQO8Vk5w4vTnnsDwbW2qngfZhMt7lZc3yCTlixx4HeHxOwzh1w1jXSihVOVE\ntefC\r\n=Ng/i\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDFnw5zjxI87jMJnGH194gMtzpdJ+mxggn4cnpeSBdo5QIhAN+DKZUq6hcZXZaW71mxPPai8SKjQkA8hGM7v0gPSBRk"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.a096dba8.0_1630448338315_0.7003040864679577"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.7ec04d47.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.7ec04d47.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.15981e9d9.0","@material/line-ripple":"=13.0.0-canary.15981e9d9.0","@material/mwc-base":"0.23.0-canary.7ec04d47.0","@material/mwc-floating-label":"0.23.0-canary.7ec04d47.0","@material/mwc-line-ripple":"0.23.0-canary.7ec04d47.0","@material/mwc-notched-outline":"0.23.0-canary.7ec04d47.0","@material/textfield":"=13.0.0-canary.15981e9d9.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.7ec04d47.0","@material/notched-outline":"=13.0.0-canary.15981e9d9.0","@material/ripple":"=13.0.0-canary.15981e9d9.0","@material/shape":"=13.0.0-canary.15981e9d9.0","@material/theme":"=13.0.0-canary.15981e9d9.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"cc39e72f38b02c8cad467741a3eb549b35590ddf","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cc39e72f38b02c8cad467741a3eb549b35590ddf/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cc39e72f38b02c8cad467741a3eb549b35590ddf/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cc39e72f38b02c8cad467741a3eb549b35590ddf/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cc39e72f38b02c8cad467741a3eb549b35590ddf/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cc39e72f38b02c8cad467741a3eb549b35590ddf/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cc39e72f38b02c8cad467741a3eb549b35590ddf/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cc39e72f38b02c8cad467741a3eb549b35590ddf/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cc39e72f38b02c8cad467741a3eb549b35590ddf/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.7ec04d47.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-Z8nuFHIPH5PZyDdT3CKke8Fiyy1ZgbaU2emIlUiLuf/yTO/TY6/1MzyhH+/VeeMkxJtOal6PJN/cSHbpWyAKng==","shasum":"78bdc2658e64430afbee7fcb26a3db0ac96f0c37","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.7ec04d47.0.tgz","fileCount":13,"unpackedSize":201584,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhMV1rCRA9TVsSAnZWagAA6MQP/RKxaKPdA0sfK2z/gyH3\n9wx26pmd6kfPJkXzuaxiMx0i1Vqs5Xdi0l3zVgmsNijRuKiokhRCvImAujv0\nBl48ni6BS0KDUxfZJ16a59x1kIsXlHKOWXjwEg6lgb32HVTtJctWVXxex3iR\n55H/GqTWNripCTnL5EH20etwaB/I6l0QotEQmKLyCAIbSA6+M+/lTweDeHIk\n1lyj3bbeO1mCrbfhVeS7/wEsuzbaJrbgt6Z5LTb1/JsMhklXbPEvPocExpaY\ncJBpeQJJaFFOkKmfPJxww/rNosGwBC3yfLsSahkvTqPHEhlApJkEf+17qywi\nO9T9sg5RsxhVsGvdQEAuiuFbx7U5ftXRzMiLI1O/B2eRQPJeq+Ud8mNq7j9R\nfveIcx1cx3qC+LUEWuLNzTSq4gY/uXw9Tv2EPdc5eq/grJcJZVsx1TTk6ha0\nAMZ++zV7B5VLdB5SJVnIEWuWE4/a50RU4QuwYP7Twy4hieZOTYQaUD8Jn4xM\nXEbUaU2/QJyXuBcxynOxhWXmnUQdyBMP927EHSzxie4MKIs8ADVjyGZIwGj6\n0HuzBHISoL835d2014cBXlcRJW+8N9lidF+dI6/Kl3wdH1WtKAbOhf2I6OWg\nMCk6bI+x4Aab0IkufrCXBVs+nVQZPBd+qszIhNBwur4kDpu0W1gWM7NtWxbX\npWKp\r\n=wmta\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCeaxkX+CDzREWls47daLP9SaMfHar0nxZ36gbIzwkokwIhALNWOeXwwNGQhknf4UETyNxpHfdlAJUTauRXAl+Xe2Qr"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.7ec04d47.0_1630625130971_0.9930422188377435"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.d00b098d.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.d00b098d.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.15981e9d9.0","@material/line-ripple":"=13.0.0-canary.15981e9d9.0","@material/mwc-base":"0.23.0-canary.d00b098d.0","@material/mwc-floating-label":"0.23.0-canary.d00b098d.0","@material/mwc-line-ripple":"0.23.0-canary.d00b098d.0","@material/mwc-notched-outline":"0.23.0-canary.d00b098d.0","@material/textfield":"=13.0.0-canary.15981e9d9.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.d00b098d.0","@material/notched-outline":"=13.0.0-canary.15981e9d9.0","@material/ripple":"=13.0.0-canary.15981e9d9.0","@material/shape":"=13.0.0-canary.15981e9d9.0","@material/theme":"=13.0.0-canary.15981e9d9.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"918e9dc10ef626db369abf76acaf3266d5437d5a","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/918e9dc10ef626db369abf76acaf3266d5437d5a/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/918e9dc10ef626db369abf76acaf3266d5437d5a/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/918e9dc10ef626db369abf76acaf3266d5437d5a/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/918e9dc10ef626db369abf76acaf3266d5437d5a/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/918e9dc10ef626db369abf76acaf3266d5437d5a/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/918e9dc10ef626db369abf76acaf3266d5437d5a/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/918e9dc10ef626db369abf76acaf3266d5437d5a/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/918e9dc10ef626db369abf76acaf3266d5437d5a/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.d00b098d.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-nB3Hx6r95Yb6JfYXuG0OpLgJ/IcC9SVEpwLt2ed6grjOokEQSzHMYsHgg3UJRw853WtC1Y43WlTZMJQ/lsfgyQ==","shasum":"e15a75e07ede471355e8d5350dc47487553512fc","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.d00b098d.0.tgz","fileCount":13,"unpackedSize":201584,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhMpMUCRA9TVsSAnZWagAAD0UP/3wrTJGunlodaGTFTFwG\nrIbRxAoV5LRjVO5xnbWa0wBAvs4Y0edSQo4FHqvm1fU+SHvwpVFj0M+mpCh5\nRxA79T/1BgCK/JTMxlNM2sN9EQCxGVjmtqxieB2sL8urqFh4SThE2AThXmjc\neONsoIU/PIGgkvl8SmUA1Tc2MJREhDlhlgENlpL/NdNCm/vbB8Af9F66Fdbl\nMM0Z608gs1dUDWNRDZIAuB4rLrCurLcSRzGIj7L+uyKE8ihtUWQk+EpwrH7V\nOy3Xxd1ENa+YSV0D8hM0qgRARcpGB84IjZOaCMzyUpED4KfeaC9jXhHoMmAr\nvnytI8R5zfq+FL5VVrquoT2oKiG3zM1yxV+fw+hN8bQS9MJm5+DZVc+bMJNo\nbHvE8/JkhmuzUYKAHvBSNLcre/cgiE+MHISXHHsDkxJDAZ7Kmwh7CT85gzjU\nUNzCDlbdpfkMjc3zVnD6e6vf/aD5CdO1yEM/mGdpEEDVl8GHp8G2yhtF8eRB\nutTr3RoXqtsXlCF8CuPuTMHFMooKGSfoV9CJnfePVRmITMT5BCI8ZPkaxXX5\nP87FyV8lSaagIFVneRk7KOW7jpvRZZqfrKK0rlZY7s7T8mekbouJO0DbuKHI\nEWNNcS+8qPsGfqPPkmYja3Cq79tqVOcdnRC8XcWSZXPMxLoVETYZnNuqw0We\nk166\r\n=hbvf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGp3ZiMHbdiU7n8/v0zy6ZcRqbZkN/vjee9oeCRdBEobAiEAmtFNzorbgXrPYEQSW9soydw2SDWkSl3m3GyAwpkae08="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.d00b098d.0_1630704404305_0.15104850868145814"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.f29b3352.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.f29b3352.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.15981e9d9.0","@material/line-ripple":"=13.0.0-canary.15981e9d9.0","@material/mwc-base":"0.23.0-canary.f29b3352.0","@material/mwc-floating-label":"0.23.0-canary.f29b3352.0","@material/mwc-line-ripple":"0.23.0-canary.f29b3352.0","@material/mwc-notched-outline":"0.23.0-canary.f29b3352.0","@material/textfield":"=13.0.0-canary.15981e9d9.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.f29b3352.0","@material/notched-outline":"=13.0.0-canary.15981e9d9.0","@material/ripple":"=13.0.0-canary.15981e9d9.0","@material/shape":"=13.0.0-canary.15981e9d9.0","@material/theme":"=13.0.0-canary.15981e9d9.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"ec2a4fddd95f3099eadde4522a67d49cee8d1515","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ec2a4fddd95f3099eadde4522a67d49cee8d1515/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ec2a4fddd95f3099eadde4522a67d49cee8d1515/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ec2a4fddd95f3099eadde4522a67d49cee8d1515/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ec2a4fddd95f3099eadde4522a67d49cee8d1515/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ec2a4fddd95f3099eadde4522a67d49cee8d1515/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ec2a4fddd95f3099eadde4522a67d49cee8d1515/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ec2a4fddd95f3099eadde4522a67d49cee8d1515/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ec2a4fddd95f3099eadde4522a67d49cee8d1515/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.f29b3352.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-miogqoebnku4jJPpMNvMk2m9LGdnTngWxUXIWjgtN0T6G9e29PBZQvNTkakZvKBrgKHrpLHdqKEFsC689riQhA==","shasum":"5b3ccdefde9a302cdb4e96eba43461220310e39a","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.f29b3352.0.tgz","fileCount":13,"unpackedSize":201584,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhN6xqCRA9TVsSAnZWagAAMg0P/ibiTgMECOnva35/GN9Y\n4La92HhQWXKm0CvIYWyMcao7+OTJOYmOwX3n4m5kYJQJNcXr3aAbB6Lxm4ZP\nlDndh5mrhL5Et5B1j9Ict4jmvCpnflrCUVkn95yZuc2vgsEuhnRAunAYeHfN\nw/X9shS4dh/6z3AbLZeXEpMso+7MkzRjClIFa2SW5o7nq327QB9iIGjdx9H+\n8+/IcFOuH3mDEyYApW6GWptzPF7ZO3BvIUlKMzkcS+8OcOlhp/MBsmriWYDJ\nlEsFkSQhSkwXaDff1nKCp7rAMrAO+QMuE4UIKlU1E8hSGQYNthfNAtrRWuba\n4gmjKUEhS4OIupEnZGHU2RYEr04VjYgKsOfG1K+23Lpws4fPHug+mW8TtVuZ\nTQ8GU2PWRZNcRgOUrKZJngEUABEa3J2eogyu+7lm3vmy0Ci4YOdCTh29inwU\nEcYThnaTMAxWdItfXK6A/jBcJXq4wWSe4molsarshz4qLWUlbJQw5skXrT3e\neUeDN0nQ14LhYCNY98rLgz9OXegE0pm9/4YRG0BixxRxvOlUWdoxPOiEjI7x\n5gaLVUgRjTtpv7DGcddoW2n2ui9fSNL5pDbSan0/+m9MBb01pvziunylk93j\nEmZUG/BmZ5cgCQs460okRdBeoiFVIb9apyq7d1vktiwdeVPn5QKEYnCyHdCj\nZrId\r\n=CiV9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCJkoBupXEaino9PLEU9pq5LPe51a2/LeZo68GL7sURvgIhAM1EVxOANUb72iUY5W0XeEUokIHzKOcEANADXGttdt4l"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.f29b3352.0_1631038570792_0.2243315678530846"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.4962a163.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.4962a163.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.15981e9d9.0","@material/line-ripple":"=13.0.0-canary.15981e9d9.0","@material/mwc-base":"0.23.0-canary.4962a163.0","@material/mwc-floating-label":"0.23.0-canary.4962a163.0","@material/mwc-line-ripple":"0.23.0-canary.4962a163.0","@material/mwc-notched-outline":"0.23.0-canary.4962a163.0","@material/textfield":"=13.0.0-canary.15981e9d9.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.4962a163.0","@material/notched-outline":"=13.0.0-canary.15981e9d9.0","@material/ripple":"=13.0.0-canary.15981e9d9.0","@material/shape":"=13.0.0-canary.15981e9d9.0","@material/theme":"=13.0.0-canary.15981e9d9.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"4bf68ec0db23b3011a5a8c0777452925411e8552","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4bf68ec0db23b3011a5a8c0777452925411e8552/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4bf68ec0db23b3011a5a8c0777452925411e8552/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4bf68ec0db23b3011a5a8c0777452925411e8552/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4bf68ec0db23b3011a5a8c0777452925411e8552/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4bf68ec0db23b3011a5a8c0777452925411e8552/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4bf68ec0db23b3011a5a8c0777452925411e8552/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4bf68ec0db23b3011a5a8c0777452925411e8552/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4bf68ec0db23b3011a5a8c0777452925411e8552/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.4962a163.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-uxHuyFJ+id54EdpfetfqrysV8DgLPRFHWkdo1MKdg0W/sbykPvgB3XJX8idTbC7/U21mHQBPqETBV3LUL+rE5w==","shasum":"5949c351bcffc5707e488c76f2adfa9c21bcb148","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.4962a163.0.tgz","fileCount":13,"unpackedSize":201584,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhN/t0CRA9TVsSAnZWagAAiMsQAJI7h8nRuBe231q73EF0\nQOIkHUdzbkJfKpm0uGw+qfRpTCfh1Ir49vF/WeClm4UmPWneenUBj+oB52gM\n2CZZ4+95bY5WYNaTE/ytsvuPpn0Cw7Qkcc8kULhAnJxRYWoXkM51mU5UumnR\nv9StxWshtKXr1yr73/o4nHjt7kjTKT2bEWpFUxFLSnMprAKPLaCQvfQx6g6g\ndTMTJ5KqcoDvR7Ni8dlGr4WjE0CjIfa8VJUy0cjB2jinwTItxWZADZ5yKUjH\nTfFQ1X0QRf8NThmgU4oB2RzvDMkWJbCZDAhPFVO0OZT7z5Pw3clCfKJjJnZp\nSl3RfPFPLtF0atLCHVGLX8jSdwRfYbLPmGmqBpN6/RVwcOVCW7zoj+HvR+Wp\nUcd0G5VaCBX5Ibv6iKI5nR8yYBapFVzkuOuqtEaCIIRPRVlQi6dmrz01szWf\nCC/LfYnpU9uVVm+dF5iMj2aCf/1vS8eWXRI1xyAJwss0d5TpJDmomuS4eh/9\nh87N/rNSzzWC01DcxinUzmYJuhA7EKAeJ4OMxEyQQ37Q0zPo+0Q5WOOU6fXX\niL1+jrBVUhad0nhFk8zHyG+NXSx/JCUVNegCqZSimXoiDGrDMTuHmm/oaiBv\n8eq3/JCzkQqhNd49Bznv+fwfOoOxtf0Coeiv/3mconhRxJ2z3MXvtiM05PGK\nF0SD\r\n=HVy6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFuXz8sFvKtgCTz18AjEEPVv/wZh3e4mUsa12quGJgAfAiBF9m52CzEDvRr7NRohEGQFYGStXvURuK03aON+Pe8Mhw=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.4962a163.0_1631058803912_0.04721815920950001"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.33102bf4.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.33102bf4.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.15981e9d9.0","@material/line-ripple":"=13.0.0-canary.15981e9d9.0","@material/mwc-base":"0.23.0-canary.33102bf4.0","@material/mwc-floating-label":"0.23.0-canary.33102bf4.0","@material/mwc-line-ripple":"0.23.0-canary.33102bf4.0","@material/mwc-notched-outline":"0.23.0-canary.33102bf4.0","@material/textfield":"=13.0.0-canary.15981e9d9.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.33102bf4.0","@material/notched-outline":"=13.0.0-canary.15981e9d9.0","@material/ripple":"=13.0.0-canary.15981e9d9.0","@material/shape":"=13.0.0-canary.15981e9d9.0","@material/theme":"=13.0.0-canary.15981e9d9.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"6445a1dc819d694a36e630269c7d407b8f021e98","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6445a1dc819d694a36e630269c7d407b8f021e98/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6445a1dc819d694a36e630269c7d407b8f021e98/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6445a1dc819d694a36e630269c7d407b8f021e98/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6445a1dc819d694a36e630269c7d407b8f021e98/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6445a1dc819d694a36e630269c7d407b8f021e98/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6445a1dc819d694a36e630269c7d407b8f021e98/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6445a1dc819d694a36e630269c7d407b8f021e98/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6445a1dc819d694a36e630269c7d407b8f021e98/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.33102bf4.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-l1mePXw49ALnW+73JrbeKECPMhySSUV6iiFsmdSKAvVCQUxJ/sa7WiGf1ZGCo1SkiyWYldOJ7L9RVTQlu8k+fA==","shasum":"fb96a110c783ad81a0af228741d96b00a10958f7","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.33102bf4.0.tgz","fileCount":13,"unpackedSize":201584,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhOAAvCRA9TVsSAnZWagAApX4P/Am/b1moR+mDwVQZG3vH\n0QH6ZwnUbdvlJ2I/S86UI4UJxjIhnPMvQPKmBnNM8rNt6TSleoOOEmU100YG\nVk1JuX8v45rQ1oEi5DBlw5M9RfGI8qBRSNWgezOJbPxf84UbZWNR8m37dd3e\nbk0cJBuI2p9pR0d1zRxU7Xu74YTQA5rTdaQUNgwWkJEfEPSTdUM7YbzCz3JM\nf3uQkg+NNAcaPESd/jTmnTHCa06KtCIMdbgVyCoVN2D77jfkt4S4JBZqMNOT\n5yMBkoExNUxjyXh+3KmRU89dMirfymCiaP394Ipjk99bg2njcTY2rcoEHUGs\n2s2qUKKqNtUjx6Va8jexNHz7Q8UfK2zlhzp/qUkjdj0wwuns8jhG3M9l/HMi\nJBpPiO7CkSONcS/OQX59y5rhJhm5SR9DmfkdfVOD74rYm2G4JwavKZ4Ieg+o\nOmmmYbpBSOoz+5ZTyYVSUZHfdhKhT41pRrhNbRxdvkzXwmqFtoRrCT+11ktM\nR/t09UZZ8h8vggV0t9FBsxRGRaqiEdlMidSUePdcki2hjoEqk4YVIsW+IhNL\nk/U9EmYhJX2YevJIjdGp1TwPulkngx+IxgPQbrG8Y6htdtTjr0a9j41Fm4ty\n9emcxZXcIXLu+nHZNNwnzXIO+fcU/o+egmvwd3SqHDFF0Jw1aVWcTO+q5jEb\nvOvb\r\n=4S7z\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDNYhQFfN2yiu1Tczga/FhAbIeaePlzAGU5JFVDYCl8aQIgfhEzUA8POxKWMf71d9AP2yV18gCMSHItTHMfHRLNfqc="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.33102bf4.0_1631060014975_0.41521919022944664"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.76c68381.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.76c68381.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.72464476c.0","@material/line-ripple":"=13.0.0-canary.72464476c.0","@material/mwc-base":"0.23.0-canary.76c68381.0","@material/mwc-floating-label":"0.23.0-canary.76c68381.0","@material/mwc-line-ripple":"0.23.0-canary.76c68381.0","@material/mwc-notched-outline":"0.23.0-canary.76c68381.0","@material/textfield":"=13.0.0-canary.72464476c.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.76c68381.0","@material/notched-outline":"=13.0.0-canary.72464476c.0","@material/ripple":"=13.0.0-canary.72464476c.0","@material/shape":"=13.0.0-canary.72464476c.0","@material/theme":"=13.0.0-canary.72464476c.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"66455113b9aece74b59241859cfad64d4519568d","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/66455113b9aece74b59241859cfad64d4519568d/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/66455113b9aece74b59241859cfad64d4519568d/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/66455113b9aece74b59241859cfad64d4519568d/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/66455113b9aece74b59241859cfad64d4519568d/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/66455113b9aece74b59241859cfad64d4519568d/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/66455113b9aece74b59241859cfad64d4519568d/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/66455113b9aece74b59241859cfad64d4519568d/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/66455113b9aece74b59241859cfad64d4519568d/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.76c68381.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-Y3aAhHJFEag/+84wMZGVgxDXHGwNiqmTR8bgwhIy673Zq/rBwb6fWgw/76QAUEKDO10j3Xpm/zIcDCwMkI7UHg==","shasum":"e8bb2d2dd640d4f606538b4b2b6c9ecfbc5964a9","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.76c68381.0.tgz","fileCount":13,"unpackedSize":201584,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhORl7CRA9TVsSAnZWagAAG0IQAIQ6IWhZqJp32MK6G7Cc\nnBoqNx5+jJqxZrUHhFLfNxmoOJppEZT3+KTGHq/jfDjCudbB4Ia7SfCjfryq\naw3bp9FI0s03TP7MfdSBMn1g8vVs/ND37FaRL4Q+uzHE10vWKaYO+m8yIipc\n092VQ0STW04iJaOpEajqzrqB26dl9ZHDZGsjg06vVhzZ6DXdivgCnYDgakTT\nP6d8MJoUgAQ1b8zcLCbMFmUdd2StolrtnW4u9MGFVtB9XsCc7a4NMBKGq/5p\nt7KuqlsF4lXLVztm1zINqibCqt+0MxGDQ2XregovQrkRbTtUyur5V2u8TWz5\nzjnBPgfC19u6uWws/Xb0oszFf+FboJVbLLkJKH5jRyC4Lbpg7MNmu2qFzH4y\nJE5y0K9/9UKl7K6Hro4YqP5kcvNit6kxmUMgfs72G0qZfPybaj87tVxafGmE\nXaE0M+KRNYNwFzWPuxsNJhSGHos3gt9LaMKvY0DSxJ/0qDxxR4Z4WxayfQuw\nx0QVTOOIqzhcFqbkTe2RqJZznduZR7ZeYtjx5erJASXRD1Tno8ikVqU0CXmT\nYWKFpdUfUQ7bNEElGM8I47vrAHrFQralIzSiMhTVeTW++rRwu3A+O+pkSl4g\n4qRAX2myH1mXyjn/XA5v+8rqy0eqnF/h/LCw7ohS7D++m9uTfjdaD3KRo1Gy\nsyR0\r\n=q7Sv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG1SORxGgM9l/jSmovenso2T1n0aWSg+ZPjfLWZ3KXSMAiA8kiBTQGbHVC0HWGEouDG7f6MWIzU7ktdKFjzJOxiMAA=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.76c68381.0_1631132027328_0.25072576883269626"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.17d51f76.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.17d51f76.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.72464476c.0","@material/line-ripple":"=13.0.0-canary.72464476c.0","@material/mwc-base":"0.23.0-canary.17d51f76.0","@material/mwc-floating-label":"0.23.0-canary.17d51f76.0","@material/mwc-line-ripple":"0.23.0-canary.17d51f76.0","@material/mwc-notched-outline":"0.23.0-canary.17d51f76.0","@material/textfield":"=13.0.0-canary.72464476c.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.17d51f76.0","@material/notched-outline":"=13.0.0-canary.72464476c.0","@material/ripple":"=13.0.0-canary.72464476c.0","@material/shape":"=13.0.0-canary.72464476c.0","@material/theme":"=13.0.0-canary.72464476c.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"eac5c1fc9472a1c28736c4d8e0d423e195fe5723","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/eac5c1fc9472a1c28736c4d8e0d423e195fe5723/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/eac5c1fc9472a1c28736c4d8e0d423e195fe5723/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/eac5c1fc9472a1c28736c4d8e0d423e195fe5723/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/eac5c1fc9472a1c28736c4d8e0d423e195fe5723/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/eac5c1fc9472a1c28736c4d8e0d423e195fe5723/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/eac5c1fc9472a1c28736c4d8e0d423e195fe5723/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/eac5c1fc9472a1c28736c4d8e0d423e195fe5723/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/eac5c1fc9472a1c28736c4d8e0d423e195fe5723/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.17d51f76.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-+GeduMRjrvTyCdE3hQLbbToaAXBqGvkKWEX6VfuvtZQVxDcyAbk6BIVS/LoTow4GEZVJswmmW1ceUq3X1ssN1w==","shasum":"2d45aa13da9cc322908b8f38e6d310af1efc80b0","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.17d51f76.0.tgz","fileCount":13,"unpackedSize":201584,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhOUadCRA9TVsSAnZWagAAD+0P/iSqyRRF7cjszklcOL24\n1gdiHUP55IS/BN2jf4g/FLT2yHN/oi0PCI5XeegHbwVIfqGeSilpeApahNTm\nm+rNYmHfz6eaa6NyKfpbLBrxdSeALMEjWPBoB5p0YlgFn+Xw6oAgX5uzRoXU\n5wLxDGM0E4cd2zlZBgmZerVEGI26jKlbLOHLOxc2MoRBlomJ+Nc9n+77VOuh\nycW+Z6ol+/RMMz+GSAyyrTDGsO/O/1n3YmAQByMk3tfSD0ffKcpP4cLGf+wS\n2GlHh/ts+hXvYPULiZ+bYsKv/5xON1yVSe7RXiDlDRbgbNK/YOOyakQN0RM6\nswAYZRCsjpItgto9mgFeOFD2D/lTeXCfnwnSnNMMzmkAGQjwjoJMvqqSM94s\nACRmpSZfhfmefbd+KUJv0/UUeNeTwcBJruv0K062+jEtjotSlw612f1Fy/0A\nyN5Jg/q1NWRthJ7VpWqm5+g7KM7bMl9VmtRra+dp+J2cOg2WYdhqOgH89hY+\nSrkTjOCXO+vOyGbzseDY6CCWOo92LlX465XVHyAianr5V6tDCBcToVdpDZ1N\nApEBkCE9Rp5q5PuinNrhkz2AiFQWU4hJ+bqFMMRoJ4wEv1/nqq2Qw0xSo2Va\nVAC8wi6GxF/5H9/y9YpnIFtMBBIaKqAMurSpXL1uMuszmgngpHSDL21GpYYK\nGP0H\r\n=MXVw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFf7mLLVA6Ti+8ehXpaYp6pTuReVobareQ/Vdp74S9txAiEAqSaMf7/OFmhL+5v1D23NW5I3x8WoWw/4arabYaQ8T2g="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.17d51f76.0_1631143581755_0.15309713926539126"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.3fae6c2d.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.3fae6c2d.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.864798678.0","@material/line-ripple":"=13.0.0-canary.864798678.0","@material/mwc-base":"0.23.0-canary.3fae6c2d.0","@material/mwc-floating-label":"0.23.0-canary.3fae6c2d.0","@material/mwc-line-ripple":"0.23.0-canary.3fae6c2d.0","@material/mwc-notched-outline":"0.23.0-canary.3fae6c2d.0","@material/textfield":"=13.0.0-canary.864798678.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.3fae6c2d.0","@material/notched-outline":"=13.0.0-canary.864798678.0","@material/ripple":"=13.0.0-canary.864798678.0","@material/shape":"=13.0.0-canary.864798678.0","@material/theme":"=13.0.0-canary.864798678.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"5647a60f5efcc7d6235a12c1bcf6c703db6d00a1","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5647a60f5efcc7d6235a12c1bcf6c703db6d00a1/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5647a60f5efcc7d6235a12c1bcf6c703db6d00a1/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5647a60f5efcc7d6235a12c1bcf6c703db6d00a1/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5647a60f5efcc7d6235a12c1bcf6c703db6d00a1/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5647a60f5efcc7d6235a12c1bcf6c703db6d00a1/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5647a60f5efcc7d6235a12c1bcf6c703db6d00a1/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5647a60f5efcc7d6235a12c1bcf6c703db6d00a1/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5647a60f5efcc7d6235a12c1bcf6c703db6d00a1/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.3fae6c2d.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-h/CFVLB4/QOy6PaOBEXlU+V/CUZvpmJqk4P2uPdPl8FDR1eJnODM0pZo14k975NoPWhjFF97MUf0tEWmxNt0qw==","shasum":"908e707f55b6ee551effd7f288ffc26dbbb3be2a","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.3fae6c2d.0.tgz","fileCount":13,"unpackedSize":201584,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhO6TZCRA9TVsSAnZWagAAKngQAICV4i1DOFCisbswJbJ0\nhtJF+zvir+xQ3gDe0NL7oFfUeO6ELBGAExSnRYftK0+R9rMk/V9bjPR+r64h\nWis4lkzYkZapwCanrqnUu0Qn1T7DHsYwAISqX67WOnPh4qhSh/hgELKnqgmu\noDUbT0uzO39qNRhIxXgv5Z7yuCEdSXhbQv+knEIVWKN6k5CoIg9WWboZebta\ncvGaRGAqOfhzt9zmiFdcrSyBy6YzKtj5VILW4KpAxo4GxI/GyVn2BUIp/kX9\n3bbaiDxpXDJn0OZSqzbDOr+TZZzPuHbOSl5aFBROSXoXf2N0eEFqbqyvfPje\nUzt83hDL7OhoDV6MEh+rnxxYLZW2UZOzOCYaQZrrGlcgFqAsMiqAXB7KJUu4\nLyDgAFhg/2ZB+9dIFoMNNEWGwoMHqMlsNR5kOTtlD3cIxXEcGe/l+qyWen4a\nXMhI/NvZxuVeMXDJabpWRXjEyEcSEB5iCMg2sA97eFbENbfkUEP8bPtfoosM\ny3IDuy/r8S6IspQaROAaiVILd1XEWzT1nt8snhjo1uu+bZzLzP8Bs4OU5Qzf\noTDgxEP5kiRuMu9BgRsujYr5hcMSERln7nbatFIRXMuQGQcCMeQWf3WQxv/3\nmpUp4j6NY733ePPIMdRRZXlcapI4UU3sggutCYaf3PS3jlQdz/zycsw75oRr\nPJ5E\r\n=s0qR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBS4TriK58Xszkh/uP7RWpacULReHcR1tAHkyPFGkuTIAiEAwIquXFtowP5TT0XNgzCzACy573QYm5E1+sM5h7RG3oc="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.3fae6c2d.0_1631298777339_0.7062062836321112"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.f1958c4b.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.f1958c4b.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.864798678.0","@material/line-ripple":"=13.0.0-canary.864798678.0","@material/mwc-base":"0.23.0-canary.f1958c4b.0","@material/mwc-floating-label":"0.23.0-canary.f1958c4b.0","@material/mwc-line-ripple":"0.23.0-canary.f1958c4b.0","@material/mwc-notched-outline":"0.23.0-canary.f1958c4b.0","@material/textfield":"=13.0.0-canary.864798678.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.f1958c4b.0","@material/notched-outline":"=13.0.0-canary.864798678.0","@material/ripple":"=13.0.0-canary.864798678.0","@material/shape":"=13.0.0-canary.864798678.0","@material/theme":"=13.0.0-canary.864798678.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"e5f5a818f48eaa5a69419b7c2ef2439b4d7fc5be","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e5f5a818f48eaa5a69419b7c2ef2439b4d7fc5be/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e5f5a818f48eaa5a69419b7c2ef2439b4d7fc5be/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e5f5a818f48eaa5a69419b7c2ef2439b4d7fc5be/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e5f5a818f48eaa5a69419b7c2ef2439b4d7fc5be/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e5f5a818f48eaa5a69419b7c2ef2439b4d7fc5be/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e5f5a818f48eaa5a69419b7c2ef2439b4d7fc5be/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e5f5a818f48eaa5a69419b7c2ef2439b4d7fc5be/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/e5f5a818f48eaa5a69419b7c2ef2439b4d7fc5be/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.f1958c4b.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-1OYjcui+GE0D/aUUct2iGChjMieB5S/3yK3hoaCzMX0vyZ/YOFUTLQ8O5inT7NBe3RVyMd3yivDWjBmFZC1Rew==","shasum":"dd031a72fe6a3bb3819acbe7e9cb744ea681f207","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.f1958c4b.0.tgz","fileCount":13,"unpackedSize":201584,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhP6SJCRA9TVsSAnZWagAA+j8P/0Bxh13YuBOKM0dyD/Xk\nVc4W71kAdS6VzIRlQfLJhxCq5BLufXH/evWwwKWj/LCabfFb2QFf6Bjk+Zm/\nKNmjllJac/f+M8QTiHJfkVx7p2hzRq6z/PUH1Hfo7W8VvDoJhRP1sXjxJ1xL\nW5qpHT4wzZW6G1yT+4j6RFeXssoLYTvltweN8BWsjLXGoTnhKLYdx50YGb4c\nB8vFoksfljOVVPUuKQxPuj9Pf+KEM1DSmA9KzYNTOuLGIMTyRcE0Hhpx70e9\noEex8mwq8FifPvKvGf37U+YdewQy5JEhE3Y6whmeSEwyb6a2pHpo1u/ShHvQ\nJO+jFTlc3yOWSCsr9v9ChgFPiYFX+VplJsoU+VkEwCmjsJsNRnxwUvImJdC7\nqJ23DtJumF8KBNrq7+4dZBnwgl//6woWuTPz/HVd/dHCPQwPAlcn/d9yL2u5\niwdtjNYrUVuYTf1nw8QgIMo3ITC+qQj4h6XryW5vFjtelNVCuTbYpjoX7UaN\nGTcMKYJ0i1GcOBqileer8+M1lK5g2QodXUVzevajF7HGy75Ipyo/obXZ7vNu\nPCj063RyZPeLBFakvz4cwjCI5QLbwSRi/ldBzjFh9Iu0C7sX4AlXtUIrf8f6\nvRexzCb2izJxwamP8RQqfsjBdu3AYOw+z7LUThn3HnF8Y8orT+RYFYxuFuqQ\nyrg4\r\n=I3e4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDJBn9tVwYW52LheqV6MQWsZD2P7ECO4kUAFTioLHVlbAiA79dT6p8zssJnt+adaD6lPM+hIytkRSnjqt9mQAUAgHA=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.f1958c4b.0_1631560841084_0.871704760804979"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0-canary.78abbd59.0":{"name":"@material/mwc-textfield","version":"0.23.0-canary.78abbd59.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.864798678.0","@material/line-ripple":"=13.0.0-canary.864798678.0","@material/mwc-base":"0.23.0-canary.78abbd59.0","@material/mwc-floating-label":"0.23.0-canary.78abbd59.0","@material/mwc-line-ripple":"0.23.0-canary.78abbd59.0","@material/mwc-notched-outline":"0.23.0-canary.78abbd59.0","@material/textfield":"=13.0.0-canary.864798678.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.23.0-canary.78abbd59.0","@material/notched-outline":"=13.0.0-canary.864798678.0","@material/ripple":"=13.0.0-canary.864798678.0","@material/shape":"=13.0.0-canary.864798678.0","@material/theme":"=13.0.0-canary.864798678.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"638a51a3b3f96617a9be7f61f87afebe78d24a23","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/638a51a3b3f96617a9be7f61f87afebe78d24a23/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/638a51a3b3f96617a9be7f61f87afebe78d24a23/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/638a51a3b3f96617a9be7f61f87afebe78d24a23/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/638a51a3b3f96617a9be7f61f87afebe78d24a23/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/638a51a3b3f96617a9be7f61f87afebe78d24a23/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/638a51a3b3f96617a9be7f61f87afebe78d24a23/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/638a51a3b3f96617a9be7f61f87afebe78d24a23/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/638a51a3b3f96617a9be7f61f87afebe78d24a23/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0-canary.78abbd59.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-E6t7PnxXMSVAWvYtPv7EbsBohOZ39g1YhWLKcqWtuaz38hDqOTCwbWgdZWr+k99ioHFZUUJYWFFo2C9nOJjKwg==","shasum":"016e9a00936f5460b0b2f39a15d5ad06fca21cee","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0-canary.78abbd59.0.tgz","fileCount":13,"unpackedSize":201584,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhP8H6CRA9TVsSAnZWagAAzgoP/0fi3f4Q3GPFZ+xUjufk\nxo5EzD8+i7cLoDEv/fNpANwO3dy/GocA2P0wxO5/H5HxfHZUsRXk12uf9/cX\nqQ32oh2KFK36cwDOKMNonITiNPnTltvMbRt5r5bMT4FkCQ1AYCr5jMP9a4xb\n8mwwFtkylm+hOgN5/eQtqFWSTcbxM+zYkAraCz1hK1nsFb2RXBn+U/DEXnrK\npeoSi8EHvOgipxR7JHJcEknTqFioHf9xp1hvkxPqhUDBedbZGtuw4PVCAHdP\nqVGaYZBVgCaO+VViuLvOp1m3I3aZJ5Eihz1vN1TmCx/f63bAJ09vHiQzKNjR\nVK5dc+8R5xMAqSWbiLiJ/dkdzHf9rX0oVJQsmfM1SoWcy2dxdPGsdTIDgXjW\nlu9QT+ruCIdP7MTgW7zaK1dxLe8lrtScrzno4PmHIei1Vkxl2FkzvbyqkGBO\nU9YyCeGx8gnQk35V+T3yY/gZe1qJDHJ8uaxZnkj0Q/6q49bYupGeyT+93cqM\nPGGW6J27tJoy5uOz4bKOW4w7zuWMcADl3e2mMqx2Ak7ABGM+8DcWISQeENck\nztKhJA0ffAoQQTU1YDra628m3/bfZKz6AqGWoHPWMWtLteyIldkagh9hwQUW\n8qSCsi+TgwSfnU5YV48VLvJzlHlWpvzX/xQ4eyI99V4Ov6littKy6RycCcbg\nEvmU\r\n=97+7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCbMtUasy/wMRCHcUb7+Sf93fGdFVaq4Zj8To1DM6W8JAIgAOx3HO7w1YELYnjHIej3rkBlGmSygrckbnFw/owLngg="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0-canary.78abbd59.0_1631568378768_0.2471474677103287"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.23.0":{"name":"@material/mwc-textfield","version":"0.23.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.864798678.0","@material/line-ripple":"=13.0.0-canary.864798678.0","@material/mwc-base":"^0.23.0","@material/mwc-floating-label":"^0.23.0","@material/mwc-line-ripple":"^0.23.0","@material/mwc-notched-outline":"^0.23.0","@material/textfield":"=13.0.0-canary.864798678.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"^0.23.0","@material/notched-outline":"=13.0.0-canary.864798678.0","@material/ripple":"=13.0.0-canary.864798678.0","@material/shape":"=13.0.0-canary.864798678.0","@material/theme":"=13.0.0-canary.864798678.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"9830d665867dbb440855339d9181b5c323202008","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.23.0","_nodeVersion":"15.10.0","_npmVersion":"lerna/3.22.1/node@v15.10.0+x64 (darwin)","dist":{"integrity":"sha512-n/cmRBNC5JYSk5G6szTZeN4ZjGoHnL3lo3f2F1WXS6w1OqF7rDr+xIR+HHWB/j2GmFyvjiNCUEiawf95ZLK26A==","shasum":"ea6209bff605c3f59871fca99f0f30c3144049c7","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.23.0.tgz","fileCount":16,"unpackedSize":297483,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhP8QyCRA9TVsSAnZWagAAchMQAKEtDK7sbISmxz6zkXzR\nR+EoD6ielvUzTmtr3+1IFmqZgmAKtOZqLbMZkeFtAlR6Yh4g4tRoxF1Dhvi7\nK+C6/+C5jRnP/BimOK7mj6IhH9r/MvijBnxZLiy+6Yi7sPuxlK5EAFb6Oztx\n1oJ5yebmjiarCgTtXliOP24P22azLV+S77u051qM+ZsuAUrKrq8rD08e7rqF\nqH8DsiDAPS7MPWX+I6gpnNwP9VZM6eBOWZ4oOhhRXnLsR9nCzGDwd1BrJ04k\nJNi94b45FMqDm2RXB39TGkqRI6ZbxI54COT6gLU54a6dbDgGAtu4N6LYYUym\nGMXFPgMe5WacSfgO63ozZeZvxwRIQfOmF4JkRmnPUIEhfm5NUOAQ72/vsp0u\n9gvAE99LMLCftkJxa6+pIHR+WWU6pfu0r/ylV7wSnx0MEYxHxo/Z/ni3Cm7M\n2ajJf7ST+0mQqufY3PY7q0kyawhmM9gMRnYRJjrTYgaY+TCSKkJ60W5UgTpH\nAuyHjXSaL9C9C2KnfbS2ErIXSltSWQ63VzOklBo7indIbXeAoHkJswOSY/rZ\ngWubl1jQnMuDGgi47JgHl1mFL4893gMqgua5JzdE8/FIGpfIFyy9nxRFDQIG\nAh9Zp6GfKugId2fEavxJXEEbRP4XjOmZXbHun/xGFxXjyqNRHnYPKxjckWyP\n6hRf\r\n=JApA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEzMFLemLJTmjRrM8ggtM4npdfQBBkD4dvSCQzaMbb2iAiBi7DqgPfdkerjkM80Z8Zoo9TQwW6MUbiFbsC38dM9stA=="}]},"_npmUser":{"name":"emarquez","email":"emarquez@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.23.0_1631568946383_0.35301352369686745"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.24.0-canary.9830d665.0":{"name":"@material/mwc-textfield","version":"0.24.0-canary.9830d665.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.864798678.0","@material/line-ripple":"=13.0.0-canary.864798678.0","@material/mwc-base":"0.24.0-canary.9830d665.0","@material/mwc-floating-label":"0.24.0-canary.9830d665.0","@material/mwc-line-ripple":"0.24.0-canary.9830d665.0","@material/mwc-notched-outline":"0.24.0-canary.9830d665.0","@material/textfield":"=13.0.0-canary.864798678.0","lit-element":"^2.5.1","lit-html":"^1.4.1","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.24.0-canary.9830d665.0","@material/notched-outline":"=13.0.0-canary.864798678.0","@material/ripple":"=13.0.0-canary.864798678.0","@material/shape":"=13.0.0-canary.864798678.0","@material/theme":"=13.0.0-canary.864798678.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"964716e9985c1d08cbf280a6c7a4093be800c67d","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/964716e9985c1d08cbf280a6c7a4093be800c67d/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/964716e9985c1d08cbf280a6c7a4093be800c67d/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/964716e9985c1d08cbf280a6c7a4093be800c67d/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/964716e9985c1d08cbf280a6c7a4093be800c67d/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/964716e9985c1d08cbf280a6c7a4093be800c67d/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/964716e9985c1d08cbf280a6c7a4093be800c67d/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/964716e9985c1d08cbf280a6c7a4093be800c67d/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/964716e9985c1d08cbf280a6c7a4093be800c67d/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.24.0-canary.9830d665.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-Lm3sM0B/bBbahkVAyccnXsOiEtY8tliUhtlXxiIRrOlXmN67WFwdWgh+m1+GJRxpltm04aNi1S7e1plq54CD5Q==","shasum":"b1e97d0da4c20d5396f3cd5f236748ebf7f40826","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.24.0-canary.9830d665.0.tgz","fileCount":13,"unpackedSize":201584,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhP8SDCRA9TVsSAnZWagAAteQP/A7RoSBp30P9l0dHwhff\njRxpLc4APd79juAbKUd6o9WG+LiSKa5Ht7pK2j7RYBuAGpHrTIwUCY9vp6zR\nVKPXPmfsWGQycUxVYfAqMA1qXYT3sUqYyWPpBGGHw9CifoFGa3PukRQqFt1k\nMhCUnZGJJiDgO7ShOh6ceEvsE1AJSyhRgrJWfqiY2xcAEYD2fJqTHBdpKZ2V\np4MNsMjkePAFeKHvf4taLfO3FPLrzRvztNtqo0LRe3DnJRY+YfId4bKdP7fY\nymX3/AHVVNRVtScmTSMc2HSpaxtmZf8nCd2wLK7Xh2TzE8TZNEJnWmNctnps\nyntfgVg4lKUEHV3JjehR8L0wwo30DV/kzEDGM25AQZHSIZauqcKh9PfNX6vZ\ngQ3acNKfFhTnfQKSlNa5jevIiNOWpGNuPSUFj4rr5zK3G2zzzn3fNbaJeBNY\n36yr3eQ8vk/ZU7Tq1yPho5xf13qOIqvjz5LoP5JURu29wGmPF8g8q9kYlLy7\nzQnM/b0IsHYeTR39+CsZwU4Ya4BXvItNd3B36tCNdZEqqZZPGLwhsOiM8r5B\ntFwKvmMs1IQXpkMmN+19wXldQT/9NMFCxrWPOng2pldrtFqlMherqK9rS8bb\nra1tBIdcblMCyqHzW8PZijSeCdAeCfPygzV5gN/MUo4AXXDr3xW/dwTubyUh\nyqt7\r\n=rFn6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF6aDmZLcQvAWaExO99hGTvNibqBjA1C6nlgcTxfu5JTAiBJunbSAmFq1zyZotN3XhMPGM2K2HMPHP4HFvJ6vCg63A=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.24.0-canary.9830d665.0_1631569027819_0.317562484670338"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.24.0-canary.20e2081c.0":{"name":"@material/mwc-textfield","version":"0.24.0-canary.20e2081c.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.864798678.0","@material/line-ripple":"=13.0.0-canary.864798678.0","@material/mwc-base":"0.24.0-canary.20e2081c.0","@material/mwc-floating-label":"0.24.0-canary.20e2081c.0","@material/mwc-line-ripple":"0.24.0-canary.20e2081c.0","@material/mwc-notched-outline":"0.24.0-canary.20e2081c.0","@material/textfield":"=13.0.0-canary.864798678.0","lit-element":"3.0.0-rc.4","lit-html":"2.0.0-rc.5","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.24.0-canary.20e2081c.0","@material/notched-outline":"=13.0.0-canary.864798678.0","@material/ripple":"=13.0.0-canary.864798678.0","@material/shape":"=13.0.0-canary.864798678.0","@material/theme":"=13.0.0-canary.864798678.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"4912005504dcbf47a4f5fee3ef7d4b37cfb48606","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4912005504dcbf47a4f5fee3ef7d4b37cfb48606/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4912005504dcbf47a4f5fee3ef7d4b37cfb48606/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4912005504dcbf47a4f5fee3ef7d4b37cfb48606/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4912005504dcbf47a4f5fee3ef7d4b37cfb48606/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4912005504dcbf47a4f5fee3ef7d4b37cfb48606/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4912005504dcbf47a4f5fee3ef7d4b37cfb48606/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4912005504dcbf47a4f5fee3ef7d4b37cfb48606/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/4912005504dcbf47a4f5fee3ef7d4b37cfb48606/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.24.0-canary.20e2081c.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-Besx3w+YDLcvICVRrsm8NnDeNg9sTT/F8cJC10yqZnocepSEfkfhCTzpQ2ARMow08WTflelILbJJP7PdUfN77Q==","shasum":"b1e642da443947af1eec6289d37d07281c5bf980","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.24.0-canary.20e2081c.0.tgz","fileCount":13,"unpackedSize":201592,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhP997CRA9TVsSAnZWagAAqZoP/ROHtYR5rB0Rg4pD53/e\npefXyyRh2Casymr/l0NwdmTfxyCyhoxSCp9cuyN5fIh9jNNPtSu4LXLjwQeC\nQrUAMsl+tvs59/fLUhKL7Gg9bPQDoPonWu28utMMPdIHqiyCDKkgd6OcDXCM\nUx9d7yzBjNUCl8Q9mAZ8+Oq9kh16ofBuDDgCzMhXMZiYrhtkBT6okkC+vIkN\n50p4+P1RYhuNfoyYfpMv77ilRWMZIC4aj378aB0sbTpvRSixZWnS2aqLpWcb\nO5uRw2YZwBNJLeYXwhcxAZlMGnafcCyCPgtKbFEvPn4z7fcw8FRsEuPzlMF7\nrnGMYENW3iQ2I485VZpBqpvQKHnBGkzBu4WXBqdLsXH+Zv+s94ge3Rq+d1H7\nFBMJBiPJXuODLAYoWLvpKG8zj8rqXTevlmpMJiu9d4SrFfbex/BCp9kHwwWf\nUCxIyeQ+l1h5u/L9lwC0jG8/vj4RMc/FifTk1AWQr5DZADQySe8yUMCBPnHy\naPTEae8svo9DhX7ZVd9Aw/dTE4vRDS5bEdNJkCKYi6W/T3jioc3E1CLNbcD5\nKFE9wIZHIUISRZFzZ4YAe2q1ISHh9/cphCCCtkzFrVfwro8N/jKuwQZe4iMW\npo/41N5hA7uSguV/0CHgZEFFnsC7vDYaQ2yuRwpmjW4TrIA5eeBNcV3PlLi2\nM25Q\r\n=dtBk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIATr3Sn8jRp0+YgeTjwuxeGDP+k4NRaawyyco3MXyBvlAiBTQB9qN+BaiA0PqWiXNvcyyI3vOcebIAEi4hdEvNq4mw=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.24.0-canary.20e2081c.0_1631575931562_0.7366743664337627"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.24.0-canary.583613a9.0":{"name":"@material/mwc-textfield","version":"0.24.0-canary.583613a9.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.864798678.0","@material/line-ripple":"=13.0.0-canary.864798678.0","@material/mwc-base":"0.24.0-canary.583613a9.0","@material/mwc-floating-label":"0.24.0-canary.583613a9.0","@material/mwc-line-ripple":"0.24.0-canary.583613a9.0","@material/mwc-notched-outline":"0.24.0-canary.583613a9.0","@material/textfield":"=13.0.0-canary.864798678.0","lit-element":"3.0.0-rc.4","lit-html":"2.0.0-rc.5","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.24.0-canary.583613a9.0","@material/notched-outline":"=13.0.0-canary.864798678.0","@material/ripple":"=13.0.0-canary.864798678.0","@material/shape":"=13.0.0-canary.864798678.0","@material/theme":"=13.0.0-canary.864798678.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"6362ae780108c56957ae78e7b17d5a13a17b286a","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6362ae780108c56957ae78e7b17d5a13a17b286a/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6362ae780108c56957ae78e7b17d5a13a17b286a/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6362ae780108c56957ae78e7b17d5a13a17b286a/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6362ae780108c56957ae78e7b17d5a13a17b286a/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6362ae780108c56957ae78e7b17d5a13a17b286a/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6362ae780108c56957ae78e7b17d5a13a17b286a/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6362ae780108c56957ae78e7b17d5a13a17b286a/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6362ae780108c56957ae78e7b17d5a13a17b286a/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.24.0-canary.583613a9.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-He9/qwnEKjr5SgZACfKutpExvl+h5Yltmny5T6jDTICwNX2T+MB1m5Hwf8JEXZOpKl1V+vieXJTV1SNa5R0AJg==","shasum":"fce344b328b01446a6f146710075c2a9bc0e2aeb","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.24.0-canary.583613a9.0.tgz","fileCount":13,"unpackedSize":201610,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhQNP2CRA9TVsSAnZWagAA9QgP/3aLskkYpnQIGXtw8TFF\nDVx4DLTRSa6zVU+bdTrnwkcGsRar1WdrQwJj0zKzOHDBCyXO3v6CY5yRJpmK\nXPCtfb3JN8+BdS+Kd46v21QWPOtwBAJZoQM1FCy+fLhzi0Nys9oFS+2BRs2g\nlKLW/jN34RlCnfCsB/qlGJEw8NQkWxlSheztwe3cwsjAvz4nr3ELKL2PJQzI\nLtEk9wMMdu5sX8Zjq0r79qywgS9JYy+zW71oNZFax+GyRZ9puxiThUYqcdYy\n2Y9UbARcO5o9SwzEr11Abtfun90zu1Isi0EtapWhf8/ch28sy7f18tPezw1O\nLEmf153PPRnsjyXGZaP0xEUeuQIkBejJiykWDFtHyOdgE2M8htRfjgm8WSBA\nL3GFK/nvu5dycu5z67inHvtmnnke7hoabO4TIR2GRb6TvVnBQoIicKVntaae\nj5o8bAzs/lRybDmjN1QToYCbLYIQF1/COcY/1vUHbUs6QJzglH18LGfcpn0t\nZluqQ404SbC3+i4v8FNcUDviWJ6Ge9yXuztlgE8wE3GBBKPst3y+/Pd5SNAV\nvMMkCyeF/u583fcBiOuEYm/TSZJbFolLmUpMgeX186tiUMnPyQ4EsoxgjXux\nejcB7KtYjszsOSDuZXZ9kMeHFJdv2WXuw2WRNvJCj8av9ZDOOMVnZ2bBOsV2\ncHIG\r\n=Ks1/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCBXFDF6uOAZke0PSW9Zb8F8wkX7SQWTmrvLGxvDI26UAIhAJhrHMbDY1+Wr8Cq/2tlP46ry9De94imL5WQIbeA9nxi"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.24.0-canary.583613a9.0_1631638518237_0.5820285295962169"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.24.0-canary.0e1bd56f.0":{"name":"@material/mwc-textfield","version":"0.24.0-canary.0e1bd56f.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.08398f880.0","@material/line-ripple":"=13.0.0-canary.08398f880.0","@material/mwc-base":"0.24.0-canary.0e1bd56f.0","@material/mwc-floating-label":"0.24.0-canary.0e1bd56f.0","@material/mwc-line-ripple":"0.24.0-canary.0e1bd56f.0","@material/mwc-notched-outline":"0.24.0-canary.0e1bd56f.0","@material/textfield":"=13.0.0-canary.08398f880.0","lit-element":"3.0.0-rc.4","lit-html":"2.0.0-rc.5","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.24.0-canary.0e1bd56f.0","@material/notched-outline":"=13.0.0-canary.08398f880.0","@material/ripple":"=13.0.0-canary.08398f880.0","@material/shape":"=13.0.0-canary.08398f880.0","@material/theme":"=13.0.0-canary.08398f880.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"0ac1a8621875726916642015e273dc177d29abc9","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0ac1a8621875726916642015e273dc177d29abc9/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0ac1a8621875726916642015e273dc177d29abc9/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0ac1a8621875726916642015e273dc177d29abc9/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0ac1a8621875726916642015e273dc177d29abc9/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0ac1a8621875726916642015e273dc177d29abc9/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0ac1a8621875726916642015e273dc177d29abc9/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0ac1a8621875726916642015e273dc177d29abc9/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0ac1a8621875726916642015e273dc177d29abc9/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.24.0-canary.0e1bd56f.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-r7IahOvVj3pnpzuZMs5oVDExVta5S5MhuafXG4gMWpWohTJav4Dw+d4WJEP/mz4mjY0YruU3nct3iLQi5jeT/g==","shasum":"cd23fb10d8c5dd550ac38c024613a88a18cbad1a","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.24.0-canary.0e1bd56f.0.tgz","fileCount":13,"unpackedSize":201610,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhQNyiCRA9TVsSAnZWagAAieAQAJHk29UY4kc7U9wd20nG\nobliyIy48WXVUtVRlmaPZAVAX+vH6Z4PjaXd7bG4ZBCYr7s4i2mcpNGRObEn\n28ZY3hjzXIaJazejgLiVEleLGVPfsK/m1Kql6KyYYtXqGcwIoQY/KsKKWsP5\n7jDhGCKAVzGmCM8quRZTJPixMefTJ1DHYnYOLCwPmB8/2lkgzQlPNnnZqqT0\na47Px4O+o+d6P2cgC546YBjlvFSg/49gFgpaJXSk6UguqLsMBGbfHl2WGrDk\neDafX6marX23/q3oddCTC+YBY7VnmW3KC9zpmof798m+XT0RsfhiIywiTlpl\nrSlcUtBu7Af62v9zlwfDrJjTo8slgg4f4wjx14RGYFN6PU0GCP2MSUQjcpc/\n+Am71xHKMDXePLVtpFT6anGG4kj/250KkDmyGZEY5nbiL6mAKVEnBy94+3CY\nxZxKgquQ/9ifAEinHydaZ0abODs15Cx1MjEK7a3W6H+CaVLa5wH9lUHwov4G\n2et3vkG0ONK8wa5AHrAuJh8IzkM+WgQCH8Op3DGgwhydnuxWZUcgrAm9IE1f\nmz0EELbKv6QR3B1Y3eZgVeaVwKiiH/TyS3ScFe7+chw6eqx7eU1vFP1e0jIi\nbru0NMd92va8orSN3D1CxvNf/7Av1cG4eMJOwo/GCGThj7u947L9Kr89LSpf\nx4/+\r\n=VrhD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC4ccGKIlI+BbZPb8gDHXx3neP6zAJ22oL9//fLohdHBAIgWHTamsn4KTeGmQwmuAKFCgmk2lmPOnXBgRvU7i5/HFg="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.24.0-canary.0e1bd56f.0_1631640738483_0.8759156397138788"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.24.0-canary.7bb1818e.0":{"name":"@material/mwc-textfield","version":"0.24.0-canary.7bb1818e.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.08398f880.0","@material/line-ripple":"=13.0.0-canary.08398f880.0","@material/mwc-base":"0.24.0-canary.7bb1818e.0","@material/mwc-floating-label":"0.24.0-canary.7bb1818e.0","@material/mwc-line-ripple":"0.24.0-canary.7bb1818e.0","@material/mwc-notched-outline":"0.24.0-canary.7bb1818e.0","@material/textfield":"=13.0.0-canary.08398f880.0","lit-element":"3.0.0-rc.4","lit-html":"2.0.0-rc.5","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.24.0-canary.7bb1818e.0","@material/notched-outline":"=13.0.0-canary.08398f880.0","@material/ripple":"=13.0.0-canary.08398f880.0","@material/shape":"=13.0.0-canary.08398f880.0","@material/theme":"=13.0.0-canary.08398f880.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"b34bf652f1b82b80ec01a0ffcec5dbb2dc950485","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b34bf652f1b82b80ec01a0ffcec5dbb2dc950485/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b34bf652f1b82b80ec01a0ffcec5dbb2dc950485/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b34bf652f1b82b80ec01a0ffcec5dbb2dc950485/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b34bf652f1b82b80ec01a0ffcec5dbb2dc950485/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b34bf652f1b82b80ec01a0ffcec5dbb2dc950485/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b34bf652f1b82b80ec01a0ffcec5dbb2dc950485/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b34bf652f1b82b80ec01a0ffcec5dbb2dc950485/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b34bf652f1b82b80ec01a0ffcec5dbb2dc950485/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.24.0-canary.7bb1818e.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-pbCvJUYH7y/lIFyy4O3pddRUk7KrCChPADoJQ+VmkqvkaZuOzxcimE4tr1cYlE6XgiJMtFD+87ofSGa9V1vQKQ==","shasum":"8d289cd1da652bee9c1b628ba9a07e519235d947","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.24.0-canary.7bb1818e.0.tgz","fileCount":13,"unpackedSize":201610,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhQT/qCRA9TVsSAnZWagAA/5oP/jJQUlo9yJLEygObgMUR\nqYH6lHgX45tmXxVyIHX2KlFKMiHjF68k9lUjYardsY4iOhTP+/was24fN4dn\nmmtRK4g9aaytjkEO+h1T0TCUp1gF9dVhapMfneAzbEb9js56VwEZ3aGrYci6\n5kj5wQJWEjSLbC2sjJ4r3QomTSS9w7h7UIMV0jcAXHlU/L9UO+OM0xC7C8cw\nhZWSkImffmGBBA/EMpTKjTnRf+3ef9r7gqFvzlJyzTMr1IQtI/3hszfrFZeC\nD4hdlLQvGoxk8uUF9WWHO1AOy4DCK92Ix8rifvVbdXvv7lM93GLA63irBtjq\nd3TUfjlfDShmq2+/2iNk6fwaVmEMyQe9xfpQ1wMR7AP3lQ6mrjimvgPg0aLh\nE3jrhgM6/6IgPOk4QYkLU6hi1Ma7OITLqAhPR78m57Bb7Y0TszNlQPkKJVbS\n65kaY3yMIFN0XA21y9/vgC5+RSpUEGtz+woQhCegpee3J0iGtt/ZV1jwRaQR\nYwBLkyk4FNwqrdFxR56UMPrh0YcqG/zC0pVxmLTUfSYL8KyGmFYTLm05Hsvg\n3bUwNjngA8xlH5Bq6QIVQTaS1866cxWe0tOitANVOyApt0neln+bdVJ1DZKg\nrMs9BZT+cWyCbUOW0UzdWlASeq7L2XVBx4FPhrdnwOiyvylCcbxiVmijjrJ5\n/LA2\r\n=7J8N\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC8C5LwEwPAYdyVWlo2h667rfbQZbY8X7Je1pAiDBh7vAiBvaaYDQFwYyq5ipWo9XoD2IPJRBTcWftllmXiDOm5ovA=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.24.0-canary.7bb1818e.0_1631666154064_0.4507679174209074"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.24.0-canary.b5e665a9.0":{"name":"@material/mwc-textfield","version":"0.24.0-canary.b5e665a9.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.818f4ee93.0","@material/line-ripple":"=13.0.0-canary.818f4ee93.0","@material/mwc-base":"0.24.0-canary.b5e665a9.0","@material/mwc-floating-label":"0.24.0-canary.b5e665a9.0","@material/mwc-line-ripple":"0.24.0-canary.b5e665a9.0","@material/mwc-notched-outline":"0.24.0-canary.b5e665a9.0","@material/textfield":"=13.0.0-canary.818f4ee93.0","lit-element":"3.0.0-rc.4","lit-html":"2.0.0-rc.5","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.24.0-canary.b5e665a9.0","@material/notched-outline":"=13.0.0-canary.818f4ee93.0","@material/ripple":"=13.0.0-canary.818f4ee93.0","@material/shape":"=13.0.0-canary.818f4ee93.0","@material/theme":"=13.0.0-canary.818f4ee93.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"1098b7010fbefe404afd06dfc30b7b30db59b092","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1098b7010fbefe404afd06dfc30b7b30db59b092/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1098b7010fbefe404afd06dfc30b7b30db59b092/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1098b7010fbefe404afd06dfc30b7b30db59b092/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1098b7010fbefe404afd06dfc30b7b30db59b092/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1098b7010fbefe404afd06dfc30b7b30db59b092/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1098b7010fbefe404afd06dfc30b7b30db59b092/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1098b7010fbefe404afd06dfc30b7b30db59b092/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/1098b7010fbefe404afd06dfc30b7b30db59b092/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.24.0-canary.b5e665a9.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-ydcFkZ4FJGimJbpGVv2ahp9b+zzyI/g/1Zqjj7mBwUCiBM/cRhZWwJAJoSJJGhS6x8NO9q5yN1QfFwGeP685Tw==","shasum":"3a8413c517ed1aee670ba74843f949d3815ee3ce","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.24.0-canary.b5e665a9.0.tgz","fileCount":13,"unpackedSize":201610,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhQje3CRA9TVsSAnZWagAAtdMP/RscA1c8oy8Z3fyfpBIK\n/F5zKTNA982hwrlwOiBx2eYZJzGsQUFT45vRf/uSRmeWbQNfaAzbQPHFEQFv\nIP7nSsN6Ykd2po1HJw8foDPRg60Hf4eeiKWr34W+44WkKJ6/4eb/idnTxqKp\nQeKGmigmCae2zp55gBTivnobKd8rhuklG2IQxbVQgVSpJnMOzh1LnIGc4sv9\nLKU9RsjeO4bJ2nj0BMADwTgQPVKfGQiqMuGm/ZnW4EjGEHrhk6TwFIHcVpNT\ncQuVnL/3I7b/hzrCeX+hr3IbkcY63fd44U92tsJQydKjFdUDuBssJUvW+g75\n59AIzWiMlEnuW00KM4kvm9zoxd7V7Kjp+cDREvaRTnC8lwV7iImLpxacFGd+\npcwWX1v29EuWh3Swlsdnwft0sZ0+DruHK2Q9BuPi5jGaiByINGuEOYafJchv\nXRn7ZElDamaeSSnhuvQVH9A5oCk7soAgxsDGNUsSa0hD4TF5uQY9Qs0NRAjX\nYLlD/UMVn2WMrG0NDsCFge99EfVq1b7Ijw6gWZCd5yrG+us5PcY8Zmlwz/E8\nZZ2ErwDwLIPcZwySR9MvyfSOv3nx9Yvqq6dW53Xns7kYLFhVpe91sZkripGH\nU3hKfiMAk2dn1Y62/PpABc7ttWrnSAakGFVUF/rZrqR3pfHespSlj+X9fuOq\n0Ufe\r\n=Okqp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDeJFmDjoCcdx2HiIR3tpFsoCUqrgUkyQUbebYEbgL9sgIhAMmIeYsN4Fukgl300T8cACJ7W1VsGBt//OQq/8qcMmQ7"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.24.0-canary.b5e665a9.0_1631729590869_0.2926207190176324"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.24.0-canary.ab1e177c.0":{"name":"@material/mwc-textfield","version":"0.24.0-canary.ab1e177c.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.818f4ee93.0","@material/line-ripple":"=13.0.0-canary.818f4ee93.0","@material/mwc-base":"0.24.0-canary.ab1e177c.0","@material/mwc-floating-label":"0.24.0-canary.ab1e177c.0","@material/mwc-line-ripple":"0.24.0-canary.ab1e177c.0","@material/mwc-notched-outline":"0.24.0-canary.ab1e177c.0","@material/textfield":"=13.0.0-canary.818f4ee93.0","lit-element":"3.0.0-rc.4","lit-html":"2.0.0-rc.5","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.24.0-canary.ab1e177c.0","@material/notched-outline":"=13.0.0-canary.818f4ee93.0","@material/ripple":"=13.0.0-canary.818f4ee93.0","@material/shape":"=13.0.0-canary.818f4ee93.0","@material/theme":"=13.0.0-canary.818f4ee93.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"afc26bf1f2c64cbe713e03a55993e7844eac59b4","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/afc26bf1f2c64cbe713e03a55993e7844eac59b4/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/afc26bf1f2c64cbe713e03a55993e7844eac59b4/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/afc26bf1f2c64cbe713e03a55993e7844eac59b4/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/afc26bf1f2c64cbe713e03a55993e7844eac59b4/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/afc26bf1f2c64cbe713e03a55993e7844eac59b4/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/afc26bf1f2c64cbe713e03a55993e7844eac59b4/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/afc26bf1f2c64cbe713e03a55993e7844eac59b4/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/afc26bf1f2c64cbe713e03a55993e7844eac59b4/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.24.0-canary.ab1e177c.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-K+nnesgpOVFzynta0BawrAqjDxFLEZQbiRHdXnnn0j6zwHAAINiAc4W9biAeRxNndzNql5kUR95IF6F9mU9LOQ==","shasum":"9c2cedd78ff430d40f4c094cd0c72896300e1fe1","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.24.0-canary.ab1e177c.0.tgz","fileCount":13,"unpackedSize":201610,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhQj8iCRA9TVsSAnZWagAAJBkP/2V+HCl8JgWd94tRMLlT\nUSv1xujEK4HXVjqwl6x7Q5K2nWK0+mzHMIsE1yG44mnIXXFVAZeyS9msK2YA\nbw15GHJN6tzkXManL12xzlwUrwJucCtNZbwqTbq3fv1dofX99hPRR318jczA\nQ2OcuesIwUQIemNPfHYEHcfRAnSDvnn3bjWoGzn8Xfs5Dd/cuwmEBixmuvY+\nagFffXQkyLxG1OpRb0V2ZorQJPFDudYuk5YSS/O30OogJMiqyRXhaBjZ/zPU\n1MqdinB2cqgMYH34avP76XqPfYqrkvYc/kLsRlQnwPAt2/wINQsouotGjQ9a\nueGtqc8BUSs3svHrZS8FU0YzDM3tnQAU/wSA2Z9xLfDQsldLBG9eoh+p1kNJ\nH1PL4YC8Mkl1MgI6BUQiRvMXgI7HNwthFCYrjpbPBRmcc9/SnsujVE5ZgeY/\nbGUO2y99AHbRUP+hrJHOEmGnJE8igIZV6WzzXLXvpA4V7zgGWG4OCqqUbufn\nUaPx2JzahAlpc+zD/HaL/yPNhIFJPj1H9GM2J4nhBvteCgJTiOUcjNY0+ZJF\nN4GeikBt+CTeRixdmZquEMCIWBwojRMA2zFpwFAGh51CkBEYNac9FhuykGtD\ncNiujNkcbotJvZWr/8iv4vdGin1FzBy3hZEO5mGZXmqQRV29zMZLybrXcuPS\nLtfq\r\n=WkbM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDHqGNPYOngNoKikonR0cmc40Cw2QIlDzKMnJuHJmn0pAiBqpnVpRCODyNNBjVHlrzvSkC8/SHBZUcZsXDOBO/bvCA=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.24.0-canary.ab1e177c.0_1631731490092_0.5192040542944634"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.24.0-canary.8dff8894.0":{"name":"@material/mwc-textfield","version":"0.24.0-canary.8dff8894.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.818f4ee93.0","@material/line-ripple":"=13.0.0-canary.818f4ee93.0","@material/mwc-base":"0.24.0-canary.8dff8894.0","@material/mwc-floating-label":"0.24.0-canary.8dff8894.0","@material/mwc-line-ripple":"0.24.0-canary.8dff8894.0","@material/mwc-notched-outline":"0.24.0-canary.8dff8894.0","@material/textfield":"=13.0.0-canary.818f4ee93.0","lit-element":"3.0.0-rc.4","lit-html":"2.0.0-rc.5","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.24.0-canary.8dff8894.0","@material/notched-outline":"=13.0.0-canary.818f4ee93.0","@material/ripple":"=13.0.0-canary.818f4ee93.0","@material/shape":"=13.0.0-canary.818f4ee93.0","@material/theme":"=13.0.0-canary.818f4ee93.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"bb2f0724a85956f5a92c61a18390b4616e0ce836","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bb2f0724a85956f5a92c61a18390b4616e0ce836/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bb2f0724a85956f5a92c61a18390b4616e0ce836/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bb2f0724a85956f5a92c61a18390b4616e0ce836/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bb2f0724a85956f5a92c61a18390b4616e0ce836/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bb2f0724a85956f5a92c61a18390b4616e0ce836/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bb2f0724a85956f5a92c61a18390b4616e0ce836/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bb2f0724a85956f5a92c61a18390b4616e0ce836/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/bb2f0724a85956f5a92c61a18390b4616e0ce836/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.24.0-canary.8dff8894.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-M0G+8xZhRpKzshkQ1FwlVMfKkflDb1xncHEODctjxQ7TpQlh6sPy9OPwrJ28FWD0hQ7Kg5vK+HDjlAgoiNgkNw==","shasum":"ae4d3863ac997d9fb1c0d7c497c9b4ce9cfbb9e2","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.24.0-canary.8dff8894.0.tgz","fileCount":13,"unpackedSize":201610,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhQkS0CRA9TVsSAnZWagAAqD4P+gOgX/E8PbXxXIQhICgh\nHuMEHUmmEKTJ00T8oqhG298CsgtzW6s0hyD2F3odZ1kEyPJ8AqbK73ZfITXX\nl4Zq0Gh5FadgtjhnV8Bk4jUdw4KmMVk974GVkNw7xddXfVXb2MaRh2QzrIps\nxvCHW/wbiaKo7cpBgiZtMn+5MIlDWv6htx3AKUpUHBeo6AA+/GgZbTMpWn4v\nt+I0QVhxzAEXY2IFixXUfDp9vxZVmQN4PS8OnbIFCVGmfjKR0vRPlgBv8M8P\n9hUOj3oWOZW1Ex6JEs21an5YTSsD0WmqYg1f/YtywgjnR9d8oGD8PKc4SGF5\nKuspBxsNjw+iyQWpm6qZXBr24qsR+oSXML6+upLgvT35Dgtoq6dHnpkE2aF7\nMC4Z103N4+IDf65nZVxA8zL+iqRfN/fUhQKGskWRsbqyXBrhlp+3KxuxrgbR\nvqRc8btBGEZ9ebVLofeDJi7/BMfeWFhG7cRZs/1P+tjY7Q6ts+BcGFONifTd\nA22eu9zPPJDUXl4Cx0e2KBRMkQpQFTrG+mEqnSarjHvZyDov95hku4GgAXJE\nvSfHhdBE1z16aZ3BWYkWm1U1t8+hTyuh67xRZoaAiQM0GvQhPWsnnZHAoTPS\nBv0k85d+tp6antPn8La5yOx54QwMjG+G+yM6h4OajlmzzHq0mRQudofwkNpw\nn3mH\r\n=5pXW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDdLwxWo4cwEf7ojFxPIjQdfFNSIrsNVDBSIQYJxyUzEwIhALcUrGqSAJe6Bb/7YXXwUiz3YVkOk5MrOpplgktb6h3x"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.24.0-canary.8dff8894.0_1631732916522_0.25391446307480425"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.24.0-canary.9cd7e927.0":{"name":"@material/mwc-textfield","version":"0.24.0-canary.9cd7e927.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.818f4ee93.0","@material/line-ripple":"=13.0.0-canary.818f4ee93.0","@material/mwc-base":"0.24.0-canary.9cd7e927.0","@material/mwc-floating-label":"0.24.0-canary.9cd7e927.0","@material/mwc-line-ripple":"0.24.0-canary.9cd7e927.0","@material/mwc-notched-outline":"0.24.0-canary.9cd7e927.0","@material/textfield":"=13.0.0-canary.818f4ee93.0","lit-element":"3.0.0-rc.4","lit-html":"2.0.0-rc.5","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.24.0-canary.9cd7e927.0","@material/notched-outline":"=13.0.0-canary.818f4ee93.0","@material/ripple":"=13.0.0-canary.818f4ee93.0","@material/shape":"=13.0.0-canary.818f4ee93.0","@material/theme":"=13.0.0-canary.818f4ee93.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"cdc8741747c55134790f2334cd48c000ef607804","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cdc8741747c55134790f2334cd48c000ef607804/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cdc8741747c55134790f2334cd48c000ef607804/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cdc8741747c55134790f2334cd48c000ef607804/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cdc8741747c55134790f2334cd48c000ef607804/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cdc8741747c55134790f2334cd48c000ef607804/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cdc8741747c55134790f2334cd48c000ef607804/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cdc8741747c55134790f2334cd48c000ef607804/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cdc8741747c55134790f2334cd48c000ef607804/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.24.0-canary.9cd7e927.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-GS2CB8ERW2tI0UZl+dWk7J9saCOmyFeqyyMaOovi4pd0Dbb2nv5lXaY0km4oFtY2yDNMDaUL5yVc5+E3S3t3Ew==","shasum":"45b2070aa827a986fd0a725cf3c77612e7e58a70","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.24.0-canary.9cd7e927.0.tgz","fileCount":13,"unpackedSize":201610,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhQlhNCRA9TVsSAnZWagAAt/sP/04P56CWBg3oTOQePP5B\n/wwaA6PC2xvUkjKVB7tEkEqM9J/KU4SqHuVGfLEFQDV7yR7cSppps/23sdLF\nJg3uE+Osh8WKvW8OTas5xHuDDzfwO6Vl9nrufEOFaBm5uf4PtC0149OMubqa\nLvZ4IcsN9+3Vps/9Q66+cYidTFlnOKm5Tk+JnlUWp7ZNudO1HRrO6P/GzFKf\nNJV02FHHTodaj1CxzEVHpdgjWJOgD3Z2RNJuQgHFBTx/P16ShEd3vKRibGUu\nEDWYaC987dy+P0I3RZ6MMh2boUyPSb23Oy3UtUj7QnFgdbcFBQ7i0lMI0uUw\nr3YqQl6VpUJoocCOKuBoxC+4GnDK2mTZLM28Zo/vMXDV0Yan9OLg7a+sFKBZ\nrCcnMxa+p94Jq6MHgNa+tLEvL/sKlQcMr9Qajcprl8JxhMy1aLHqoHGjPZ0N\nvrF2Kn2av9QVE4DUme3xoyriN6lnG2urTu7Tu0a0JJYurIpEEih0X49QvkOh\ngHVMyKWfcDOKq/TV5cQ0T49zkaJ3a79nJFNh6QoDTv7x1/yh5sM5YyV55ce3\nh275y0AZJDqhZWXqgnJYqUsgrQl1suOYctXWMLM5falDXIGv06/rBJQNNXyz\nmbFbgQv13WYrkcT2ZdBs1KjI4YY7SiSwOQ7y09CUxJDDjK/xIs144/Sm7/Py\nVbcx\r\n=H/R4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCk7e+jPWPI2XuFirikzRmHrGl90lEE8iaybGm/lcdZoQIgTP0IWk9V/Zv6vgp8xpxSscqPF5lMl03Y1AlkwPHc5W0="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.24.0-canary.9cd7e927.0_1631737933635_0.44246459831211005"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.24.0-canary.a7132082.0":{"name":"@material/mwc-textfield","version":"0.24.0-canary.a7132082.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.818f4ee93.0","@material/line-ripple":"=13.0.0-canary.818f4ee93.0","@material/mwc-base":"0.24.0-canary.a7132082.0","@material/mwc-floating-label":"0.24.0-canary.a7132082.0","@material/mwc-line-ripple":"0.24.0-canary.a7132082.0","@material/mwc-notched-outline":"0.24.0-canary.a7132082.0","@material/textfield":"=13.0.0-canary.818f4ee93.0","lit-element":"3.0.0-rc.4","lit-html":"2.0.0-rc.5","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.24.0-canary.a7132082.0","@material/notched-outline":"=13.0.0-canary.818f4ee93.0","@material/ripple":"=13.0.0-canary.818f4ee93.0","@material/shape":"=13.0.0-canary.818f4ee93.0","@material/theme":"=13.0.0-canary.818f4ee93.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"efa498c7c84be94afa4d7c50d5bc525723212e88","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/efa498c7c84be94afa4d7c50d5bc525723212e88/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/efa498c7c84be94afa4d7c50d5bc525723212e88/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/efa498c7c84be94afa4d7c50d5bc525723212e88/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/efa498c7c84be94afa4d7c50d5bc525723212e88/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/efa498c7c84be94afa4d7c50d5bc525723212e88/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/efa498c7c84be94afa4d7c50d5bc525723212e88/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/efa498c7c84be94afa4d7c50d5bc525723212e88/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/efa498c7c84be94afa4d7c50d5bc525723212e88/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.24.0-canary.a7132082.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-7+ZfzZvyZnQ01e4BP3xKI/I5T80xGC98OHDlpsWchAa8i7+sj4orYhLjlVBrVIxWZ8qYJ42HMFe958nmsunToQ==","shasum":"44c7ceaf5733ec6e183cc7154abbfbda99b681c5","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.24.0-canary.a7132082.0.tgz","fileCount":13,"unpackedSize":201610,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhQmmGCRA9TVsSAnZWagAAakQP/2C7FnGx7yZ9wNyzELOB\nQRUX/NZcUMDN6KjFOXqGWhk6l2m+OXOWbMt/T9zZfI965WROmcRP086FrjMQ\nm17pTU3u5PRVrxHf8aOtNutYR3419QXiurOVlMQOeIwUtCZSUzldx3PHlU5m\nO0NCXXLFPFZV9Hee8gL0Hqi3zK3i9L9Q9r4qQk5s6vsPzfLuRAcYHuHhZs34\noN7dJos1rLMiQ+0lJ9ihweZlzt+Zz1fArDzp0TB58zEJ122xgoUKb68iVvZ4\n+7Lkb54UPCfx51wCCEKtVSDFQQzgHA1Q080f6lZEw+G1sGvXdOIEvnjTrRoI\nYeEsm6MvLFVNJMfLHE4oAxiT4jLkkbU8kH5ODVbA3rCj9uWo1NJfvRRSuHAF\nJe2fcM+XO6fepattlS3U3t6BlPMrhD5p1TOk9WA+WeLABtr6WtzhLBiWWfXw\nrKwNQlJYHieqCfjOyMfcZ6/sstWNXTlPmaCaiU7VSrYxrp9CBZq6vo2vddfp\nl6l0j0q/dLCO2raEROwlM57XFbCfEP2J+cmUGgodz35Nhkbfq0bV0PcHxr1a\nwcG0HQeNkCPZcJ/fUyzLWlbEEgbAnkDYz0gO8HR8Im+hzFAocWwUgB98dKRf\npRnzD9eXnJilQT+4/S9fuxthlvd8oRbmB/zyrRjDVbzvimiPMbkPOze45r01\nXqVS\r\n=/pXl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFBDz+QIXqel6kaEKWNaqr1QCApyPpJvz2Oe9UdbL3JiAiASAWKyZ7nwFv19gDu+0k5syscI3qjgfkP1cze8MsRpig=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.24.0-canary.a7132082.0_1631742342481_0.2541434192097525"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.24.0-canary.cd9110cd.0":{"name":"@material/mwc-textfield","version":"0.24.0-canary.cd9110cd.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.d4e16a6c4.0","@material/line-ripple":"=13.0.0-canary.d4e16a6c4.0","@material/mwc-base":"0.24.0-canary.cd9110cd.0","@material/mwc-floating-label":"0.24.0-canary.cd9110cd.0","@material/mwc-line-ripple":"0.24.0-canary.cd9110cd.0","@material/mwc-notched-outline":"0.24.0-canary.cd9110cd.0","@material/textfield":"=13.0.0-canary.d4e16a6c4.0","lit-element":"3.0.0-rc.4","lit-html":"2.0.0-rc.5","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.24.0-canary.cd9110cd.0","@material/notched-outline":"=13.0.0-canary.d4e16a6c4.0","@material/ripple":"=13.0.0-canary.d4e16a6c4.0","@material/shape":"=13.0.0-canary.d4e16a6c4.0","@material/theme":"=13.0.0-canary.d4e16a6c4.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"fe7dab0d93d6598d6a6c08de182cb7e3245f26b4","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/fe7dab0d93d6598d6a6c08de182cb7e3245f26b4/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/fe7dab0d93d6598d6a6c08de182cb7e3245f26b4/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/fe7dab0d93d6598d6a6c08de182cb7e3245f26b4/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/fe7dab0d93d6598d6a6c08de182cb7e3245f26b4/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/fe7dab0d93d6598d6a6c08de182cb7e3245f26b4/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/fe7dab0d93d6598d6a6c08de182cb7e3245f26b4/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/fe7dab0d93d6598d6a6c08de182cb7e3245f26b4/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/fe7dab0d93d6598d6a6c08de182cb7e3245f26b4/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.24.0-canary.cd9110cd.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/3.22.1/node@v10.24.1+x64 (linux)","dist":{"integrity":"sha512-oCRJhvLMXIMVkSfgUBOJ2T3n9PaUDq3m+KZW31IsLvjefaglDYWDUSTI6L04BO0vdfecdyw2gwhlYFR+cZ2HzA==","shasum":"f89154d530c6abb175199c719007aa364f7e5ba0","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.24.0-canary.cd9110cd.0.tgz","fileCount":13,"unpackedSize":201610,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhQ4LACRA9TVsSAnZWagAA9/EP/jnYsDz4dgxOUR90LT9K\nHsnncpzm19w20sBnQ+pTshwDzEoUi0HnxpWnqocMfvxwsaEhf0WYYeUcwqtF\nPcnbKYR3ZpzzQsk+Vw4r4YqRawEUKIYn0y6sttrMh3lodzNWlKF6a6ET/Sf+\nVd/rNhLfW1NPN17EQiXBOAgJbcW/777F/KiJfHe3/4Yx9vinlEIjVMRdINcm\nOvD1Ga/Z5g7t1FRpyqsIItySTIY0k6OADEYQuD5bdADVAA5CJgD3axJmZgkS\nbulPeQ8D8oTJprCuEWWlD9RXwsIi2QM9KQJukfq0ZxGM/8W6ELjt1ZzwAxL7\n/e+jCI7HiugNgf0zo9haSClwGUr6pmPhIypvMGOe2MBM6kudFve0xiYJkWIt\n4gaqtZ3h7CX+r7lNqU4gT/WCDWw3Ew6EA9FBPH9e1Ni0M8MSNC48r/K7P6UU\nB3WWY6x49hhraKHE38I2iSNNO0QX/mux90antEjVM19zAXsDmBS6R+yNLxWD\n2vCQvlqVG/7NY/h5IBhbJ1vuJwkZAFXRLdBBAYA9CbrUAYzvQ836nP1PbL54\nTcb2riuQnGmYwNj3MeQY523PecYmeXjsAJ7uOQcy3LBKcn4BASUMQMYOLCeY\nTNlFOY5EXQGf45MXmlUmYQlyXOtNrIHZBvhO7IjnPKJkfA2DA9DC8W+oVgHV\nQQAO\r\n=08n5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDAu6mKEpWHNkT79/245xN15/a/Pcssue8inpDDM0Aa2QIhAP4pFMCER/5IsvMOHmpUCedbfbeibVihQKIGZkaAFDDA"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.24.0-canary.cd9110cd.0_1631814336663_0.5870122960102644"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.24.0-canary.1e5a9883.0":{"name":"@material/mwc-textfield","version":"0.24.0-canary.1e5a9883.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.d4e16a6c4.0","@material/line-ripple":"=13.0.0-canary.d4e16a6c4.0","@material/mwc-base":"0.24.0-canary.1e5a9883.0","@material/mwc-floating-label":"0.24.0-canary.1e5a9883.0","@material/mwc-line-ripple":"0.24.0-canary.1e5a9883.0","@material/mwc-notched-outline":"0.24.0-canary.1e5a9883.0","@material/textfield":"=13.0.0-canary.d4e16a6c4.0","lit-element":"3.0.0-rc.4","lit-html":"2.0.0-rc.5","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.24.0-canary.1e5a9883.0","@material/notched-outline":"=13.0.0-canary.d4e16a6c4.0","@material/ripple":"=13.0.0-canary.d4e16a6c4.0","@material/shape":"=13.0.0-canary.d4e16a6c4.0","@material/theme":"=13.0.0-canary.d4e16a6c4.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"5b1cd8120da2d6449203e71bb01079f709aa19bd","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5b1cd8120da2d6449203e71bb01079f709aa19bd/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5b1cd8120da2d6449203e71bb01079f709aa19bd/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5b1cd8120da2d6449203e71bb01079f709aa19bd/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5b1cd8120da2d6449203e71bb01079f709aa19bd/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5b1cd8120da2d6449203e71bb01079f709aa19bd/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5b1cd8120da2d6449203e71bb01079f709aa19bd/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5b1cd8120da2d6449203e71bb01079f709aa19bd/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5b1cd8120da2d6449203e71bb01079f709aa19bd/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.24.0-canary.1e5a9883.0","_nodeVersion":"14.17.6","_npmVersion":"lerna/3.22.1/node@v14.17.6+x64 (linux)","dist":{"integrity":"sha512-DBbsokLIgvRkhp4e30vZAgieVQWk6uGJYAdTFXkP/qeVMBub5ddjGdS/uxBOPXXolZj2XQj47NbepLOLmQGqcA==","shasum":"135fe69fa3457b4a7421ed21300a84e36375a775","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.24.0-canary.1e5a9883.0.tgz","fileCount":13,"unpackedSize":201610,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHK4FQdwWTbFkhIEOZkj8SiiG8x5Y9gv6/V37Hi03g6uAiEAuU7fRwpWVB+6mPp9uLHzaNG79i5FlgO6s8fSklltkxA="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.24.0-canary.1e5a9883.0_1631911146725_0.3294622416326052"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.24.0-canary.32c830ee.0":{"name":"@material/mwc-textfield","version":"0.24.0-canary.32c830ee.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.65125b3a6.0","@material/line-ripple":"=13.0.0-canary.65125b3a6.0","@material/mwc-base":"0.24.0-canary.32c830ee.0","@material/mwc-floating-label":"0.24.0-canary.32c830ee.0","@material/mwc-line-ripple":"0.24.0-canary.32c830ee.0","@material/mwc-notched-outline":"0.24.0-canary.32c830ee.0","@material/textfield":"=13.0.0-canary.65125b3a6.0","lit-element":"3.0.0-rc.4","lit-html":"2.0.0-rc.5","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.24.0-canary.32c830ee.0","@material/notched-outline":"=13.0.0-canary.65125b3a6.0","@material/ripple":"=13.0.0-canary.65125b3a6.0","@material/shape":"=13.0.0-canary.65125b3a6.0","@material/theme":"=13.0.0-canary.65125b3a6.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"72f380d7ef6cb00e8a03c42048cbf0cc09820ae9","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/72f380d7ef6cb00e8a03c42048cbf0cc09820ae9/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/72f380d7ef6cb00e8a03c42048cbf0cc09820ae9/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/72f380d7ef6cb00e8a03c42048cbf0cc09820ae9/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/72f380d7ef6cb00e8a03c42048cbf0cc09820ae9/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/72f380d7ef6cb00e8a03c42048cbf0cc09820ae9/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/72f380d7ef6cb00e8a03c42048cbf0cc09820ae9/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/72f380d7ef6cb00e8a03c42048cbf0cc09820ae9/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/72f380d7ef6cb00e8a03c42048cbf0cc09820ae9/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.24.0-canary.32c830ee.0","_nodeVersion":"14.17.6","_npmVersion":"lerna/3.22.1/node@v14.17.6+x64 (linux)","dist":{"integrity":"sha512-Twms4Oy/y4fiQUUEcaWgvSrTqifOjLn3eax0qAS8JoYiSuoelIqJ6jgmk3LbNu71zsiGNaJdhMNwVH6hD4eObw==","shasum":"beb6b234b7e29e67d562bd640ff3378d5587e197","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.24.0-canary.32c830ee.0.tgz","fileCount":13,"unpackedSize":201610,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAZfKgSg3hDdCYGo1rkD//ylFst29E2H2qdV8lza9HeAAiB9c1x5U8IiTNtWTUUeNxuU2vfVq3EMYYb47J42zgAY3g=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.24.0-canary.32c830ee.0_1631920125695_0.645389678026117"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.24.0-canary.1de87bb7.0":{"name":"@material/mwc-textfield","version":"0.24.0-canary.1de87bb7.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.65125b3a6.0","@material/line-ripple":"=13.0.0-canary.65125b3a6.0","@material/mwc-base":"0.24.0-canary.1de87bb7.0","@material/mwc-floating-label":"0.24.0-canary.1de87bb7.0","@material/mwc-line-ripple":"0.24.0-canary.1de87bb7.0","@material/mwc-notched-outline":"0.24.0-canary.1de87bb7.0","@material/textfield":"=13.0.0-canary.65125b3a6.0","lit-element":"3.0.0-rc.4","lit-html":"2.0.0-rc.5","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.24.0-canary.1de87bb7.0","@material/notched-outline":"=13.0.0-canary.65125b3a6.0","@material/ripple":"=13.0.0-canary.65125b3a6.0","@material/shape":"=13.0.0-canary.65125b3a6.0","@material/theme":"=13.0.0-canary.65125b3a6.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"a3215ff82b8bd0ba323b98cc29ed77fca57b8643","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a3215ff82b8bd0ba323b98cc29ed77fca57b8643/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a3215ff82b8bd0ba323b98cc29ed77fca57b8643/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a3215ff82b8bd0ba323b98cc29ed77fca57b8643/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a3215ff82b8bd0ba323b98cc29ed77fca57b8643/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a3215ff82b8bd0ba323b98cc29ed77fca57b8643/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a3215ff82b8bd0ba323b98cc29ed77fca57b8643/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a3215ff82b8bd0ba323b98cc29ed77fca57b8643/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a3215ff82b8bd0ba323b98cc29ed77fca57b8643/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.24.0-canary.1de87bb7.0","_nodeVersion":"14.17.6","_npmVersion":"lerna/3.22.1/node@v14.17.6+x64 (linux)","dist":{"integrity":"sha512-ADsRqCIBLVo5DetZUzg7dMYOlJ96zsjk00Bbn6/LyXSGNzKFTo/rGZYLU+91axDE1kGDHk0yE6vxqadbgv7KHQ==","shasum":"95ec093f722050ee676fcf94a67489c77134bb67","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.24.0-canary.1de87bb7.0.tgz","fileCount":13,"unpackedSize":201610,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAoTLiPjUq53733qi/ArWd35TpRVMmK3X05C0Go9CYisAiEAyW+8sYXpq70CfNMh/82lSleZ0VS1DSAfce72J64yiHo="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.24.0-canary.1de87bb7.0_1631991128637_0.45497893694274505"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.24.0-canary.f2ea80c4.0":{"name":"@material/mwc-textfield","version":"0.24.0-canary.f2ea80c4.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.65125b3a6.0","@material/line-ripple":"=13.0.0-canary.65125b3a6.0","@material/mwc-base":"0.24.0-canary.f2ea80c4.0","@material/mwc-floating-label":"0.24.0-canary.f2ea80c4.0","@material/mwc-line-ripple":"0.24.0-canary.f2ea80c4.0","@material/mwc-notched-outline":"0.24.0-canary.f2ea80c4.0","@material/textfield":"=13.0.0-canary.65125b3a6.0","lit-element":"3.0.0-rc.4","lit-html":"2.0.0-rc.5","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.24.0-canary.f2ea80c4.0","@material/notched-outline":"=13.0.0-canary.65125b3a6.0","@material/ripple":"=13.0.0-canary.65125b3a6.0","@material/shape":"=13.0.0-canary.65125b3a6.0","@material/theme":"=13.0.0-canary.65125b3a6.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"be75dd39a03705b3cc24c5614f2c7f2be7c3c93e","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/be75dd39a03705b3cc24c5614f2c7f2be7c3c93e/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/be75dd39a03705b3cc24c5614f2c7f2be7c3c93e/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/be75dd39a03705b3cc24c5614f2c7f2be7c3c93e/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/be75dd39a03705b3cc24c5614f2c7f2be7c3c93e/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/be75dd39a03705b3cc24c5614f2c7f2be7c3c93e/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/be75dd39a03705b3cc24c5614f2c7f2be7c3c93e/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/be75dd39a03705b3cc24c5614f2c7f2be7c3c93e/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/be75dd39a03705b3cc24c5614f2c7f2be7c3c93e/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.24.0-canary.f2ea80c4.0","_nodeVersion":"14.17.6","_npmVersion":"lerna/3.22.1/node@v14.17.6+x64 (linux)","dist":{"integrity":"sha512-g9M1Ttkk+S97DCVwb5HF62idGtppz73T0IDUU6+Fz9SGFl7ltZDhZXmEtbLZGb1PVyhjOJE9TL2d5W8FfYk3oQ==","shasum":"c962bd00dedffe4530374ca4df3052b2af5aca73","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.24.0-canary.f2ea80c4.0.tgz","fileCount":13,"unpackedSize":201610,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC6EuRZTYi+EgJLAueuJtBykk5E85rEQ67ruUP1Rez08AIgfIeHedOYEG313tM3aQPlAtSz1bfhSTEPuQHdng1xsgI="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.24.0-canary.f2ea80c4.0_1632160493782_0.5916832665465355"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.24.0-canary.569d739f.0":{"name":"@material/mwc-textfield","version":"0.24.0-canary.569d739f.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.65125b3a6.0","@material/line-ripple":"=13.0.0-canary.65125b3a6.0","@material/mwc-base":"0.24.0-canary.569d739f.0","@material/mwc-floating-label":"0.24.0-canary.569d739f.0","@material/mwc-line-ripple":"0.24.0-canary.569d739f.0","@material/mwc-notched-outline":"0.24.0-canary.569d739f.0","@material/textfield":"=13.0.0-canary.65125b3a6.0","lit-element":"3.0.0-rc.4","lit-html":"2.0.0-rc.5","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.24.0-canary.569d739f.0","@material/notched-outline":"=13.0.0-canary.65125b3a6.0","@material/ripple":"=13.0.0-canary.65125b3a6.0","@material/shape":"=13.0.0-canary.65125b3a6.0","@material/theme":"=13.0.0-canary.65125b3a6.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"c2e841aead340c043b080dc4718873a82f109450","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c2e841aead340c043b080dc4718873a82f109450/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c2e841aead340c043b080dc4718873a82f109450/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c2e841aead340c043b080dc4718873a82f109450/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c2e841aead340c043b080dc4718873a82f109450/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c2e841aead340c043b080dc4718873a82f109450/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c2e841aead340c043b080dc4718873a82f109450/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c2e841aead340c043b080dc4718873a82f109450/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c2e841aead340c043b080dc4718873a82f109450/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.24.0-canary.569d739f.0","_nodeVersion":"14.17.6","_npmVersion":"lerna/3.22.1/node@v14.17.6+x64 (linux)","dist":{"integrity":"sha512-JI283zosSYO8VOqvnZ4W7cEcIK079UUnaO7IeZO10ZDE+oTmIdi08QPe/UumEcjbkjspxLGFKsKjUSpJ8wn1mA==","shasum":"fe2ff811c109205080dad0723c555694fbaba191","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.24.0-canary.569d739f.0.tgz","fileCount":13,"unpackedSize":201610,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQClT7cCkueo+W9I/fO0OqSKdw9sy698VUwXuCCkxnwUOAIgEkWzRNec9L90I9k0ep+eAzOy2CsljjU2EbEd0IstZWw="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.24.0-canary.569d739f.0_1632173028192_0.9599577558081311"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.24.0-canary.5a434a50.0":{"name":"@material/mwc-textfield","version":"0.24.0-canary.5a434a50.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.65125b3a6.0","@material/line-ripple":"=13.0.0-canary.65125b3a6.0","@material/mwc-base":"0.24.0-canary.5a434a50.0","@material/mwc-floating-label":"0.24.0-canary.5a434a50.0","@material/mwc-line-ripple":"0.24.0-canary.5a434a50.0","@material/mwc-notched-outline":"0.24.0-canary.5a434a50.0","@material/textfield":"=13.0.0-canary.65125b3a6.0","lit-element":"^3.0.0","lit-html":"^2.0.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.24.0-canary.5a434a50.0","@material/notched-outline":"=13.0.0-canary.65125b3a6.0","@material/ripple":"=13.0.0-canary.65125b3a6.0","@material/shape":"=13.0.0-canary.65125b3a6.0","@material/theme":"=13.0.0-canary.65125b3a6.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"7f2821932d60f65ba8b79446374be9a66f009858","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7f2821932d60f65ba8b79446374be9a66f009858/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7f2821932d60f65ba8b79446374be9a66f009858/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7f2821932d60f65ba8b79446374be9a66f009858/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7f2821932d60f65ba8b79446374be9a66f009858/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7f2821932d60f65ba8b79446374be9a66f009858/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7f2821932d60f65ba8b79446374be9a66f009858/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7f2821932d60f65ba8b79446374be9a66f009858/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7f2821932d60f65ba8b79446374be9a66f009858/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.24.0-canary.5a434a50.0","_nodeVersion":"14.17.6","_npmVersion":"lerna/3.22.1/node@v14.17.6+x64 (linux)","dist":{"integrity":"sha512-069K4h0qEpMaVRdCD7Oc/3cVQxQQDfJN7k9bMkJN7XCiE+0qVBbWpcNMHsti4ksQu8UL2BPw9nrnyUhHOK/bgA==","shasum":"a8227837f2b927ae23416f9fe5be95d8a1bfbb17","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.24.0-canary.5a434a50.0.tgz","fileCount":13,"unpackedSize":201602,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEhC6KMvXQCO1lzPEC0Wj/8VOaiVccdtQ05K2jzmfVwaAiAjKvB/VSKMjeUkVSP9ETn6jY44HlqdQvvAngczI4T9qw=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.24.0-canary.5a434a50.0_1632189643584_0.1619082833178136"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.25.0":{"name":"@material/mwc-textfield","version":"0.25.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.65125b3a6.0","@material/line-ripple":"=13.0.0-canary.65125b3a6.0","@material/mwc-base":"^0.25.0","@material/mwc-floating-label":"^0.25.0","@material/mwc-line-ripple":"^0.25.0","@material/mwc-notched-outline":"^0.25.0","@material/textfield":"=13.0.0-canary.65125b3a6.0","lit-element":"^3.0.0","lit-html":"^2.0.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"^0.25.0","@material/notched-outline":"=13.0.0-canary.65125b3a6.0","@material/ripple":"=13.0.0-canary.65125b3a6.0","@material/shape":"=13.0.0-canary.65125b3a6.0","@material/theme":"=13.0.0-canary.65125b3a6.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"6be1a13e29a0f18491948418d7076fdc1c7031a6","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.25.0","_nodeVersion":"16.9.1","_npmVersion":"lerna/3.22.1/node@v16.9.1+x64 (darwin)","dist":{"integrity":"sha512-tY0p0pSnOLh8OQDICKr5g50uAWbg42MQtfx9t4I9rVJFtEu4fMoGsZQvYNsS01IbbNFQTt33kGi1JiO6TcOqZg==","shasum":"e5dbf463f825c381b46803342765db4ce8f59652","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.25.0.tgz","fileCount":16,"unpackedSize":297501,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAKgXJSxKdHDR7vU14BEEBFBtScOoPaNVqg9rNnR1mlDAiBuTnqxkj8IjCLs6QCSFA2fTIGExxBMRCREj+yTgqDm/Q=="}]},"_npmUser":{"name":"emarquez","email":"emarquez@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.25.0_1632192783829_0.7045859399443566"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.26.0-canary.b1c1ab52.0":{"name":"@material/mwc-textfield","version":"0.26.0-canary.b1c1ab52.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.65125b3a6.0","@material/line-ripple":"=13.0.0-canary.65125b3a6.0","@material/mwc-base":"0.26.0-canary.b1c1ab52.0","@material/mwc-floating-label":"0.26.0-canary.b1c1ab52.0","@material/mwc-line-ripple":"0.26.0-canary.b1c1ab52.0","@material/mwc-notched-outline":"0.26.0-canary.b1c1ab52.0","@material/textfield":"=13.0.0-canary.65125b3a6.0","lit-element":"^3.0.0","lit-html":"^2.0.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.26.0-canary.b1c1ab52.0","@material/notched-outline":"=13.0.0-canary.65125b3a6.0","@material/ripple":"=13.0.0-canary.65125b3a6.0","@material/shape":"=13.0.0-canary.65125b3a6.0","@material/theme":"=13.0.0-canary.65125b3a6.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"320a093b73bd45cc5fa68abda305913c26c72310","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/320a093b73bd45cc5fa68abda305913c26c72310/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/320a093b73bd45cc5fa68abda305913c26c72310/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/320a093b73bd45cc5fa68abda305913c26c72310/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/320a093b73bd45cc5fa68abda305913c26c72310/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/320a093b73bd45cc5fa68abda305913c26c72310/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/320a093b73bd45cc5fa68abda305913c26c72310/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/320a093b73bd45cc5fa68abda305913c26c72310/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/320a093b73bd45cc5fa68abda305913c26c72310/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.26.0-canary.b1c1ab52.0","_nodeVersion":"14.17.6","_npmVersion":"lerna/3.22.1/node@v14.17.6+x64 (linux)","dist":{"integrity":"sha512-Z6CQPJsMZI7ZO2FpiIe8yYQp0yx2Mu9opEBxssdkLoK/JbijYCgcOpeQ/wbMGljr83w7WLg/und9cEci01MePA==","shasum":"f734d4f29b552e97d607be4de29da33ec8f37e04","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.26.0-canary.b1c1ab52.0.tgz","fileCount":13,"unpackedSize":201602,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDPGqgHro1OUJ7IHV3ptl2XuNIWY/XRD0q8WW60l28VLAiEAiKOHN9lxkV9bd2r+qqjnNi1EfZRxfFg1QSDHSDLyKtM="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.26.0-canary.b1c1ab52.0_1632193930116_0.9961561326506503"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.25.1":{"name":"@material/mwc-textfield","version":"0.25.1","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.65125b3a6.0","@material/line-ripple":"=13.0.0-canary.65125b3a6.0","@material/mwc-base":"^0.25.1","@material/mwc-floating-label":"^0.25.1","@material/mwc-line-ripple":"^0.25.1","@material/mwc-notched-outline":"^0.25.1","@material/textfield":"=13.0.0-canary.65125b3a6.0","lit-element":"^3.0.0","lit-html":"^2.0.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"^0.25.1","@material/notched-outline":"=13.0.0-canary.65125b3a6.0","@material/ripple":"=13.0.0-canary.65125b3a6.0","@material/shape":"=13.0.0-canary.65125b3a6.0","@material/theme":"=13.0.0-canary.65125b3a6.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"b1c1ab5230f56f6bce405387b9c75cc7111cacc2","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.25.1","_nodeVersion":"16.9.1","_npmVersion":"lerna/3.22.1/node@v16.9.1+x64 (darwin)","dist":{"integrity":"sha512-Xeze6MHWaAQB/xjwJ1y/guZh6JaaeLYTCMvhyk7m+oVTOQebwa490Oktzyw265p8iOthH8Fby7+UjX2MZ3gpvQ==","shasum":"1c68544ebc684c299c6ed4a08a57578b9e3d5b28","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.25.1.tgz","fileCount":16,"unpackedSize":297501,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD/3BT9oXCsi4RfGomj3kX6f1nCND4/ESHAA8g2pz7gIAIhAMlaYQT1YOLVa0V9Uap5HVtPm5V5LqM5vn/4Vg2bL/ji"}]},"_npmUser":{"name":"emarquez","email":"emarquez@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.25.1_1632193962499_0.633329969520736"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.26.0-canary.ae060177.0":{"name":"@material/mwc-textfield","version":"0.26.0-canary.ae060177.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.65125b3a6.0","@material/line-ripple":"=13.0.0-canary.65125b3a6.0","@material/mwc-base":"0.26.0-canary.ae060177.0","@material/mwc-floating-label":"0.26.0-canary.ae060177.0","@material/mwc-line-ripple":"0.26.0-canary.ae060177.0","@material/mwc-notched-outline":"0.26.0-canary.ae060177.0","@material/textfield":"=13.0.0-canary.65125b3a6.0","lit-element":"^3.0.0","lit-html":"^2.0.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.26.0-canary.ae060177.0","@material/notched-outline":"=13.0.0-canary.65125b3a6.0","@material/ripple":"=13.0.0-canary.65125b3a6.0","@material/shape":"=13.0.0-canary.65125b3a6.0","@material/theme":"=13.0.0-canary.65125b3a6.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"b919ae5340a9ffc926d328999cc5fe5704922e40","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b919ae5340a9ffc926d328999cc5fe5704922e40/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b919ae5340a9ffc926d328999cc5fe5704922e40/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b919ae5340a9ffc926d328999cc5fe5704922e40/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b919ae5340a9ffc926d328999cc5fe5704922e40/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b919ae5340a9ffc926d328999cc5fe5704922e40/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b919ae5340a9ffc926d328999cc5fe5704922e40/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b919ae5340a9ffc926d328999cc5fe5704922e40/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b919ae5340a9ffc926d328999cc5fe5704922e40/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.26.0-canary.ae060177.0","_nodeVersion":"14.17.6","_npmVersion":"lerna/3.22.1/node@v14.17.6+x64 (linux)","dist":{"integrity":"sha512-jft9smdjTZnq9WP1gaLuwtTJnQ0OSWS75HQrEZbqvRX4pOwXlA+/VAd4MuPXsu05+Ykfu83UiJlaQ9JIPHUltw==","shasum":"ebc0656c25b2154e6fd56e5fae854b14088b0219","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.26.0-canary.ae060177.0.tgz","fileCount":13,"unpackedSize":201602,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCVNC0lU5IqnEQC1fEwYYses9mjvautBRD1PiS95W1Q/QIhANqnIEk9Gp/RacsAJFafwS6V23HcszY96Xxan40BY6yw"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.26.0-canary.ae060177.0_1632235086708_0.0123470653013944"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.26.0-canary.b6fe2a12.0":{"name":"@material/mwc-textfield","version":"0.26.0-canary.b6fe2a12.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.65125b3a6.0","@material/line-ripple":"=13.0.0-canary.65125b3a6.0","@material/mwc-base":"0.26.0-canary.b6fe2a12.0","@material/mwc-floating-label":"0.26.0-canary.b6fe2a12.0","@material/mwc-line-ripple":"0.26.0-canary.b6fe2a12.0","@material/mwc-notched-outline":"0.26.0-canary.b6fe2a12.0","@material/textfield":"=13.0.0-canary.65125b3a6.0","lit-element":"^3.0.0","lit-html":"^2.0.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.26.0-canary.b6fe2a12.0","@material/notched-outline":"=13.0.0-canary.65125b3a6.0","@material/ripple":"=13.0.0-canary.65125b3a6.0","@material/shape":"=13.0.0-canary.65125b3a6.0","@material/theme":"=13.0.0-canary.65125b3a6.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"06feede8e75d655952f3a43b5c971276c26fe92e","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/06feede8e75d655952f3a43b5c971276c26fe92e/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/06feede8e75d655952f3a43b5c971276c26fe92e/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/06feede8e75d655952f3a43b5c971276c26fe92e/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/06feede8e75d655952f3a43b5c971276c26fe92e/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/06feede8e75d655952f3a43b5c971276c26fe92e/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/06feede8e75d655952f3a43b5c971276c26fe92e/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/06feede8e75d655952f3a43b5c971276c26fe92e/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/06feede8e75d655952f3a43b5c971276c26fe92e/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.26.0-canary.b6fe2a12.0","_nodeVersion":"14.17.6","_npmVersion":"lerna/3.22.1/node@v14.17.6+x64 (linux)","dist":{"integrity":"sha512-flZb4kR4uUnUnsuv8ZDtXjpkwf2W1bHXOyzrdIz6pDnbTzdDGAJIn7o1bC/fJ5lbBcNCqfknCr84YDBtQe14fQ==","shasum":"a0b216bf4ffd77ad8429be6d2a951494b7245be5","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.26.0-canary.b6fe2a12.0.tgz","fileCount":13,"unpackedSize":201602,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDITpW9Rsz2DMGbM1Cu0+pdLBXItnn5wn11PxdNrOeCrAiBUI9gBOwtPXYOeqSKLajBSj8Il63bYfGStQC18F4/MZQ=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.26.0-canary.b6fe2a12.0_1632341775792_0.41611019155884565"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.26.0-canary.07e91417.0":{"name":"@material/mwc-textfield","version":"0.26.0-canary.07e91417.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.65125b3a6.0","@material/line-ripple":"=13.0.0-canary.65125b3a6.0","@material/mwc-base":"0.26.0-canary.07e91417.0","@material/mwc-floating-label":"0.26.0-canary.07e91417.0","@material/mwc-line-ripple":"0.26.0-canary.07e91417.0","@material/mwc-notched-outline":"0.26.0-canary.07e91417.0","@material/textfield":"=13.0.0-canary.65125b3a6.0","lit-element":"^3.0.0","lit-html":"^2.0.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.26.0-canary.07e91417.0","@material/notched-outline":"=13.0.0-canary.65125b3a6.0","@material/ripple":"=13.0.0-canary.65125b3a6.0","@material/shape":"=13.0.0-canary.65125b3a6.0","@material/theme":"=13.0.0-canary.65125b3a6.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"9fcacc1890992ebd650dca508478ea3a276a1ebe","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9fcacc1890992ebd650dca508478ea3a276a1ebe/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9fcacc1890992ebd650dca508478ea3a276a1ebe/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9fcacc1890992ebd650dca508478ea3a276a1ebe/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9fcacc1890992ebd650dca508478ea3a276a1ebe/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9fcacc1890992ebd650dca508478ea3a276a1ebe/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9fcacc1890992ebd650dca508478ea3a276a1ebe/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9fcacc1890992ebd650dca508478ea3a276a1ebe/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9fcacc1890992ebd650dca508478ea3a276a1ebe/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.26.0-canary.07e91417.0","_nodeVersion":"14.17.6","_npmVersion":"lerna/3.22.1/node@v14.17.6+x64 (linux)","dist":{"integrity":"sha512-iQlilQyoveShI4M7GBljniHlSA42eNgDJEpZEB+6IKP8dm0x1TfFr69LR6hQoQe/LHp4zpdjoBIPWuCo0vhPGQ==","shasum":"95ad70e2f5c6843fc5c2712f7b4bea0688242572","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.26.0-canary.07e91417.0.tgz","fileCount":13,"unpackedSize":201602,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD205o0kHSSYJSqMrAEg6ZXw6LAoSCj8HFk8Gao+UmalwIhAOQoIcP4FmOWLFFWjFTuttLQHrgc5QAn+l1tYT8pWTCd"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.26.0-canary.07e91417.0_1632344746050_0.7838465117525646"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.26.0-canary.e2203ffa.0":{"name":"@material/mwc-textfield","version":"0.26.0-canary.e2203ffa.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.65125b3a6.0","@material/line-ripple":"=13.0.0-canary.65125b3a6.0","@material/mwc-base":"0.26.0-canary.e2203ffa.0","@material/mwc-floating-label":"0.26.0-canary.e2203ffa.0","@material/mwc-line-ripple":"0.26.0-canary.e2203ffa.0","@material/mwc-notched-outline":"0.26.0-canary.e2203ffa.0","@material/textfield":"=13.0.0-canary.65125b3a6.0","lit-element":"^3.0.0","lit-html":"^2.0.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.26.0-canary.e2203ffa.0","@material/notched-outline":"=13.0.0-canary.65125b3a6.0","@material/ripple":"=13.0.0-canary.65125b3a6.0","@material/shape":"=13.0.0-canary.65125b3a6.0","@material/theme":"=13.0.0-canary.65125b3a6.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"dccbe3e93b2694b3336adcf33188115ced04a52e","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/dccbe3e93b2694b3336adcf33188115ced04a52e/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/dccbe3e93b2694b3336adcf33188115ced04a52e/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/dccbe3e93b2694b3336adcf33188115ced04a52e/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/dccbe3e93b2694b3336adcf33188115ced04a52e/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/dccbe3e93b2694b3336adcf33188115ced04a52e/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/dccbe3e93b2694b3336adcf33188115ced04a52e/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/dccbe3e93b2694b3336adcf33188115ced04a52e/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/dccbe3e93b2694b3336adcf33188115ced04a52e/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.26.0-canary.e2203ffa.0","_nodeVersion":"14.17.6","_npmVersion":"lerna/3.22.1/node@v14.17.6+x64 (linux)","dist":{"integrity":"sha512-5qcc5+gYWeDe2/L90BG6kd3ZjENWDUzXNMRs8X0ek0Dm41yGddSW7Sf6l42u5pTTvioDHl8lGCc5iXOoxdeSlg==","shasum":"5094e63627feaaeed0ec839eca22bb3936da716f","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.26.0-canary.e2203ffa.0.tgz","fileCount":13,"unpackedSize":201602,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBalo3nGnq7KLH5I+ot5FsRez4eNRsw5AK9dX4TEWINFAiEAkzGCARMsdfdmokPYiJWf0KbGqm4ZQbs11mhFIV55PG4="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.26.0-canary.e2203ffa.0_1632421655843_0.2850990227296204"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.26.0-canary.4abe237e.0":{"name":"@material/mwc-textfield","version":"0.26.0-canary.4abe237e.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.c79aa0cdd.0","@material/line-ripple":"=13.0.0-canary.c79aa0cdd.0","@material/mwc-base":"0.26.0-canary.4abe237e.0","@material/mwc-floating-label":"0.26.0-canary.4abe237e.0","@material/mwc-line-ripple":"0.26.0-canary.4abe237e.0","@material/mwc-notched-outline":"0.26.0-canary.4abe237e.0","@material/textfield":"=13.0.0-canary.c79aa0cdd.0","lit-element":"^3.0.0","lit-html":"^2.0.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.26.0-canary.4abe237e.0","@material/notched-outline":"=13.0.0-canary.c79aa0cdd.0","@material/ripple":"=13.0.0-canary.c79aa0cdd.0","@material/shape":"=13.0.0-canary.c79aa0cdd.0","@material/theme":"=13.0.0-canary.c79aa0cdd.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"c0c828f0240aea9472d319d4a1bb77871c960873","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c0c828f0240aea9472d319d4a1bb77871c960873/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c0c828f0240aea9472d319d4a1bb77871c960873/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c0c828f0240aea9472d319d4a1bb77871c960873/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c0c828f0240aea9472d319d4a1bb77871c960873/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c0c828f0240aea9472d319d4a1bb77871c960873/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c0c828f0240aea9472d319d4a1bb77871c960873/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c0c828f0240aea9472d319d4a1bb77871c960873/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c0c828f0240aea9472d319d4a1bb77871c960873/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.26.0-canary.4abe237e.0","_nodeVersion":"14.17.6","_npmVersion":"lerna/3.22.1/node@v14.17.6+x64 (linux)","dist":{"integrity":"sha512-KTi7OvWuRFQ8GzhVJXHEzPlX5JDa3p3Bz/WBCIZjeC8xp8YJ3mcehkusbdpyczuE7fdZ+Tvxf9fOBCf5w+Grxw==","shasum":"032a6297490e8c844174139a2353a627e5654a36","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.26.0-canary.4abe237e.0.tgz","fileCount":13,"unpackedSize":201602,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCDtBfyJ28zAtXckEMlrIwAYcOtRNucyfuQ6QN4rhik/gIgfoj51mRAADqg0PPY2GdwnZ67Q2Tfk8FzfKjy0qkDsKo="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.26.0-canary.4abe237e.0_1632504667280_0.8389265435416382"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.26.0-canary.6278ee5d.0":{"name":"@material/mwc-textfield","version":"0.26.0-canary.6278ee5d.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.c79aa0cdd.0","@material/line-ripple":"=13.0.0-canary.c79aa0cdd.0","@material/mwc-base":"0.26.0-canary.6278ee5d.0","@material/mwc-floating-label":"0.26.0-canary.6278ee5d.0","@material/mwc-line-ripple":"0.26.0-canary.6278ee5d.0","@material/mwc-notched-outline":"0.26.0-canary.6278ee5d.0","@material/textfield":"=13.0.0-canary.c79aa0cdd.0","lit":"^2.0.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.26.0-canary.6278ee5d.0","@material/notched-outline":"=13.0.0-canary.c79aa0cdd.0","@material/ripple":"=13.0.0-canary.c79aa0cdd.0","@material/shape":"=13.0.0-canary.c79aa0cdd.0","@material/theme":"=13.0.0-canary.c79aa0cdd.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"85137ac5f9a59dd64512524f380c65b268a2344f","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/85137ac5f9a59dd64512524f380c65b268a2344f/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/85137ac5f9a59dd64512524f380c65b268a2344f/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/85137ac5f9a59dd64512524f380c65b268a2344f/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/85137ac5f9a59dd64512524f380c65b268a2344f/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/85137ac5f9a59dd64512524f380c65b268a2344f/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/85137ac5f9a59dd64512524f380c65b268a2344f/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/85137ac5f9a59dd64512524f380c65b268a2344f/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/85137ac5f9a59dd64512524f380c65b268a2344f/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.26.0-canary.6278ee5d.0","_nodeVersion":"14.17.6","_npmVersion":"lerna/3.22.1/node@v14.17.6+x64 (linux)","dist":{"integrity":"sha512-Lj9/umXI40MswGphYkFnPZOTztYgntsAj4sRO4gM5+rwhEHjRz+JrWFAPnuwp93zw2dr4/lYUv3ory8Ckv8l1w==","shasum":"8abb691823caf0c6179e2e938f6bfadbb797be12","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.26.0-canary.6278ee5d.0.tgz","fileCount":13,"unpackedSize":201625,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID06KZ0uIcCWKEp8gSil8LZeelR4M9S7JTiB9pVYL/+8AiEAr/LN/nSdPLLNAb+w4GrF0QsEkxE9eSOHVy7d00u8lVI="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.26.0-canary.6278ee5d.0_1632767481274_0.4895474537671167"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.26.0-canary.3a5d5f34.0":{"name":"@material/mwc-textfield","version":"0.26.0-canary.3a5d5f34.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=13.0.0-canary.c79aa0cdd.0","@material/line-ripple":"=13.0.0-canary.c79aa0cdd.0","@material/mwc-base":"0.26.0-canary.3a5d5f34.0","@material/mwc-floating-label":"0.26.0-canary.3a5d5f34.0","@material/mwc-line-ripple":"0.26.0-canary.3a5d5f34.0","@material/mwc-notched-outline":"0.26.0-canary.3a5d5f34.0","@material/textfield":"=13.0.0-canary.c79aa0cdd.0","lit":"^2.0.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.26.0-canary.3a5d5f34.0","@material/notched-outline":"=13.0.0-canary.c79aa0cdd.0","@material/ripple":"=13.0.0-canary.c79aa0cdd.0","@material/shape":"=13.0.0-canary.c79aa0cdd.0","@material/theme":"=13.0.0-canary.c79aa0cdd.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"0708ad010478b6186d6be52d3494f33bd4d40e17","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0708ad010478b6186d6be52d3494f33bd4d40e17/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0708ad010478b6186d6be52d3494f33bd4d40e17/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0708ad010478b6186d6be52d3494f33bd4d40e17/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0708ad010478b6186d6be52d3494f33bd4d40e17/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0708ad010478b6186d6be52d3494f33bd4d40e17/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0708ad010478b6186d6be52d3494f33bd4d40e17/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0708ad010478b6186d6be52d3494f33bd4d40e17/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0708ad010478b6186d6be52d3494f33bd4d40e17/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.26.0-canary.3a5d5f34.0","_nodeVersion":"14.17.6","_npmVersion":"lerna/3.22.1/node@v14.17.6+x64 (linux)","dist":{"integrity":"sha512-Q9XO4xAJCt4QHZ9tkCVCOFtLfE5rBpE5Kwm8aA4d6FFrulC9ad+ScqtdmNx/7WVSq/LZaK+yvGed33GiuSR/tQ==","shasum":"7c0e1cb37e40bd0529f9ffa118a612aad80c8a33","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.26.0-canary.3a5d5f34.0.tgz","fileCount":13,"unpackedSize":201625,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDW40klnmbnOT1vnQdsriN4gcfNP6yJ1Ylfl3/a23zolQIhANQDqhtuz0hP8srC5SZo81vZQ0gZT+axCJipWW4BxKXC"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.26.0-canary.3a5d5f34.0_1632782490302_0.8842474845184296"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.26.0-canary.143ed3c8.0":{"name":"@material/mwc-textfield","version":"0.26.0-canary.143ed3c8.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=14.0.0-canary.86b50ef74.0","@material/line-ripple":"=14.0.0-canary.86b50ef74.0","@material/mwc-base":"0.26.0-canary.143ed3c8.0","@material/mwc-floating-label":"0.26.0-canary.143ed3c8.0","@material/mwc-line-ripple":"0.26.0-canary.143ed3c8.0","@material/mwc-notched-outline":"0.26.0-canary.143ed3c8.0","@material/textfield":"=14.0.0-canary.86b50ef74.0","lit":"^2.0.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.26.0-canary.143ed3c8.0","@material/notched-outline":"=14.0.0-canary.86b50ef74.0","@material/ripple":"=14.0.0-canary.86b50ef74.0","@material/shape":"=14.0.0-canary.86b50ef74.0","@material/theme":"=14.0.0-canary.86b50ef74.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"d25beb586046dd7cd30a302cdbcf1114a66b7770","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d25beb586046dd7cd30a302cdbcf1114a66b7770/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d25beb586046dd7cd30a302cdbcf1114a66b7770/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d25beb586046dd7cd30a302cdbcf1114a66b7770/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d25beb586046dd7cd30a302cdbcf1114a66b7770/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d25beb586046dd7cd30a302cdbcf1114a66b7770/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d25beb586046dd7cd30a302cdbcf1114a66b7770/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d25beb586046dd7cd30a302cdbcf1114a66b7770/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d25beb586046dd7cd30a302cdbcf1114a66b7770/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.26.0-canary.143ed3c8.0","_nodeVersion":"14.17.6","_npmVersion":"lerna/3.22.1/node@v14.17.6+x64 (linux)","dist":{"integrity":"sha512-+6CTWhjstT2Vkjdu89aSF/Upt+bMIXM8EwomoOBZFAI1OkErCN12qLUbqfPPkoFrJ9K7YBFYgAToLpfq8LkRqQ==","shasum":"56cdd616b55ce2cd1cd5763e7abfbe3e6b7d3a61","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.26.0-canary.143ed3c8.0.tgz","fileCount":13,"unpackedSize":201625,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCuIdUF1bQ1JYEV2C38tVzo8fEK1IwU9j76YnhXREWUkwIhAN7fhtU1fWsg3b0oFgsIvRPeaYCl81bAuSMuMyqySnvM"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.26.0-canary.143ed3c8.0_1632880249919_0.2016033967569808"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.26.0-canary.e5923d68.0":{"name":"@material/mwc-textfield","version":"0.26.0-canary.e5923d68.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=14.0.0-canary.86b50ef74.0","@material/line-ripple":"=14.0.0-canary.86b50ef74.0","@material/mwc-base":"0.26.0-canary.e5923d68.0","@material/mwc-floating-label":"0.26.0-canary.e5923d68.0","@material/mwc-line-ripple":"0.26.0-canary.e5923d68.0","@material/mwc-notched-outline":"0.26.0-canary.e5923d68.0","@material/textfield":"=14.0.0-canary.86b50ef74.0","lit":"^2.0.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.26.0-canary.e5923d68.0","@material/notched-outline":"=14.0.0-canary.86b50ef74.0","@material/ripple":"=14.0.0-canary.86b50ef74.0","@material/shape":"=14.0.0-canary.86b50ef74.0","@material/theme":"=14.0.0-canary.86b50ef74.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"41f6e947d4028d5479ec62a20cbf1e1fce3c3a27","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/41f6e947d4028d5479ec62a20cbf1e1fce3c3a27/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/41f6e947d4028d5479ec62a20cbf1e1fce3c3a27/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/41f6e947d4028d5479ec62a20cbf1e1fce3c3a27/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/41f6e947d4028d5479ec62a20cbf1e1fce3c3a27/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/41f6e947d4028d5479ec62a20cbf1e1fce3c3a27/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/41f6e947d4028d5479ec62a20cbf1e1fce3c3a27/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/41f6e947d4028d5479ec62a20cbf1e1fce3c3a27/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/41f6e947d4028d5479ec62a20cbf1e1fce3c3a27/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.26.0-canary.e5923d68.0","_nodeVersion":"14.17.6","_npmVersion":"lerna/3.22.1/node@v14.17.6+x64 (linux)","dist":{"integrity":"sha512-F2Rj+Q/HCCOi7nasNqF70aTHwA3+42+c0b03NwTNUSuk/gLUYu8Lnh7uIWkIDb5YWeZAZNuUBIVGFeNRWPrVOw==","shasum":"9af7b86c0ef3ec56c772d372d9fc67e9721e8efd","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.26.0-canary.e5923d68.0.tgz","fileCount":13,"unpackedSize":202276,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFK+2NcLaz9DUouzFgMeVSSph9HUi3mQKRfhwaUbURxQAiAf5FM9XBaXX3XlNhAkPEO1y6qXAW5waeTURDoiY7U2sA=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.26.0-canary.e5923d68.0_1632960348942_0.8768958391925536"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.26.0-canary.d8ed5109.0":{"name":"@material/mwc-textfield","version":"0.26.0-canary.d8ed5109.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=14.0.0-canary.586e740dd.0","@material/line-ripple":"=14.0.0-canary.586e740dd.0","@material/mwc-base":"0.26.0-canary.d8ed5109.0","@material/mwc-floating-label":"0.26.0-canary.d8ed5109.0","@material/mwc-line-ripple":"0.26.0-canary.d8ed5109.0","@material/mwc-notched-outline":"0.26.0-canary.d8ed5109.0","@material/textfield":"=14.0.0-canary.586e740dd.0","lit":"^2.0.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.26.0-canary.d8ed5109.0","@material/notched-outline":"=14.0.0-canary.586e740dd.0","@material/ripple":"=14.0.0-canary.586e740dd.0","@material/shape":"=14.0.0-canary.586e740dd.0","@material/theme":"=14.0.0-canary.586e740dd.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"7cb638711a37e4d716e9aecb64598a665d377e7c","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7cb638711a37e4d716e9aecb64598a665d377e7c/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7cb638711a37e4d716e9aecb64598a665d377e7c/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7cb638711a37e4d716e9aecb64598a665d377e7c/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7cb638711a37e4d716e9aecb64598a665d377e7c/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7cb638711a37e4d716e9aecb64598a665d377e7c/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7cb638711a37e4d716e9aecb64598a665d377e7c/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7cb638711a37e4d716e9aecb64598a665d377e7c/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7cb638711a37e4d716e9aecb64598a665d377e7c/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.26.0-canary.d8ed5109.0","_nodeVersion":"14.18.0","_npmVersion":"lerna/3.22.1/node@v14.18.0+x64 (linux)","dist":{"integrity":"sha512-uUqQO+NuH9AL8E3MAB4PMvTScm0jc+drk2mDVl4AHNj29yIcylY7L6Gwk603L2PhG3mvnsOCAz6XRIt9DH4PmQ==","shasum":"601f4ed13fe90688a8fab951204c99036db61cc7","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.26.0-canary.d8ed5109.0.tgz","fileCount":13,"unpackedSize":202276,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF+cvioeZ8a0zbJdOFQgL5Du/W9F5kR7UZFnNJmBw8WhAiEA6hNIPUfjkr2tVm1uzyI5WEEdjpF3GDuc2cyAoaG/bL0="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.26.0-canary.d8ed5109.0_1633044832481_0.6041690271409275"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.26.0-canary.0efb9c2c.0":{"name":"@material/mwc-textfield","version":"0.26.0-canary.0efb9c2c.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=14.0.0-canary.586e740dd.0","@material/line-ripple":"=14.0.0-canary.586e740dd.0","@material/mwc-base":"0.26.0-canary.0efb9c2c.0","@material/mwc-floating-label":"0.26.0-canary.0efb9c2c.0","@material/mwc-line-ripple":"0.26.0-canary.0efb9c2c.0","@material/mwc-notched-outline":"0.26.0-canary.0efb9c2c.0","@material/textfield":"=14.0.0-canary.586e740dd.0","lit":"^2.0.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.26.0-canary.0efb9c2c.0","@material/notched-outline":"=14.0.0-canary.586e740dd.0","@material/ripple":"=14.0.0-canary.586e740dd.0","@material/shape":"=14.0.0-canary.586e740dd.0","@material/theme":"=14.0.0-canary.586e740dd.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"878935c40ce21b0cfddbf2aab964ba07d23dbb94","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/878935c40ce21b0cfddbf2aab964ba07d23dbb94/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/878935c40ce21b0cfddbf2aab964ba07d23dbb94/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/878935c40ce21b0cfddbf2aab964ba07d23dbb94/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/878935c40ce21b0cfddbf2aab964ba07d23dbb94/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/878935c40ce21b0cfddbf2aab964ba07d23dbb94/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/878935c40ce21b0cfddbf2aab964ba07d23dbb94/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/878935c40ce21b0cfddbf2aab964ba07d23dbb94/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/878935c40ce21b0cfddbf2aab964ba07d23dbb94/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.26.0-canary.0efb9c2c.0","_nodeVersion":"14.18.0","_npmVersion":"lerna/3.22.1/node@v14.18.0+x64 (linux)","dist":{"integrity":"sha512-xRc0vC55Yx45zk2Zb6Ikj2lBQ0YTMVSDNhWFsTfmD4st5XwZliEVRk9RA5Cs7+y+Ce8/0IEyK+0qax7sAi804A==","shasum":"8afe216b750c25eeff0e0ab12a9ca2e1d4f00900","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.26.0-canary.0efb9c2c.0.tgz","fileCount":13,"unpackedSize":202276,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCmiEsBEvTNqKx+7ZZxLnlBdc49s7LaSPjY96jhe9MpZwIhAMyGmt0PoZOXkeT2peVXbanhPxrylgZdTukqp3C0UgSz"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.26.0-canary.0efb9c2c.0_1633140495815_0.11606416078511406"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.26.0-canary.1c9adcb3.0":{"name":"@material/mwc-textfield","version":"0.26.0-canary.1c9adcb3.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=14.0.0-canary.586e740dd.0","@material/line-ripple":"=14.0.0-canary.586e740dd.0","@material/mwc-base":"0.26.0-canary.1c9adcb3.0","@material/mwc-floating-label":"0.26.0-canary.1c9adcb3.0","@material/mwc-line-ripple":"0.26.0-canary.1c9adcb3.0","@material/mwc-notched-outline":"0.26.0-canary.1c9adcb3.0","@material/textfield":"=14.0.0-canary.586e740dd.0","lit":"^2.0.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.26.0-canary.1c9adcb3.0","@material/notched-outline":"=14.0.0-canary.586e740dd.0","@material/ripple":"=14.0.0-canary.586e740dd.0","@material/shape":"=14.0.0-canary.586e740dd.0","@material/theme":"=14.0.0-canary.586e740dd.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"432b66e41cc474278a452cfd5bd850754fd8b9f3","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/432b66e41cc474278a452cfd5bd850754fd8b9f3/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/432b66e41cc474278a452cfd5bd850754fd8b9f3/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/432b66e41cc474278a452cfd5bd850754fd8b9f3/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/432b66e41cc474278a452cfd5bd850754fd8b9f3/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/432b66e41cc474278a452cfd5bd850754fd8b9f3/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/432b66e41cc474278a452cfd5bd850754fd8b9f3/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/432b66e41cc474278a452cfd5bd850754fd8b9f3/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/432b66e41cc474278a452cfd5bd850754fd8b9f3/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.26.0-canary.1c9adcb3.0","_nodeVersion":"14.18.0","_npmVersion":"lerna/3.22.1/node@v14.18.0+x64 (linux)","dist":{"integrity":"sha512-ZRNcQnsJJAjo/PyjPjfkoZXCwbV6CAqRa4Lx0KDkXg88uh/+5X6BHOjqk6pDdn80HvoFcb/suqQ5pkLquP6Ybg==","shasum":"a4c1fc66d743c940a92bca29289f2a8daff084e5","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.26.0-canary.1c9adcb3.0.tgz","fileCount":13,"unpackedSize":202276,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCvaYn16mFWlQQ6wcjbEUVMiLtlKRhRgGmChslRg3WCiwIgK8gKUiExRT0thRMQsXYQvLzNC86gsrOp9yyuHhzDOGk="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.26.0-canary.1c9adcb3.0_1633368812925_0.5157548655684554"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.26.0-canary.dfc00d60.0":{"name":"@material/mwc-textfield","version":"0.26.0-canary.dfc00d60.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=14.0.0-canary.353ca7e9f.0","@material/line-ripple":"=14.0.0-canary.353ca7e9f.0","@material/mwc-base":"0.26.0-canary.dfc00d60.0","@material/mwc-floating-label":"0.26.0-canary.dfc00d60.0","@material/mwc-line-ripple":"0.26.0-canary.dfc00d60.0","@material/mwc-notched-outline":"0.26.0-canary.dfc00d60.0","@material/textfield":"=14.0.0-canary.353ca7e9f.0","lit":"^2.0.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.26.0-canary.dfc00d60.0","@material/notched-outline":"=14.0.0-canary.353ca7e9f.0","@material/ripple":"=14.0.0-canary.353ca7e9f.0","@material/shape":"=14.0.0-canary.353ca7e9f.0","@material/theme":"=14.0.0-canary.353ca7e9f.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"3edf5d72f0c17bcf7c2e7377e2c0b4579168d2b0","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3edf5d72f0c17bcf7c2e7377e2c0b4579168d2b0/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3edf5d72f0c17bcf7c2e7377e2c0b4579168d2b0/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3edf5d72f0c17bcf7c2e7377e2c0b4579168d2b0/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3edf5d72f0c17bcf7c2e7377e2c0b4579168d2b0/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3edf5d72f0c17bcf7c2e7377e2c0b4579168d2b0/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3edf5d72f0c17bcf7c2e7377e2c0b4579168d2b0/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3edf5d72f0c17bcf7c2e7377e2c0b4579168d2b0/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3edf5d72f0c17bcf7c2e7377e2c0b4579168d2b0/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.26.0-canary.dfc00d60.0","_nodeVersion":"14.18.0","_npmVersion":"lerna/3.22.1/node@v14.18.0+x64 (linux)","dist":{"integrity":"sha512-AgOUI0eMhi6jHUqUxRGz+LsItSMP5BPkYmP1nWvlqS6LDk3WLJ7rzawtPHmkl3DZmLqbomeDtkWDDsO96RTQLg==","shasum":"f5993502c8bbc26fd0d1fb7ff8bdfd4279973d61","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.26.0-canary.dfc00d60.0.tgz","fileCount":13,"unpackedSize":202276,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGN4Br2vbYm9wDpfXbb/E7hu3GJSkT22cyAXpHBXWwSSAiEA+OiLCsiRYZYhKMx2FX+KNp1H8vSAG8QLnQdfEZ6ZWdc="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.26.0-canary.dfc00d60.0_1633741034227_0.23803827003191547"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.26.0-canary.c3aa844c.0":{"name":"@material/mwc-textfield","version":"0.26.0-canary.c3aa844c.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=14.0.0-canary.353ca7e9f.0","@material/line-ripple":"=14.0.0-canary.353ca7e9f.0","@material/mwc-base":"0.26.0-canary.c3aa844c.0","@material/mwc-floating-label":"0.26.0-canary.c3aa844c.0","@material/mwc-line-ripple":"0.26.0-canary.c3aa844c.0","@material/mwc-notched-outline":"0.26.0-canary.c3aa844c.0","@material/textfield":"=14.0.0-canary.353ca7e9f.0","lit":"^2.0.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.26.0-canary.c3aa844c.0","@material/notched-outline":"=14.0.0-canary.353ca7e9f.0","@material/ripple":"=14.0.0-canary.353ca7e9f.0","@material/shape":"=14.0.0-canary.353ca7e9f.0","@material/theme":"=14.0.0-canary.353ca7e9f.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"a792c732afb00bf097879fdcd7a1ac2a0c5d9506","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a792c732afb00bf097879fdcd7a1ac2a0c5d9506/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a792c732afb00bf097879fdcd7a1ac2a0c5d9506/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a792c732afb00bf097879fdcd7a1ac2a0c5d9506/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a792c732afb00bf097879fdcd7a1ac2a0c5d9506/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a792c732afb00bf097879fdcd7a1ac2a0c5d9506/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a792c732afb00bf097879fdcd7a1ac2a0c5d9506/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a792c732afb00bf097879fdcd7a1ac2a0c5d9506/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a792c732afb00bf097879fdcd7a1ac2a0c5d9506/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.26.0-canary.c3aa844c.0","_nodeVersion":"14.18.0","_npmVersion":"lerna/3.22.1/node@v14.18.0+x64 (linux)","dist":{"integrity":"sha512-7Zvv/VjeatmsuyyokcOtRFaKp58m1VzaFNSBEPWHRy20VuLnEh/d0SZsegX1MfIF8InP1JJDuM48dptq5Q1GKg==","shasum":"c45de76dfb2006d1af2e077da1e808e3ffaa42c9","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.26.0-canary.c3aa844c.0.tgz","fileCount":13,"unpackedSize":202276,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC6bH4oe8DENnWx5+A7SbqpmF5QuEr6nHl4BsI+ZbWNhAiEA8GS1q1jowRF2X4dgW4xljvsImXQuIzR5pZAQwGT1eJ4="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.26.0-canary.c3aa844c.0_1633994060609_0.6164974968853216"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.25.2":{"name":"@material/mwc-textfield","version":"0.25.2","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=14.0.0-canary.353ca7e9f.0","@material/line-ripple":"=14.0.0-canary.353ca7e9f.0","@material/mwc-base":"^0.25.2","@material/mwc-floating-label":"^0.25.2","@material/mwc-line-ripple":"^0.25.2","@material/mwc-notched-outline":"^0.25.2","@material/textfield":"=14.0.0-canary.353ca7e9f.0","lit":"^2.0.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"^0.25.2","@material/notched-outline":"=14.0.0-canary.353ca7e9f.0","@material/ripple":"=14.0.0-canary.353ca7e9f.0","@material/shape":"=14.0.0-canary.353ca7e9f.0","@material/theme":"=14.0.0-canary.353ca7e9f.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"c3aa844c2a09ff9868820ce946f25f9df7714560","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.25.2","_nodeVersion":"12.22.5","_npmVersion":"lerna/3.22.1/node@v12.22.5+x64 (linux)","dist":{"integrity":"sha512-MWxfOryo1r0KLoHBwZ77tonga2yB6dFof0z8mC1XJEvr7QGK6HqiaR+U+bQkxygxd5+ZCBn+pCR+Aii/TTKpDA==","shasum":"4dddb4cd4f60288a1890c4424e8dda0007649f78","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.25.2.tgz","fileCount":13,"unpackedSize":202173,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDJlMNBKxWXZTXMehN3tWaqTawssclwBBQP6c5VZ3dZjgIgA0kndgzx578sFS4GiA8NYWvBgd3cS+aZ3OxueersqN8="}]},"_npmUser":{"name":"taylorv","email":"brian.t.vann@gmail.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.25.2_1633994313027_0.5481945953562692"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.26.0-canary.406d6fe1.0":{"name":"@material/mwc-textfield","version":"0.26.0-canary.406d6fe1.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=14.0.0-canary.353ca7e9f.0","@material/line-ripple":"=14.0.0-canary.353ca7e9f.0","@material/mwc-base":"0.26.0-canary.406d6fe1.0","@material/mwc-floating-label":"0.26.0-canary.406d6fe1.0","@material/mwc-line-ripple":"0.26.0-canary.406d6fe1.0","@material/mwc-notched-outline":"0.26.0-canary.406d6fe1.0","@material/textfield":"=14.0.0-canary.353ca7e9f.0","lit":"^2.0.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.26.0-canary.406d6fe1.0","@material/notched-outline":"=14.0.0-canary.353ca7e9f.0","@material/ripple":"=14.0.0-canary.353ca7e9f.0","@material/shape":"=14.0.0-canary.353ca7e9f.0","@material/theme":"=14.0.0-canary.353ca7e9f.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"d1410f3120b13ff08ccd731739c038b9fb14af78","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d1410f3120b13ff08ccd731739c038b9fb14af78/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d1410f3120b13ff08ccd731739c038b9fb14af78/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d1410f3120b13ff08ccd731739c038b9fb14af78/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d1410f3120b13ff08ccd731739c038b9fb14af78/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d1410f3120b13ff08ccd731739c038b9fb14af78/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d1410f3120b13ff08ccd731739c038b9fb14af78/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d1410f3120b13ff08ccd731739c038b9fb14af78/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/d1410f3120b13ff08ccd731739c038b9fb14af78/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.26.0-canary.406d6fe1.0","_nodeVersion":"14.18.0","_npmVersion":"lerna/3.22.1/node@v14.18.0+x64 (linux)","dist":{"integrity":"sha512-NkOn77knTEb6U2zS3WnJx8ja1QisnqdK9hqals7OCnLH6M4AY480OKn6h9e2bOcz/d5mBRClgMQfDd9mBs8lcw==","shasum":"8c330d5421d8256f528d24d0ef2b2bd2a7b2aa15","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.26.0-canary.406d6fe1.0.tgz","fileCount":13,"unpackedSize":202252,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDmEq7LZ5UbkjpdeY2KQIhvptlzCnKOOgoX30rZNeTVegIhAJc3SCc+71pEklQ4eELATAz3VDwJ2Jc9H+KszrnuylC1"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.26.0-canary.406d6fe1.0_1634158767043_0.9172874219261387"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.26.0-canary.ca0a674f.0":{"name":"@material/mwc-textfield","version":"0.26.0-canary.ca0a674f.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=14.0.0-canary.353ca7e9f.0","@material/line-ripple":"=14.0.0-canary.353ca7e9f.0","@material/mwc-base":"0.26.0-canary.ca0a674f.0","@material/mwc-floating-label":"0.26.0-canary.ca0a674f.0","@material/mwc-line-ripple":"0.26.0-canary.ca0a674f.0","@material/mwc-notched-outline":"0.26.0-canary.ca0a674f.0","@material/textfield":"=14.0.0-canary.353ca7e9f.0","lit":"^2.0.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.26.0-canary.ca0a674f.0","@material/notched-outline":"=14.0.0-canary.353ca7e9f.0","@material/ripple":"=14.0.0-canary.353ca7e9f.0","@material/shape":"=14.0.0-canary.353ca7e9f.0","@material/theme":"=14.0.0-canary.353ca7e9f.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"b8e99d19dfc1b6d5062ada3345d461e9a77f18f1","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b8e99d19dfc1b6d5062ada3345d461e9a77f18f1/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b8e99d19dfc1b6d5062ada3345d461e9a77f18f1/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b8e99d19dfc1b6d5062ada3345d461e9a77f18f1/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b8e99d19dfc1b6d5062ada3345d461e9a77f18f1/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b8e99d19dfc1b6d5062ada3345d461e9a77f18f1/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b8e99d19dfc1b6d5062ada3345d461e9a77f18f1/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b8e99d19dfc1b6d5062ada3345d461e9a77f18f1/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b8e99d19dfc1b6d5062ada3345d461e9a77f18f1/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.26.0-canary.ca0a674f.0","_nodeVersion":"14.18.0","_npmVersion":"lerna/3.22.1/node@v14.18.0+x64 (linux)","dist":{"integrity":"sha512-J0yBuIQmGHE2c+Sq9z+mK2+7rWCXDXWB8XPFUIrJa4U9zO8+urpAftZUIdHnBZFH3bxe3fOgpDZo47H/pu4fGQ==","shasum":"2ac18fae2adcebf57e96963ed2f869116c234b41","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.26.0-canary.ca0a674f.0.tgz","fileCount":13,"unpackedSize":202252,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA/B5RDN7v8GsWn9nJqJwPMKt2QSTtS0hKBWPrkXvMXRAiEAlGg+uUNRzWN5cxYdgKViyTp/cwyEK0MxCW1DfxFiWDc="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.26.0-canary.ca0a674f.0_1634593015354_0.8822815223059586"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.26.0-canary.eefcf660.0":{"name":"@material/mwc-textfield","version":"0.26.0-canary.eefcf660.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=14.0.0-canary.261f2db59.0","@material/line-ripple":"=14.0.0-canary.261f2db59.0","@material/mwc-base":"0.26.0-canary.eefcf660.0","@material/mwc-floating-label":"0.26.0-canary.eefcf660.0","@material/mwc-line-ripple":"0.26.0-canary.eefcf660.0","@material/mwc-notched-outline":"0.26.0-canary.eefcf660.0","@material/textfield":"=14.0.0-canary.261f2db59.0","lit":"^2.0.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.26.0-canary.eefcf660.0","@material/notched-outline":"=14.0.0-canary.261f2db59.0","@material/ripple":"=14.0.0-canary.261f2db59.0","@material/shape":"=14.0.0-canary.261f2db59.0","@material/theme":"=14.0.0-canary.261f2db59.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"70552d8e831f6542ab42f41bb5d338adcff0500e","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/70552d8e831f6542ab42f41bb5d338adcff0500e/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/70552d8e831f6542ab42f41bb5d338adcff0500e/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/70552d8e831f6542ab42f41bb5d338adcff0500e/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/70552d8e831f6542ab42f41bb5d338adcff0500e/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/70552d8e831f6542ab42f41bb5d338adcff0500e/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/70552d8e831f6542ab42f41bb5d338adcff0500e/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/70552d8e831f6542ab42f41bb5d338adcff0500e/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/70552d8e831f6542ab42f41bb5d338adcff0500e/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.26.0-canary.eefcf660.0","_nodeVersion":"14.18.0","_npmVersion":"lerna/3.22.1/node@v14.18.0+x64 (linux)","dist":{"integrity":"sha512-nG6hTznrndnMv2sVKSblfKu01LI6tDGlfe1rkcXrLXasnDBlxLpv79qnAww/iWAXUU9VWPR2/2LTeBZJnYCrEg==","shasum":"0277beca0b26fdd8f2fe26581175965c646af918","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.26.0-canary.eefcf660.0.tgz","fileCount":13,"unpackedSize":202252,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAPICDuKIFbnkNHt4OSkX1cGclMYdLEp9V5xOOVObMwFAiAZuAKFRmFLtpeD8ja+89HzMm+dvnrVgdIU5cqUmwYemQ=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.26.0-canary.eefcf660.0_1634765016069_0.05249714263022254"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.26.0-canary.d21acc8f.0":{"name":"@material/mwc-textfield","version":"0.26.0-canary.d21acc8f.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=14.0.0-canary.261f2db59.0","@material/line-ripple":"=14.0.0-canary.261f2db59.0","@material/mwc-base":"0.26.0-canary.d21acc8f.0","@material/mwc-floating-label":"0.26.0-canary.d21acc8f.0","@material/mwc-line-ripple":"0.26.0-canary.d21acc8f.0","@material/mwc-notched-outline":"0.26.0-canary.d21acc8f.0","@material/textfield":"=14.0.0-canary.261f2db59.0","lit":"^2.0.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.26.0-canary.d21acc8f.0","@material/notched-outline":"=14.0.0-canary.261f2db59.0","@material/ripple":"=14.0.0-canary.261f2db59.0","@material/shape":"=14.0.0-canary.261f2db59.0","@material/theme":"=14.0.0-canary.261f2db59.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"13f43aef10317d911611c572ecc044445a012a2f","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/13f43aef10317d911611c572ecc044445a012a2f/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/13f43aef10317d911611c572ecc044445a012a2f/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/13f43aef10317d911611c572ecc044445a012a2f/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/13f43aef10317d911611c572ecc044445a012a2f/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/13f43aef10317d911611c572ecc044445a012a2f/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/13f43aef10317d911611c572ecc044445a012a2f/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/13f43aef10317d911611c572ecc044445a012a2f/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/13f43aef10317d911611c572ecc044445a012a2f/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.26.0-canary.d21acc8f.0","_nodeVersion":"14.18.0","_npmVersion":"lerna/3.22.1/node@v14.18.0+x64 (linux)","dist":{"integrity":"sha512-Z1t+q6MFPiEWh0GzSg8srrVK3Kh9obA6QqitTpUa6kigkrxhdzIz4TTaYqU7ALFRyx9ZPnoBg9NGCzRuRvWtwQ==","shasum":"64b59033e80ef4a0446cb781442006e3d2a074f0","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.26.0-canary.d21acc8f.0.tgz","fileCount":13,"unpackedSize":202252,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDv80TcqUSca28myANU7QBvERIMolLJEUr/6OlCstAlsAIhAIHOWeN5vfqTivdZuymF04rewPSl81dbmHqxXGGdl2ZZ"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.26.0-canary.d21acc8f.0_1634769148979_0.4540850138996009"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.25.3":{"name":"@material/mwc-textfield","version":"0.25.3","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=14.0.0-canary.261f2db59.0","@material/line-ripple":"=14.0.0-canary.261f2db59.0","@material/mwc-base":"^0.25.3","@material/mwc-floating-label":"^0.25.3","@material/mwc-line-ripple":"^0.25.3","@material/mwc-notched-outline":"^0.25.3","@material/textfield":"=14.0.0-canary.261f2db59.0","lit":"^2.0.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"^0.25.3","@material/notched-outline":"=14.0.0-canary.261f2db59.0","@material/ripple":"=14.0.0-canary.261f2db59.0","@material/shape":"=14.0.0-canary.261f2db59.0","@material/theme":"=14.0.0-canary.261f2db59.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"1f19804bea995fc84ab35feb67668d9874ff10f9","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.25.3","_nodeVersion":"12.22.5","_npmVersion":"lerna/3.22.1/node@v12.22.5+x64 (linux)","dist":{"integrity":"sha512-stpZ8sEyo2Mb9fG2XCoTc1Kom8oRXZiVI5rU88GtfcBU7nH0em8S4grq9X1mVfUG6Cfi1G/T+avCSIhzbYtr0w==","shasum":"651389a92d0d29f1b7ed7e252129314eadcfae3e","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.25.3.tgz","fileCount":13,"unpackedSize":202149,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFv888LnlgaM9NZsAIjY4cOqbXUM5kYBYZ+PryezPReuAiEA28LcXDwuC+jQHSYR09K/TSOkRFyh589sg2LC/i3bjfs="}]},"_npmUser":{"name":"taylorv","email":"brian.t.vann@gmail.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.25.3_1634838944387_0.22441821975151988"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.26.0-canary.60449b7b.0":{"name":"@material/mwc-textfield","version":"0.26.0-canary.60449b7b.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=14.0.0-canary.9803d2dc1.0","@material/line-ripple":"=14.0.0-canary.9803d2dc1.0","@material/mwc-base":"0.26.0-canary.60449b7b.0","@material/mwc-floating-label":"0.26.0-canary.60449b7b.0","@material/mwc-line-ripple":"0.26.0-canary.60449b7b.0","@material/mwc-notched-outline":"0.26.0-canary.60449b7b.0","@material/textfield":"=14.0.0-canary.9803d2dc1.0","lit":"^2.0.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.26.0-canary.60449b7b.0","@material/notched-outline":"=14.0.0-canary.9803d2dc1.0","@material/ripple":"=14.0.0-canary.9803d2dc1.0","@material/shape":"=14.0.0-canary.9803d2dc1.0","@material/theme":"=14.0.0-canary.9803d2dc1.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"cb5b8ebecb046df6d10001a163b69a26954c94bf","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cb5b8ebecb046df6d10001a163b69a26954c94bf/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cb5b8ebecb046df6d10001a163b69a26954c94bf/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cb5b8ebecb046df6d10001a163b69a26954c94bf/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cb5b8ebecb046df6d10001a163b69a26954c94bf/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cb5b8ebecb046df6d10001a163b69a26954c94bf/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cb5b8ebecb046df6d10001a163b69a26954c94bf/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cb5b8ebecb046df6d10001a163b69a26954c94bf/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/cb5b8ebecb046df6d10001a163b69a26954c94bf/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.26.0-canary.60449b7b.0","_nodeVersion":"14.18.1","_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","dist":{"integrity":"sha512-f0+wjhSB672nMxIhJnKZSGXe1SoRBw4o14DcuBM6D5GcaUHSZqSl4retJAOE7yM3gsTWamnY/dwMGIxDJjSi0A==","shasum":"dcfb2c39ee61d55700e4a3e75c5164661ef0ac23","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.26.0-canary.60449b7b.0.tgz","fileCount":13,"unpackedSize":202252,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFMf72MAODObDRYFo2k4DQ+Odk4hC2kyU9C5lw8IDd2PAiEAnxXMuJMDKwRG4iG3dw/wk+P0pkS0DgZbt6f7IvPNpA8="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.26.0-canary.60449b7b.0_1634840245560_0.8264263483369312"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.26.0-canary.0d8084ed.0":{"name":"@material/mwc-textfield","version":"0.26.0-canary.0d8084ed.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=14.0.0-canary.9803d2dc1.0","@material/line-ripple":"=14.0.0-canary.9803d2dc1.0","@material/mwc-base":"0.26.0-canary.0d8084ed.0","@material/mwc-floating-label":"0.26.0-canary.0d8084ed.0","@material/mwc-line-ripple":"0.26.0-canary.0d8084ed.0","@material/mwc-notched-outline":"0.26.0-canary.0d8084ed.0","@material/textfield":"=14.0.0-canary.9803d2dc1.0","lit":"^2.0.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.26.0-canary.0d8084ed.0","@material/notched-outline":"=14.0.0-canary.9803d2dc1.0","@material/ripple":"=14.0.0-canary.9803d2dc1.0","@material/shape":"=14.0.0-canary.9803d2dc1.0","@material/theme":"=14.0.0-canary.9803d2dc1.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"ca8c4979ee49843dba32b345040faa8c1e8a22a4","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ca8c4979ee49843dba32b345040faa8c1e8a22a4/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ca8c4979ee49843dba32b345040faa8c1e8a22a4/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ca8c4979ee49843dba32b345040faa8c1e8a22a4/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ca8c4979ee49843dba32b345040faa8c1e8a22a4/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ca8c4979ee49843dba32b345040faa8c1e8a22a4/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ca8c4979ee49843dba32b345040faa8c1e8a22a4/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ca8c4979ee49843dba32b345040faa8c1e8a22a4/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ca8c4979ee49843dba32b345040faa8c1e8a22a4/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.26.0-canary.0d8084ed.0","_nodeVersion":"14.18.1","_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","dist":{"integrity":"sha512-FjbrOh4X6qGqXpJYQk7Gql6lVZA1lyNjkHJsNT7c/076JjgLoepDWTStzjib9LlKgty3GbRGWj5qQMzo43I6PA==","shasum":"7c3d336d50090ef5f416eda456aff0ac63ce3ade","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.26.0-canary.0d8084ed.0.tgz","fileCount":13,"unpackedSize":202252,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC9rQcfp0trL7yuRwTY6phvIdyNA++z5VM92r+NltbIJgIhAIgP71kGF0lJ3rLmK+qU6TEgZBsytrtjUcPMlu6+EIzS"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.26.0-canary.0d8084ed.0_1635443094226_0.13435169764082633"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.26.0-canary.232327ee.0":{"name":"@material/mwc-textfield","version":"0.26.0-canary.232327ee.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=14.0.0-canary.a986df922.0","@material/line-ripple":"=14.0.0-canary.a986df922.0","@material/mwc-base":"0.26.0-canary.232327ee.0","@material/mwc-floating-label":"0.26.0-canary.232327ee.0","@material/mwc-line-ripple":"0.26.0-canary.232327ee.0","@material/mwc-notched-outline":"0.26.0-canary.232327ee.0","@material/textfield":"=14.0.0-canary.a986df922.0","lit":"^2.0.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.26.0-canary.232327ee.0","@material/notched-outline":"=14.0.0-canary.a986df922.0","@material/ripple":"=14.0.0-canary.a986df922.0","@material/shape":"=14.0.0-canary.a986df922.0","@material/theme":"=14.0.0-canary.a986df922.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"0645d0b4b0eac5799fc20a3bd279788eb66a7564","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0645d0b4b0eac5799fc20a3bd279788eb66a7564/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0645d0b4b0eac5799fc20a3bd279788eb66a7564/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0645d0b4b0eac5799fc20a3bd279788eb66a7564/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0645d0b4b0eac5799fc20a3bd279788eb66a7564/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0645d0b4b0eac5799fc20a3bd279788eb66a7564/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0645d0b4b0eac5799fc20a3bd279788eb66a7564/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0645d0b4b0eac5799fc20a3bd279788eb66a7564/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/0645d0b4b0eac5799fc20a3bd279788eb66a7564/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.26.0-canary.232327ee.0","_nodeVersion":"14.18.1","_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","dist":{"integrity":"sha512-rOY0J7v1UGCaIvYrsYq8ah6KFg3712aobgRjwx4OIAqUKSY4CCIVkErlWVNKvYsnLCifXmZyArlGJoRgfbQ8hw==","shasum":"152f46ac4de9a6cf7f9d533919896b7f42e1fd61","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.26.0-canary.232327ee.0.tgz","fileCount":13,"unpackedSize":202252,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDuZjDPJZLRYCNAOHwXGWycgOAMxtzWY0uPA8dycgu2agIgO3gQIvc7XfgiC7+aeW8GR8AwJf3efKSAlfjLyChcLD0="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.26.0-canary.232327ee.0_1635797745667_0.46636818606405916"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.26.0-canary.0a492ae8.0":{"name":"@material/mwc-textfield","version":"0.26.0-canary.0a492ae8.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=14.0.0-canary.a986df922.0","@material/line-ripple":"=14.0.0-canary.a986df922.0","@material/mwc-base":"0.26.0-canary.0a492ae8.0","@material/mwc-floating-label":"0.26.0-canary.0a492ae8.0","@material/mwc-line-ripple":"0.26.0-canary.0a492ae8.0","@material/mwc-notched-outline":"0.26.0-canary.0a492ae8.0","@material/textfield":"=14.0.0-canary.a986df922.0","lit":"^2.0.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.26.0-canary.0a492ae8.0","@material/notched-outline":"=14.0.0-canary.a986df922.0","@material/ripple":"=14.0.0-canary.a986df922.0","@material/shape":"=14.0.0-canary.a986df922.0","@material/theme":"=14.0.0-canary.a986df922.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"9f520a49648fd39a7140df761448008fe0fbb492","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9f520a49648fd39a7140df761448008fe0fbb492/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9f520a49648fd39a7140df761448008fe0fbb492/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9f520a49648fd39a7140df761448008fe0fbb492/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9f520a49648fd39a7140df761448008fe0fbb492/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9f520a49648fd39a7140df761448008fe0fbb492/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9f520a49648fd39a7140df761448008fe0fbb492/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9f520a49648fd39a7140df761448008fe0fbb492/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9f520a49648fd39a7140df761448008fe0fbb492/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.26.0-canary.0a492ae8.0","_nodeVersion":"14.18.1","_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","dist":{"integrity":"sha512-r1/id/ex9uw05PWmxsSvECk1B5Qzmw5Qef7AQ8LgUehAequ4K77sW8Pv0gW+UBUr2XQgtt9LdRuRfdCGWjS6lg==","shasum":"4dc6f7fcd2c4f56c11c3e7c4311074f76124bc55","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.26.0-canary.0a492ae8.0.tgz","fileCount":13,"unpackedSize":202252,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDVlbls+GoJgtl+70Ij46ByJ2o4pRloabcEKJQV0hH2WQIhAMLqCHq5IdiiFrfF4KLCSzHR9x7FHbtzYKHLrY3OTb+X"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.26.0-canary.0a492ae8.0_1635847224103_0.2591201373164109"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.26.0-canary.0aa18745.0":{"name":"@material/mwc-textfield","version":"0.26.0-canary.0aa18745.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=14.0.0-canary.a986df922.0","@material/line-ripple":"=14.0.0-canary.a986df922.0","@material/mwc-base":"0.26.0-canary.0aa18745.0","@material/mwc-floating-label":"0.26.0-canary.0aa18745.0","@material/mwc-line-ripple":"0.26.0-canary.0aa18745.0","@material/mwc-notched-outline":"0.26.0-canary.0aa18745.0","@material/textfield":"=14.0.0-canary.a986df922.0","lit":"^2.0.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.26.0-canary.0aa18745.0","@material/notched-outline":"=14.0.0-canary.a986df922.0","@material/ripple":"=14.0.0-canary.a986df922.0","@material/shape":"=14.0.0-canary.a986df922.0","@material/theme":"=14.0.0-canary.a986df922.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"5345838b7f3a3ec41bf4ef997759be6aae3cd340","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5345838b7f3a3ec41bf4ef997759be6aae3cd340/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5345838b7f3a3ec41bf4ef997759be6aae3cd340/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5345838b7f3a3ec41bf4ef997759be6aae3cd340/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5345838b7f3a3ec41bf4ef997759be6aae3cd340/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5345838b7f3a3ec41bf4ef997759be6aae3cd340/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5345838b7f3a3ec41bf4ef997759be6aae3cd340/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5345838b7f3a3ec41bf4ef997759be6aae3cd340/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/5345838b7f3a3ec41bf4ef997759be6aae3cd340/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.26.0-canary.0aa18745.0","_nodeVersion":"14.18.1","_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","dist":{"integrity":"sha512-RYJW61g2a1lmrRhTpISpSXzyNkdpoLYj4KcwV7MD/wda30d1/1bgKMdEuA1tx3n9JAtoMTSY3HT1btbex1solg==","shasum":"38f4b53d1e432cf265e446d465392f1ea32d19dc","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.26.0-canary.0aa18745.0.tgz","fileCount":13,"unpackedSize":202252,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICQvK7cR8EXIiNL9FFJPJEK37r4RhJ0G6LQHxFmPGAsuAiEA2+Tm4rdcnup9fbG1zLIbIXmkc2sbLNLrlsayThPZEN8="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.26.0-canary.0aa18745.0_1635876470483_0.46440905568676416"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.26.0-canary.f3e28323.0":{"name":"@material/mwc-textfield","version":"0.26.0-canary.f3e28323.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=14.0.0-canary.a986df922.0","@material/line-ripple":"=14.0.0-canary.a986df922.0","@material/mwc-base":"0.26.0-canary.f3e28323.0","@material/mwc-floating-label":"0.26.0-canary.f3e28323.0","@material/mwc-line-ripple":"0.26.0-canary.f3e28323.0","@material/mwc-notched-outline":"0.26.0-canary.f3e28323.0","@material/textfield":"=14.0.0-canary.a986df922.0","lit":"^2.0.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.26.0-canary.f3e28323.0","@material/notched-outline":"=14.0.0-canary.a986df922.0","@material/ripple":"=14.0.0-canary.a986df922.0","@material/shape":"=14.0.0-canary.a986df922.0","@material/theme":"=14.0.0-canary.a986df922.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"ebbbec0b1b0e29da237ec87bebd889c3af847f1b","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ebbbec0b1b0e29da237ec87bebd889c3af847f1b/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ebbbec0b1b0e29da237ec87bebd889c3af847f1b/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ebbbec0b1b0e29da237ec87bebd889c3af847f1b/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ebbbec0b1b0e29da237ec87bebd889c3af847f1b/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ebbbec0b1b0e29da237ec87bebd889c3af847f1b/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ebbbec0b1b0e29da237ec87bebd889c3af847f1b/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ebbbec0b1b0e29da237ec87bebd889c3af847f1b/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/ebbbec0b1b0e29da237ec87bebd889c3af847f1b/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.26.0-canary.f3e28323.0","_nodeVersion":"14.18.1","_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","dist":{"integrity":"sha512-+I5Waa9BK6CqWc7nxteTD+fVbhBo06fOZvkcUCUcdgGugWiO5mEoFfk2mzmQkhOOKNyC30wYiV1czsC7jUyDaw==","shasum":"2890fc19812f7125a814b04bff56f91dd5dde4ba","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.26.0-canary.f3e28323.0.tgz","fileCount":13,"unpackedSize":202252,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFlOkX+3j6sfTKzWvkyhXeyXKfsc/Sd9YqBPS0onciGlAiEA2Qj5YQmMSa/NGjJTmYrY+CM/Bp/xZ8EdT7ZbT3wyY84="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.26.0-canary.f3e28323.0_1635879572874_0.31521205304760547"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.26.0-canary.27e05c5d.0":{"name":"@material/mwc-textfield","version":"0.26.0-canary.27e05c5d.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=14.0.0-canary.a986df922.0","@material/line-ripple":"=14.0.0-canary.a986df922.0","@material/mwc-base":"0.26.0-canary.27e05c5d.0","@material/mwc-floating-label":"0.26.0-canary.27e05c5d.0","@material/mwc-line-ripple":"0.26.0-canary.27e05c5d.0","@material/mwc-notched-outline":"0.26.0-canary.27e05c5d.0","@material/textfield":"=14.0.0-canary.a986df922.0","lit":"^2.0.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.26.0-canary.27e05c5d.0","@material/notched-outline":"=14.0.0-canary.a986df922.0","@material/ripple":"=14.0.0-canary.a986df922.0","@material/shape":"=14.0.0-canary.a986df922.0","@material/theme":"=14.0.0-canary.a986df922.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"c052b0acfe9f929e6bae475576f23f8349bde578","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c052b0acfe9f929e6bae475576f23f8349bde578/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c052b0acfe9f929e6bae475576f23f8349bde578/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c052b0acfe9f929e6bae475576f23f8349bde578/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c052b0acfe9f929e6bae475576f23f8349bde578/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c052b0acfe9f929e6bae475576f23f8349bde578/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c052b0acfe9f929e6bae475576f23f8349bde578/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c052b0acfe9f929e6bae475576f23f8349bde578/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/c052b0acfe9f929e6bae475576f23f8349bde578/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.26.0-canary.27e05c5d.0","_nodeVersion":"14.18.1","_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","dist":{"integrity":"sha512-lGMGNuxrUdL5NMt9Yt4/MSAH/Ay2aTS59hWerSeVgauVl5aMIoBegxIVrMoVm3/WUMueH7qwLRRkRUUfNhzScw==","shasum":"3a49720f1505cfc4102ce0f2dfdff6eed5b03ea0","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.26.0-canary.27e05c5d.0.tgz","fileCount":13,"unpackedSize":202252,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHIZWn2sNkd8q5t7LjReobVYMGLKhnsBhrTqHYJh4xcrAiAO76T+Pa57FIhWubH4gxvqLgBPVTyHHknkYHu/Y3Km2g=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.26.0-canary.27e05c5d.0_1635965098728_0.6951999710477696"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.26.0-canary.b9e44af7.0":{"name":"@material/mwc-textfield","version":"0.26.0-canary.b9e44af7.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=14.0.0-canary.a986df922.0","@material/line-ripple":"=14.0.0-canary.a986df922.0","@material/mwc-base":"0.26.0-canary.b9e44af7.0","@material/mwc-floating-label":"0.26.0-canary.b9e44af7.0","@material/mwc-line-ripple":"0.26.0-canary.b9e44af7.0","@material/mwc-notched-outline":"0.26.0-canary.b9e44af7.0","@material/textfield":"=14.0.0-canary.a986df922.0","lit":"^2.0.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.26.0-canary.b9e44af7.0","@material/notched-outline":"=14.0.0-canary.a986df922.0","@material/ripple":"=14.0.0-canary.a986df922.0","@material/shape":"=14.0.0-canary.a986df922.0","@material/theme":"=14.0.0-canary.a986df922.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"93bbd63ef108db911df936720517c5068ef30dcb","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/93bbd63ef108db911df936720517c5068ef30dcb/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/93bbd63ef108db911df936720517c5068ef30dcb/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/93bbd63ef108db911df936720517c5068ef30dcb/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/93bbd63ef108db911df936720517c5068ef30dcb/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/93bbd63ef108db911df936720517c5068ef30dcb/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/93bbd63ef108db911df936720517c5068ef30dcb/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/93bbd63ef108db911df936720517c5068ef30dcb/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/93bbd63ef108db911df936720517c5068ef30dcb/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.26.0-canary.b9e44af7.0","_nodeVersion":"14.18.1","_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","dist":{"integrity":"sha512-S3yUoERJjxbyuITFNfPzRikIDBG4731AVtrWkYupUZxWjGP+04koOYfD6Nc/8p32JOXzqoRDpT7JQyN6eILAFw==","shasum":"2b24a889a19532e5f064202d3763d8f957ea7e24","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.26.0-canary.b9e44af7.0.tgz","fileCount":13,"unpackedSize":202252,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDMHe9UBxajFRKOLc1DLbBqVJ+bsFDhKEIyrJ5IzIKSrwIhAMoJg7kc7U+c85ED6qEko045kgaQR4IKBBOikGA2Wbd7"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.26.0-canary.b9e44af7.0_1635966241441_0.7098527009127404"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.26.0-canary.448f6cb9.0":{"name":"@material/mwc-textfield","version":"0.26.0-canary.448f6cb9.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=14.0.0-canary.a986df922.0","@material/line-ripple":"=14.0.0-canary.a986df922.0","@material/mwc-base":"0.26.0-canary.448f6cb9.0","@material/mwc-floating-label":"0.26.0-canary.448f6cb9.0","@material/mwc-line-ripple":"0.26.0-canary.448f6cb9.0","@material/mwc-notched-outline":"0.26.0-canary.448f6cb9.0","@material/textfield":"=14.0.0-canary.a986df922.0","lit":"^2.0.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.26.0-canary.448f6cb9.0","@material/notched-outline":"=14.0.0-canary.a986df922.0","@material/ripple":"=14.0.0-canary.a986df922.0","@material/shape":"=14.0.0-canary.a986df922.0","@material/theme":"=14.0.0-canary.a986df922.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"b9833961f155dca92373d3a6f0476bc8cef934a2","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b9833961f155dca92373d3a6f0476bc8cef934a2/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b9833961f155dca92373d3a6f0476bc8cef934a2/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b9833961f155dca92373d3a6f0476bc8cef934a2/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b9833961f155dca92373d3a6f0476bc8cef934a2/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b9833961f155dca92373d3a6f0476bc8cef934a2/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b9833961f155dca92373d3a6f0476bc8cef934a2/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b9833961f155dca92373d3a6f0476bc8cef934a2/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/b9833961f155dca92373d3a6f0476bc8cef934a2/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.26.0-canary.448f6cb9.0","_nodeVersion":"14.18.1","_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","dist":{"integrity":"sha512-TjSm/i8J8flHlgrs4HBqZ0KbNfyRJDWwAfPqjUzWRAGowhadNBT/MeBEb6uhtKONLO+Qv0fIcDWZRITPfzn3ZA==","shasum":"46a6825a40230431aa98889149dc1db19e54903c","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.26.0-canary.448f6cb9.0.tgz","fileCount":13,"unpackedSize":202261,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCarX1HfNGzyRh9SA614c5QIJRIWsmRbKZidCEiCEQVkwIhAPieputc8Rhy5wpym5/6fMdevmc8EmydQwXPvxhXClFu"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.26.0-canary.448f6cb9.0_1636049274208_0.18387278349949088"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.26.0-canary.8067ce28.0":{"name":"@material/mwc-textfield","version":"0.26.0-canary.8067ce28.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=14.0.0-canary.a986df922.0","@material/line-ripple":"=14.0.0-canary.a986df922.0","@material/mwc-base":"0.26.0-canary.8067ce28.0","@material/mwc-floating-label":"0.26.0-canary.8067ce28.0","@material/mwc-line-ripple":"0.26.0-canary.8067ce28.0","@material/mwc-notched-outline":"0.26.0-canary.8067ce28.0","@material/textfield":"=14.0.0-canary.a986df922.0","lit":"^2.0.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.26.0-canary.8067ce28.0","@material/notched-outline":"=14.0.0-canary.a986df922.0","@material/ripple":"=14.0.0-canary.a986df922.0","@material/shape":"=14.0.0-canary.a986df922.0","@material/theme":"=14.0.0-canary.a986df922.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"a4d0d35b15bd6e7a29375f11c520886e5b9d168e","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a4d0d35b15bd6e7a29375f11c520886e5b9d168e/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a4d0d35b15bd6e7a29375f11c520886e5b9d168e/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a4d0d35b15bd6e7a29375f11c520886e5b9d168e/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a4d0d35b15bd6e7a29375f11c520886e5b9d168e/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a4d0d35b15bd6e7a29375f11c520886e5b9d168e/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a4d0d35b15bd6e7a29375f11c520886e5b9d168e/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a4d0d35b15bd6e7a29375f11c520886e5b9d168e/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a4d0d35b15bd6e7a29375f11c520886e5b9d168e/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.26.0-canary.8067ce28.0","_nodeVersion":"14.18.1","_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","dist":{"integrity":"sha512-IuBrOaG4yabnDC9ph2J6Jte4oE/Rp2H05dcCLzM7C3epb4yXR8kQQ4a3ZarkHlRd0wDHnWRRXV0RD+JJf+ViNg==","shasum":"ae6e8774f0448c32209b1864f3b81c0ae5775c2d","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.26.0-canary.8067ce28.0.tgz","fileCount":13,"unpackedSize":202261,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQChmH2ExrwRMG6IQLfcBC+pwBgXCl/HLRngDHOnDHV8EQIgWino2rpl1p/mZCC5Qkv0YhoguXkK9zjk87Jn35mLQqk="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.26.0-canary.8067ce28.0_1636064546588_0.20143692854817608"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.26.0-canary.345c2bb9.0":{"name":"@material/mwc-textfield","version":"0.26.0-canary.345c2bb9.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=14.0.0-canary.43d08ba77.0","@material/line-ripple":"=14.0.0-canary.43d08ba77.0","@material/mwc-base":"0.26.0-canary.345c2bb9.0","@material/mwc-floating-label":"0.26.0-canary.345c2bb9.0","@material/mwc-line-ripple":"0.26.0-canary.345c2bb9.0","@material/mwc-notched-outline":"0.26.0-canary.345c2bb9.0","@material/textfield":"=14.0.0-canary.43d08ba77.0","lit":"^2.0.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.26.0-canary.345c2bb9.0","@material/notched-outline":"=14.0.0-canary.43d08ba77.0","@material/ripple":"=14.0.0-canary.43d08ba77.0","@material/shape":"=14.0.0-canary.43d08ba77.0","@material/theme":"=14.0.0-canary.43d08ba77.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"3e7898316da6adc11d19b54d685e52bc4bb79733","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3e7898316da6adc11d19b54d685e52bc4bb79733/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3e7898316da6adc11d19b54d685e52bc4bb79733/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3e7898316da6adc11d19b54d685e52bc4bb79733/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3e7898316da6adc11d19b54d685e52bc4bb79733/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3e7898316da6adc11d19b54d685e52bc4bb79733/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3e7898316da6adc11d19b54d685e52bc4bb79733/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3e7898316da6adc11d19b54d685e52bc4bb79733/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3e7898316da6adc11d19b54d685e52bc4bb79733/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.26.0-canary.345c2bb9.0","_nodeVersion":"14.18.1","_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","dist":{"integrity":"sha512-damCTfg7peelk3ndE30PfPBayUkffncqRpfkvsDetouXJZYOiApJNDa+E/5C0cmqLgMOoHB043JlWKwCO1ub7w==","shasum":"be2a940693f6270c490bea6ff375826a5270dd4b","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.26.0-canary.345c2bb9.0.tgz","fileCount":13,"unpackedSize":202261,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhqP3wCRA9TVsSAnZWagAAj28P/2E6+b9+6JWwdisPZrjY\nEeIAOfnh/iWLQ8H5TzQhx7BXcAPIzc3Qrv8Yr+uBXoeNJvUndV6wrUzZQw+S\nVSYZ+SQvNShlOTX41b4GHmmsA47jO4SW4GQ9hhiWGM0KbZR4PsxwSZmhSJ0P\nlwiLV4SUJ+6fZ+1LNTCjR7Zc4lNYY8OMetCZwezRH+RjmCjfCh+NRlgddc0e\nZDfINEBjmklYYKwGpeG/HNSSoE+d/gwZqcU0ThjOnGyU8vhJfITsie6U9X3O\nCZ+fp1LDF52fB9Mk1cMKm1R4R8c584SStPRZxX5N/gkugJalHwgmLsT3cZgH\nU7+9JRdpUeCMQqDxc/O9Au55ojR3vHGFtySS3VvF+/Hoq4KY6i6+xKf03kX4\nKT95So6wMyiU9pzwtQyo3G8LwvFaLcR7Pk377vpY7QOTFNPw6roJvWpfd+UA\nXR/G+2N1fNFR9KIyk27JkRgXlSKvLys7JjhoevmSd2BjMIPbNTTRv0CsFPmY\nd1n+ZJ5FLY2GjKCwBHVuwDrfMlmTgUJRFvMha2h5HXtOpdZKnZgWVPlGbdFc\nNXcssqfPI7JqsP7MFgwc0aXxHjiywvPifNozmk+exNxyv5M3XVIxtTS0OkZm\ndA1/uN8+DDByWdNQvXjl/iIb6PBm5jKOzzBUU1u7NBfctc7yn4Ydwlia6l8f\n9nnO\r\n=DhgM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDiHy9oqVs62LCIFXm/4Eu5rr4T9Y1UTRNB/upkD+GfUQIgZI7t958ZNNWJ6Y2hJ9ZlK31XVNyiY6HmMfg+xqqP1KM="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.26.0-canary.345c2bb9.0_1638465008022_0.9093972688245331"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.26.0-canary.0547aeeb.0":{"name":"@material/mwc-textfield","version":"0.26.0-canary.0547aeeb.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=14.0.0-canary.17a072535.0","@material/line-ripple":"=14.0.0-canary.17a072535.0","@material/mwc-base":"0.26.0-canary.0547aeeb.0","@material/mwc-floating-label":"0.26.0-canary.0547aeeb.0","@material/mwc-line-ripple":"0.26.0-canary.0547aeeb.0","@material/mwc-notched-outline":"0.26.0-canary.0547aeeb.0","@material/textfield":"=14.0.0-canary.17a072535.0","lit":"^2.0.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.26.0-canary.0547aeeb.0","@material/notched-outline":"=14.0.0-canary.17a072535.0","@material/ripple":"=14.0.0-canary.17a072535.0","@material/shape":"=14.0.0-canary.17a072535.0","@material/theme":"=14.0.0-canary.17a072535.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"2115410a9593d1f2c95099961aed3e6e61255f88","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2115410a9593d1f2c95099961aed3e6e61255f88/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2115410a9593d1f2c95099961aed3e6e61255f88/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2115410a9593d1f2c95099961aed3e6e61255f88/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2115410a9593d1f2c95099961aed3e6e61255f88/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2115410a9593d1f2c95099961aed3e6e61255f88/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2115410a9593d1f2c95099961aed3e6e61255f88/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2115410a9593d1f2c95099961aed3e6e61255f88/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/2115410a9593d1f2c95099961aed3e6e61255f88/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.26.0-canary.0547aeeb.0","_nodeVersion":"14.18.1","_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","dist":{"integrity":"sha512-+wE9KY4DkVmopiKG5XZEzT/pz6de+nDUIG8sRR1o/dhV63PzZeG3eQ/Y66j3QQHGI9wQJpeHIV4AbwC1cAbD+w==","shasum":"0f701152d0434704064f253ba26d03a70555fb64","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.26.0-canary.0547aeeb.0.tgz","fileCount":13,"unpackedSize":202261,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhrjv0CRA9TVsSAnZWagAAxI0QAJxeOLWaoRHNV4vzyMan\nS11Ptx7yNncz/r33YVaFr5epha5ok06XWnguPX28gbhubeZ9Cgd3vYP8Nill\n/lw1SdDwvXWt6GZ7FkSQN/kyt02gZw7Zwbw9D+FkGfrVBaLeYKmfQN6A49DJ\np0B8PwV22H7c2Ym5FVi3WnfGBgvNKNR4q2ILBKuVN7AmSncc8XN3bIOmetFT\nIx27rrh0CHwrvE0su1+Hx3Sce9rmNIdeshGpsfQY93dnZlIwHytkJd/lChS5\n6VNbmRxfMe3f/6S56Pjyx2pC7py9aKFwOv39dhG+CbKGC/bG9qHcq3AC23ye\nFPOlrVrhmjrv4CbO3EBQF6zuWU9YWoQ4BtHRAIGdFeEnZfSBQnRBnrJZOUvK\neGowuqjuB6kMNix527uqGgsGbOXKtV55yGkfGLBDJ/t9kRCgM4dvvefGCIlL\nHDCGQ2ofdL/SsY5H9q2PvNP7JiAloK34t/9P89vSWTmTpP7WDChUcIFRORNO\nz5BYqp5DNOyRfpFn3HLbVGe2LK0nFSEz096VWKkK2Oe/ckaeUZ/9uMCIXypq\nVAJKMRnjz0rwIgCSIeIM7MPbfqABm+RSy/K1EDvMxKPuSdD8IUwjAy8+aZ3p\ndQTy/kgH51uQ3F5zW19kwqYTys5hfeTgjAZHiIbNNuzUIhNwYI7j7SvOt0zK\nEeW+\r\n=0Q+o\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDhMglh1ri6wSjcRCVc2PjlgOdgFRDwd7d3Xtgysl7GuwIgJTt/Ad0O2H7CDts/jGhsOBiMwwLnr1AO35ikBEJVOc4="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.26.0-canary.0547aeeb.0_1638808563950_0.19328465222736835"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.26.0-canary.3b2452cc.0":{"name":"@material/mwc-textfield","version":"0.26.0-canary.3b2452cc.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=14.0.0-canary.b6510c8c1.0","@material/line-ripple":"=14.0.0-canary.b6510c8c1.0","@material/mwc-base":"0.26.0-canary.3b2452cc.0","@material/mwc-floating-label":"0.26.0-canary.3b2452cc.0","@material/mwc-line-ripple":"0.26.0-canary.3b2452cc.0","@material/mwc-notched-outline":"0.26.0-canary.3b2452cc.0","@material/textfield":"=14.0.0-canary.b6510c8c1.0","lit":"^2.0.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.26.0-canary.3b2452cc.0","@material/notched-outline":"=14.0.0-canary.b6510c8c1.0","@material/ripple":"=14.0.0-canary.b6510c8c1.0","@material/shape":"=14.0.0-canary.b6510c8c1.0","@material/theme":"=14.0.0-canary.b6510c8c1.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"a95f7a1cbf5dd38cd64c9bb8e02e76d0b8927f1d","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a95f7a1cbf5dd38cd64c9bb8e02e76d0b8927f1d/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a95f7a1cbf5dd38cd64c9bb8e02e76d0b8927f1d/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a95f7a1cbf5dd38cd64c9bb8e02e76d0b8927f1d/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a95f7a1cbf5dd38cd64c9bb8e02e76d0b8927f1d/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a95f7a1cbf5dd38cd64c9bb8e02e76d0b8927f1d/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a95f7a1cbf5dd38cd64c9bb8e02e76d0b8927f1d/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a95f7a1cbf5dd38cd64c9bb8e02e76d0b8927f1d/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/a95f7a1cbf5dd38cd64c9bb8e02e76d0b8927f1d/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.26.0-canary.3b2452cc.0","_nodeVersion":"14.18.1","_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","dist":{"integrity":"sha512-dxUXIUMO4SqhvSoSDKdBDp52dSgbwlGKVPf6P9YtQXCoOht6HVatcJ/592ss8k2I5DbC7aMa0UqYuzMLN4f9SA==","shasum":"db744de21613f6bc8df5611845e090b1b3075a99","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.26.0-canary.3b2452cc.0.tgz","fileCount":13,"unpackedSize":202261,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhsUhTCRA9TVsSAnZWagAApsQP/26EIu5ox0Ae2rRZsOAb\n3bEvvCtMGDko5KMJouMWSHFsjdsjLRO3hbzUT5IQbADks1rNcezdk8BVwpB/\n3ENe9dIETAyJMKpow1t2AWzsyeQlb0qXUtSgQYK59KmUOG3Gmjkg1/+GbQjD\nbEmeRhsN/IdNQe5iq63ccccDZCz99kZdRXVaiHaohYJo/O0B+9b20qFJAiWS\nQqWAYaHK/+J0a9USETp3ndxgzqR1psHIzebL8x59qr+K1VdmFjVoYqn4CCuw\n11NpOK2zV8hV66eaesO3PENczSbHcwQ14x7GdHwnw6qIEy+L+ZrGLovBNwRC\nF6kuYhofgjA4Ke1DUZR5mVfoeX0nmS2B6ltAMd5jR/R8KMX88rm4JtmX3B33\nk+D/rmJPI+LjYn2bs72irV8AqigZdyl9+nQofGkn1ucLf0/jvg+R+Pm4Zq7E\nrN2HlZM6rCjpHuJqgh7X9QEpV6GFqoitc1pFzKyhw7357dONuUYwoB8NmwCZ\npBP3/kzZX/CoIAvp/CUebp3DpVU9rVo2eY4x55lnH+lfvpFkWXGqJZWgUFyS\njbKvP0A6y8y5pGUKg0SH3BAjEqaPt7eFaoZg/y1yltA9ej+jPH/4auE4nU0r\nBHUzl9vJ1A6ZH/PKjZccCGEa6Ly9LF/myUFODYCq+Aw9SXwJYRlB+Hd9pTfE\nw2Yz\r\n=XDbJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHR/TFkoF2XqqIxr38o9ljZZblY6EXaYL5jIT2UIJHfSAiEA04j7QMUGzVbxDLq9tcKvThv0y58KHNjz4dk+86dTfIs="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.26.0-canary.3b2452cc.0_1639008338997_0.45901667888740616"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.26.0-canary.cf7ba5a9.0":{"name":"@material/mwc-textfield","version":"0.26.0-canary.cf7ba5a9.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=14.0.0-canary.f460e23da.0","@material/line-ripple":"=14.0.0-canary.f460e23da.0","@material/mwc-base":"0.26.0-canary.cf7ba5a9.0","@material/mwc-floating-label":"0.26.0-canary.cf7ba5a9.0","@material/mwc-line-ripple":"0.26.0-canary.cf7ba5a9.0","@material/mwc-notched-outline":"0.26.0-canary.cf7ba5a9.0","@material/textfield":"=14.0.0-canary.f460e23da.0","lit":"^2.0.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.26.0-canary.cf7ba5a9.0","@material/notched-outline":"=14.0.0-canary.f460e23da.0","@material/ripple":"=14.0.0-canary.f460e23da.0","@material/shape":"=14.0.0-canary.f460e23da.0","@material/theme":"=14.0.0-canary.f460e23da.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"7e92aaee33b1c30269a52ec2c26232d0690d3d58","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7e92aaee33b1c30269a52ec2c26232d0690d3d58/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7e92aaee33b1c30269a52ec2c26232d0690d3d58/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7e92aaee33b1c30269a52ec2c26232d0690d3d58/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7e92aaee33b1c30269a52ec2c26232d0690d3d58/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7e92aaee33b1c30269a52ec2c26232d0690d3d58/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7e92aaee33b1c30269a52ec2c26232d0690d3d58/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7e92aaee33b1c30269a52ec2c26232d0690d3d58/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/7e92aaee33b1c30269a52ec2c26232d0690d3d58/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.26.0-canary.cf7ba5a9.0","_nodeVersion":"14.18.1","_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","dist":{"integrity":"sha512-06WdhqwRao7XCuYkXDyE1KnbYf9keOVLBvnQuDYIRbCUq0E1oigJzwyisGiuHVwAq2qkS3PsQyf/Z0cksVnE8A==","shasum":"8289581101b3bed59b51b9db0f0262f04893671e","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.26.0-canary.cf7ba5a9.0.tgz","fileCount":13,"unpackedSize":202261,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhs6VRCRA9TVsSAnZWagAAvX0P/j2ZmDbxCloSloJoxJh5\n2dtkjR57P726ZV63Wt6ZSbD3kc5TCCgQGBuoUlfvDYpt+gkIPrUq3bAPy+2W\nQIFhSpIHnslVt2eUu93yiuF3hA8Kxo4bbJhIAdjBfCfa8VWmahJRtIdTz4PK\nfJEjnbrp2VcOC+0E6Tq2FpaTUWRa2M4rvgQiDzwc1lw8ua9X0QFpLHbiHlf8\nHeKWqzU91sKBmIHinPl8Mk2sn4jcHx7D7Fc9Ok8Vx7p6infDZ9NswDK88ZkJ\nZ/YQ1zhdDW6ikJAUYAKWVvnyl0R0BQlXTOEYy0sBx6Ly5psUabFka7jeRKCE\nbiamGc5HA2cPDnVpXCNmHz/sJSgcG+WmIhEG1pjyc6+V1Xec2ZgMMssOCGn4\n54/A6SJL8y6aMyjQh9A/zV9fnlcUv+9KHE5ZIpeWob7vDPPNMVNPk3NLRKMl\nuzPVfvX78GbfdgLELZthA+/YYhiuhm5rmwHbVSo/16EeYCmwrEunEfWkGpKq\n40/bRV8eq6VWAangJCbTXYff5yJcaxObum/0BSlkxIWrJyGRFeAJ31qI/mXH\nt8MwpH8XLEizY7uP5C5W2g/lqP74GcK9QjmbTTtE6HDateXlrOT9fIYhOKOC\n2SwwCOGq2hnV50LCY77ePt1/1DrNRXOJwwvirFnlFTdcyfOaXlx6e7KdrZAe\nMU/v\r\n=KwXC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIET64GB/m6BNxhCMIlN4Q6LLbREkryvxIP9bUABA7xhlAiBUGJ0++O6BfwBGv9vPHmplHwWBsDIEI76iGyq/XWu1VA=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.26.0-canary.cf7ba5a9.0_1639163217019_0.5636679709983636"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.26.0-canary.e1bcf14e.0":{"name":"@material/mwc-textfield","version":"0.26.0-canary.e1bcf14e.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=14.0.0-canary.3366a71d7.0","@material/line-ripple":"=14.0.0-canary.3366a71d7.0","@material/mwc-base":"0.26.0-canary.e1bcf14e.0","@material/mwc-floating-label":"0.26.0-canary.e1bcf14e.0","@material/mwc-line-ripple":"0.26.0-canary.e1bcf14e.0","@material/mwc-notched-outline":"0.26.0-canary.e1bcf14e.0","@material/textfield":"=14.0.0-canary.3366a71d7.0","lit":"^2.0.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.26.0-canary.e1bcf14e.0","@material/notched-outline":"=14.0.0-canary.3366a71d7.0","@material/ripple":"=14.0.0-canary.3366a71d7.0","@material/shape":"=14.0.0-canary.3366a71d7.0","@material/theme":"=14.0.0-canary.3366a71d7.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"3cb6bc85426db9ac617c732735c808fd66cd1572","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3cb6bc85426db9ac617c732735c808fd66cd1572/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3cb6bc85426db9ac617c732735c808fd66cd1572/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3cb6bc85426db9ac617c732735c808fd66cd1572/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3cb6bc85426db9ac617c732735c808fd66cd1572/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3cb6bc85426db9ac617c732735c808fd66cd1572/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3cb6bc85426db9ac617c732735c808fd66cd1572/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3cb6bc85426db9ac617c732735c808fd66cd1572/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/3cb6bc85426db9ac617c732735c808fd66cd1572/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.26.0-canary.e1bcf14e.0","_nodeVersion":"14.18.2","_npmVersion":"lerna/3.22.1/node@v14.18.2+x64 (linux)","dist":{"integrity":"sha512-/Y6s1oDkLXkIfv7DoV86BlKb9x3sfsCBkvAmTUBDQaFTxe+GlnzjiHvJOxzy60uFCzVoow8m7WnmEH/6iYVQ/w==","shasum":"964fa7326b5623a8e960d70817b53aa5196f9f76","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.26.0-canary.e1bcf14e.0.tgz","fileCount":13,"unpackedSize":202261,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhy3dwCRA9TVsSAnZWagAAW1YQAJ1LNRQwbvqFcpDo/N8T\nxj5ObLPimpowT9hdZwK/Shn56I6CFWO6B9vcFsL1ESEkRDgOqX13qoCZtTAB\nDf7KqQs3vVFCbFYIh+NS2lGjAwzpoiW1Cm0DLuNx70ZEOmiZTJaJvBfVB/GV\nxqnEgo+7NmROn5du4MtFKPdp3RsgD8DnsiJipAJNSnj21xgW9zDnMR+GesAC\nPFGOkc9qxj5ZUpixROIYmz7nb5vzaopQ6jggif6+NyLrm2MmXDw+0/4IzpXH\nW5yy6QlVJ7aXf5Fn8F9YEwY3OSEiXlDQEFE3LXg4+ha1gH4wRM2gN9iTvsHd\nvIIn+cdNUbAkspQpBxZ8MriKRvaHwXg41mdy0AXoHACr7GuI40h1WAq5ssF3\nBVyuDCcEv2lM+VDrMFsyd7v/3nVxTsAVOYxastUG5NaAeb1uspe6EsPO+34t\ni+TdIzSQeDWzhqMRKGfyVRDhSiFGw414khSr+ZjYoxGsziv9RN7QG24a/Vvv\nbzfocicf+UpTPpTLcE0a9Vs5Nm9eWZ1N+StK/mVyaoWo+1Q2P7TkBpR4C5U8\nWsf7cRYX3k11D1EAdVfiOJZyXEzvcxQnW6m2Tei8a7g4yeFyJOVRJcm+bvp2\nGvKstfrUegOyBNRqWz5F+g8M2Mx8K6WOE9ywd4ofQf71frKCOv+K3mkFGqGM\nXhFh\r\n=pJap\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAYP+1ldj2I4WUJLaOlPmL2Rq4XZjKH/FE35e9m02OabAiBR+/0RlhGI69lXHfHxX1DmPwrxfNPVIq0bgs+sSZIXSw=="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.26.0-canary.e1bcf14e.0_1640724335883_0.5124201284959125"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.26.0-canary.b9d35b69.0":{"name":"@material/mwc-textfield","version":"0.26.0-canary.b9d35b69.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=14.0.0-canary.c047f7c19.0","@material/line-ripple":"=14.0.0-canary.c047f7c19.0","@material/mwc-base":"0.26.0-canary.b9d35b69.0","@material/mwc-floating-label":"0.26.0-canary.b9d35b69.0","@material/mwc-line-ripple":"0.26.0-canary.b9d35b69.0","@material/mwc-notched-outline":"0.26.0-canary.b9d35b69.0","@material/textfield":"=14.0.0-canary.c047f7c19.0","lit":"^2.0.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.26.0-canary.b9d35b69.0","@material/notched-outline":"=14.0.0-canary.c047f7c19.0","@material/ripple":"=14.0.0-canary.c047f7c19.0","@material/shape":"=14.0.0-canary.c047f7c19.0","@material/theme":"=14.0.0-canary.c047f7c19.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"8ee41fe865471367787d08d3f94d1800c5712d3b","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8ee41fe865471367787d08d3f94d1800c5712d3b/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8ee41fe865471367787d08d3f94d1800c5712d3b/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8ee41fe865471367787d08d3f94d1800c5712d3b/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8ee41fe865471367787d08d3f94d1800c5712d3b/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8ee41fe865471367787d08d3f94d1800c5712d3b/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8ee41fe865471367787d08d3f94d1800c5712d3b/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8ee41fe865471367787d08d3f94d1800c5712d3b/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/8ee41fe865471367787d08d3f94d1800c5712d3b/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.26.0-canary.b9d35b69.0","_nodeVersion":"14.18.2","_npmVersion":"lerna/3.22.1/node@v14.18.2+x64 (linux)","dist":{"integrity":"sha512-+UckAXak1x+PzAEMmSfx5HT8x46eQyw2xma25MtDA7T0WWazz30Q/zm+IcOcFdsJc1xUwYbmvdGsr2Ql+K63pQ==","shasum":"96886e29ebb0d3d1315e145603d22603d0df11b8","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.26.0-canary.b9d35b69.0.tgz","fileCount":13,"unpackedSize":202261,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh1eL2CRA9TVsSAnZWagAANlwP/1gTuvGgNQemKWUKNIHN\n/pJWB0RMUw1wP7GtkS8Mdr2DOQ48v3okpW/D/Vb8G+hNKYPkdU75dWG5mgji\nICXgQlwFi+F64jGw4JxBYLal27tnyNPGXGZFexJo6Y8D5vKAyzfcndlOy8I8\nw/Vc9T0mO5ejjJ7vRXUylZsTRMbE5aE7+Dzv2rXUTVhinrOq/FFXHpfgStg7\n293/WYS2FyW3Z0nCuu4n8wuH/Cjazz6SFMAW3siwJiorXazgOcu4il8/eJ3v\naa3XIWbnX0tuDRYESUWBT4ouoF70vmJ5xEfmoyUcPBfSYzaZjYGTZzJK+UZ2\nN+p4JDwhAz2AtuoQrxyqaE7YMqV9xPAmB3DzLrw+5egAlFhlcVB3vvJwRoZM\nx72ZbVLR9LM2dLfeubzlt0yamCR9POELleCtd5KconrVNz1g9oLXKY2RLUH8\n4abbBGoV/pvaILxqUBb0LAr+VEuemoJ4JFMdDhsYRZuHsOuBDbBjyntm1oAN\non0c+q3DeZpOBfR3roOGpD3tdZEHw4stVVhOGYtXN0GKczHwU98DEVwhZRSN\n4jWk6i6m6qfEOBo7NZTwCNS0heGJuOB7Nh1Pr2GhdpNf0Ou8nS+apkhT4zTj\nuYzGHs3WDGsc+2TwU3hzmvimbM8pEGpLxr/nZmSy1hG8rsiWqIOAh0j7FsVi\nn3Jz\r\n=6TDf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD6IegoaDvL36USiDymMXavTOpdU4xd4qCMlOncoKjGvQIhAN0SZygbGZTPpGHbfv5MOVTVoJQU4BHqh6gVF1OgaLRn"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.26.0-canary.b9d35b69.0_1641407222593_0.35048966845094576"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.26.0-canary.2afff08e.0":{"name":"@material/mwc-textfield","version":"0.26.0-canary.2afff08e.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=14.0.0-canary.05db65ec0.0","@material/line-ripple":"=14.0.0-canary.05db65ec0.0","@material/mwc-base":"0.26.0-canary.2afff08e.0","@material/mwc-floating-label":"0.26.0-canary.2afff08e.0","@material/mwc-line-ripple":"0.26.0-canary.2afff08e.0","@material/mwc-notched-outline":"0.26.0-canary.2afff08e.0","@material/textfield":"=14.0.0-canary.05db65ec0.0","lit":"^2.0.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.26.0-canary.2afff08e.0","@material/notched-outline":"=14.0.0-canary.05db65ec0.0","@material/ripple":"=14.0.0-canary.05db65ec0.0","@material/shape":"=14.0.0-canary.05db65ec0.0","@material/theme":"=14.0.0-canary.05db65ec0.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"9bada09943cf93e3b0b697ef81fb87cc7b781379","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9bada09943cf93e3b0b697ef81fb87cc7b781379/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9bada09943cf93e3b0b697ef81fb87cc7b781379/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9bada09943cf93e3b0b697ef81fb87cc7b781379/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9bada09943cf93e3b0b697ef81fb87cc7b781379/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9bada09943cf93e3b0b697ef81fb87cc7b781379/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9bada09943cf93e3b0b697ef81fb87cc7b781379/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9bada09943cf93e3b0b697ef81fb87cc7b781379/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/9bada09943cf93e3b0b697ef81fb87cc7b781379/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.26.0-canary.2afff08e.0","_nodeVersion":"14.18.2","_npmVersion":"lerna/3.22.1/node@v14.18.2+x64 (linux)","dist":{"integrity":"sha512-A+4f+e5xXhrWz/085OJmq2fdKM0UsfWGY5VMuPUePMk7co2DKNUvswBf5DL5DNQOMykvfUHUMcQNr63KLR8cPQ==","shasum":"0e02fb226b917b7dce81790c45f3ba8229dcafab","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.26.0-canary.2afff08e.0.tgz","fileCount":13,"unpackedSize":202261,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh12u7CRA9TVsSAnZWagAAtwYP/0/UrSKIm15ghAIHLccB\nITEm8G+mCj1geNF6FU+snYzxrRjDIDttjuRJkTi+p3w6yy9wX23/i1M0GqT9\niKmv2fUu+wtd3M5unMvPXVnL+rh/vmpCewN5+APs63wx6ksVt3hmgP4ZFbg3\nrMwKIfdaejXTCVxnHaETzNhNRnV5E8aEUwa1rvMU9yv8kWL2f4Z7rh2oK291\nhtxw1YCnUMq/wgcXQoGm5SNFIh0ZcYjkf78Rw8UAMjAQESfSyKvimFQY4Scq\nta5Ss09LxWSY3l4eErqgV61L2SqadgwVXBnnqI+KBLfYj0EG5yBe1avSZ083\njTJDyqCSA3I6sBre2FNf0EUb2/PKzOOAOOIaUSYo480ae5E/hLz3C/sg/Don\nQ14xCDtCivr2v78O8LZEDuE0dXbVfW8+LoZpBqHVYIWT2tKbxbG6CL7qPuXS\nWfbMMjCBksPvWO8FOfIetfZGE5D7C88dhONESzf/7eEyHLy/l86Ik3CoBxJj\nR+UUt6keZBO/92K2RuTn2Y1/Um7Gbva9yO3sU7epUL5p6slA/Att6a97lLDY\ny5UXuTanr+OVgvOAVpD+hMPhgclokfpeyLtyX71B3iFfy/6MEVG8P/BfQ6eS\n6LP+cAw6IfeVWmrnXm8WdjbXDZNwz1/zqnBcvdRHYMRZFWpV/EM8QVpsWYFD\nmLby\r\n=Lzuc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDu6SjQx1JSoUnT04JDiZkjpXQIU+sWBC+8MGpdd3KgAQIgAfMI5BbNzOXMeeG7MciSWLbPhBtgqd2/kHQ4IbmVIhA="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.26.0-canary.2afff08e.0_1641507771310_0.00017977252163015045"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.26.0-canary.893fc857.0":{"name":"@material/mwc-textfield","version":"0.26.0-canary.893fc857.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=14.0.0-canary.6ca8b8f85.0","@material/line-ripple":"=14.0.0-canary.6ca8b8f85.0","@material/mwc-base":"0.26.0-canary.893fc857.0","@material/mwc-floating-label":"0.26.0-canary.893fc857.0","@material/mwc-line-ripple":"0.26.0-canary.893fc857.0","@material/mwc-notched-outline":"0.26.0-canary.893fc857.0","@material/textfield":"=14.0.0-canary.6ca8b8f85.0","lit":"^2.0.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.26.0-canary.893fc857.0","@material/notched-outline":"=14.0.0-canary.6ca8b8f85.0","@material/ripple":"=14.0.0-canary.6ca8b8f85.0","@material/shape":"=14.0.0-canary.6ca8b8f85.0","@material/theme":"=14.0.0-canary.6ca8b8f85.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"6cbd6b098ea6e47fddfd2a5875df6d41262b532d","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6cbd6b098ea6e47fddfd2a5875df6d41262b532d/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6cbd6b098ea6e47fddfd2a5875df6d41262b532d/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6cbd6b098ea6e47fddfd2a5875df6d41262b532d/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6cbd6b098ea6e47fddfd2a5875df6d41262b532d/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6cbd6b098ea6e47fddfd2a5875df6d41262b532d/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6cbd6b098ea6e47fddfd2a5875df6d41262b532d/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6cbd6b098ea6e47fddfd2a5875df6d41262b532d/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6cbd6b098ea6e47fddfd2a5875df6d41262b532d/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.26.0-canary.893fc857.0","_nodeVersion":"14.18.2","_npmVersion":"lerna/3.22.1/node@v14.18.2+x64 (linux)","dist":{"integrity":"sha512-YQTT9DzyGiV/7Sv8/fypB1e0vJuE10FN8Yittc9/HhsF73xsnW3+WW+a/I6EHDy9Ptrnf/JTz3kqbRlmUyejOQ==","shasum":"8ef34bfb4f91a183e9e8f6f2d7e6964ef50acc91","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.26.0-canary.893fc857.0.tgz","fileCount":13,"unpackedSize":202261,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh2Iw3CRA9TVsSAnZWagAAjiAP/iBxfrVyu3o+efl/dFYq\nXgpv+LbFSu2LLax9wQBvkFXcQHHaqlPyp8vpiQC0kX806/FIW6CMj3icyTtP\ng5zraFT39TxmPHTPpVqaLo4WdONTwe2LDW8jnUmGbGMuGvT3k/+NBfoOqpEZ\n3eFSc1HsRFGXi0L1uCxhAh9Hp9iedxrK48F2cbHTLU6e5JlwwxEJlaD90y7n\nteLwiWNPcewApfyhZh+mLtN8ryHaBLpimgDe5KvrVPaHufRMTesiCEYcjNWD\n0Cz4V+x7vA3uzNVkvksJhzQWjziCeiSa3GVT0E7l5fvYhknytEy9Q+qreEgV\nspcdf4ngvZsZRc1PA3TZ/+VljSptsmFpeCxiwKH5MAR2AZH+vvHflLeZEaql\nYBR1Q47EgHDC21KbECXpmLZNedjy3XS0RPuiMd/WXBXd0zTJj3OLFWcf3UzP\nqf+JeYCFPSduij2WsrMed8nZjMVt8u/0ByUjmikvCcx3YUii4bp3vHqptKHZ\nKoxQlOHDg+Rqj8PK9jA0FJHJ07nGIbSkj5j/05i96bPSOO5J24YravUs2yNx\nxAz/TH4QuiPvwnqH1tiajdZjLkyC+4mfBfp3L0MUe3wzBNtbp6lTJKnpetGt\nz1vZvsMmamjVEg1G9cKSD/RlaVcKpDWCb9LS6r2GcQ6I3Fnd6E5w9i3WQtd1\nuvfR\r\n=2ok4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDxBDaCX5N+OwnrtRJj3rTl/K+MHI5m79OhVKChqebtBwIhALpYVFkWvJi/FTmVyUFFxg8wpO9uPTbAxIGNDM8WPXo1"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.26.0-canary.893fc857.0_1641581622875_0.3176973703103183"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.26.0-canary.69ba13b7.0":{"name":"@material/mwc-textfield","version":"0.26.0-canary.69ba13b7.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=14.0.0-canary.c14e977ee.0","@material/line-ripple":"=14.0.0-canary.c14e977ee.0","@material/mwc-base":"0.26.0-canary.69ba13b7.0","@material/mwc-floating-label":"0.26.0-canary.69ba13b7.0","@material/mwc-line-ripple":"0.26.0-canary.69ba13b7.0","@material/mwc-notched-outline":"0.26.0-canary.69ba13b7.0","@material/textfield":"=14.0.0-canary.c14e977ee.0","lit":"^2.0.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.26.0-canary.69ba13b7.0","@material/notched-outline":"=14.0.0-canary.c14e977ee.0","@material/ripple":"=14.0.0-canary.c14e977ee.0","@material/shape":"=14.0.0-canary.c14e977ee.0","@material/theme":"=14.0.0-canary.c14e977ee.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"776b813e379c8d90abf2a0ded57168c12f62adff","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/776b813e379c8d90abf2a0ded57168c12f62adff/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/776b813e379c8d90abf2a0ded57168c12f62adff/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/776b813e379c8d90abf2a0ded57168c12f62adff/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/776b813e379c8d90abf2a0ded57168c12f62adff/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/776b813e379c8d90abf2a0ded57168c12f62adff/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/776b813e379c8d90abf2a0ded57168c12f62adff/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/776b813e379c8d90abf2a0ded57168c12f62adff/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/776b813e379c8d90abf2a0ded57168c12f62adff/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.26.0-canary.69ba13b7.0","_nodeVersion":"14.18.3","_npmVersion":"lerna/3.22.1/node@v14.18.3+x64 (linux)","dist":{"integrity":"sha512-Swb6lgBmDdr+4URLVdvC6ivIXW2Vcw4bdrcQn4a3jkNG3A1pA9EU4JaVzYc9SckVnodqwgtBFEJiIaHfXDoX4g==","shasum":"d5905f842fd0fc2afc545f60cce80b0e15a4dbe7","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.26.0-canary.69ba13b7.0.tgz","fileCount":13,"unpackedSize":202401,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh6I9xCRA9TVsSAnZWagAALiMP/1noqi8Q7ebNDXNrR2Ho\ntp6sPNRZeGvw4r/B7hQTFvvsRcLLDM6AyEYO5ugecKWUKX7azYmSV6yWhAf/\nxw8IQM1pjKl3gWghyvNr+BJKHzXUIo26Kh0SEktoFzbChLC2hNTuGeCFDYhi\nlM9wmlQCWUW7Ri9m7Jdx0v4NpI7zTUyTEyJaoC656iw5gxXPjG2CaQ1yKC4e\nkR506ea5PN/sxIJXSILFp0TjUV24RKezt2OOeSd2ceyB1pAFYSPaaL23azjO\nX73zng18t3Tx9RqPICy8TVXH97iR4mgj8zPT2qRbf7H/J+fW8RXiGD9QtYjP\nFB5ZbCFWR4feBLdn49sfAuLfzNcIiqBVBjVUXVSHmhOYck4HQB5lUZ0Fo7yX\nT+ASdp5RZTB3EhbG5ESXvzlMtZHX9lgUCjX3ELxAGCBO1ZlD6Mc+wiWE3PaK\nOIpGxYEgKfl75v+gFm/0Haph1YKxb9+qdNsGxVOuHQplXLIqvdYdSCkRhMau\nmPe51mQcEB3WOF+reZAoIt8mNfP/Ig3J0YVVnho9GW2mjuRkGS2MSJ/kOunb\nm8fJWHN+KxcWLcr5x6jRcU4iHX+BZCLTxwuJpy93LjX82nodkw4ql0xrKbN0\nob5PukGVPviiUNHi0Gm0Lh+ZWp37r7q6Xozb1LagoRfmUI4LY+0dg3WJNRdQ\nCrBI\r\n=+4Lp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDzA8BVvrqWSfPoAfPJTdFrTEBWKTo5koiz9wTzfLynrwIgALjKfyD8hjySc0HPJ7nSj8dIpGpF+lEhIzps8RSqQbk="}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.26.0-canary.69ba13b7.0_1642631024939_0.6800824238363965"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.26.0-canary.0af8ade5.0":{"name":"@material/mwc-textfield","version":"0.26.0-canary.0af8ade5.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=14.0.0-canary.c14e977ee.0","@material/line-ripple":"=14.0.0-canary.c14e977ee.0","@material/mwc-base":"0.26.0-canary.0af8ade5.0","@material/mwc-floating-label":"0.26.0-canary.0af8ade5.0","@material/mwc-line-ripple":"0.26.0-canary.0af8ade5.0","@material/mwc-notched-outline":"0.26.0-canary.0af8ade5.0","@material/textfield":"=14.0.0-canary.c14e977ee.0","lit":"^2.0.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"0.26.0-canary.0af8ade5.0","@material/notched-outline":"=14.0.0-canary.c14e977ee.0","@material/ripple":"=14.0.0-canary.c14e977ee.0","@material/shape":"=14.0.0-canary.c14e977ee.0","@material/theme":"=14.0.0-canary.c14e977ee.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"64bb121cb77aee6a854395ad838fce32a6051337","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/64bb121cb77aee6a854395ad838fce32a6051337/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/64bb121cb77aee6a854395ad838fce32a6051337/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/64bb121cb77aee6a854395ad838fce32a6051337/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield';\n  import '@material/mwc-icon/mwc-icon-font';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/64bb121cb77aee6a854395ad838fce32a6051337/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/64bb121cb77aee6a854395ad838fce32a6051337/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/64bb121cb77aee6a854395ad838fce32a6051337/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/64bb121cb77aee6a854395ad838fce32a6051337/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/64bb121cb77aee6a854395ad838fce32a6051337/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.26.0-canary.0af8ade5.0","_nodeVersion":"14.18.3","_npmVersion":"lerna/3.22.1/node@v14.18.3+x64 (linux)","dist":{"integrity":"sha512-9Hv22gmykq1FKAnJcKBMkcuRUBGcHCFAbKtwMle7Dfcq2igsvH+ArJZtb7DrGrKQDF+2p1smy369k3d5knlWEw==","shasum":"c8e3daa07bcdf0b19acc0e5701840b2567f1c50f","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.26.0-canary.0af8ade5.0.tgz","fileCount":13,"unpackedSize":202401,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiAZePCRA9TVsSAnZWagAAu2cP/jAz6NwKDNfYVCfmJ2zw\nbeI3UqkHS8usIR6IKR7eaKgOwbScnzprn/KPVM9OKs8fgdktjlD61iZiGvlf\ndsXL+8Px45QqIfEoQJNj6fYT6IbTa1uWHW9IItNOluwPM455k/mqk+EtqByh\nwmTct/r4s6ksTo8LpO8d96kYdRmIAGlneNRAvakg4n/s4YOTB3Jgwe0/FD8V\nrEkc3d1n16ww284R9ekxO7xQztm04npNRhv88FrEiNvQhqZaPRLoyL40MuJz\n17PKatfvdOevaKa/r8jW+lvoiwKwFXS4VSeQm5oLS7DBtALtUz/6aVaUgpWb\nNjdEKh4h9zganQAAs2dQPoNPR1dUSlqAGwrzVAXPOcXRP1wm7b75AUJt5Mfh\nQvCtl9SdTDXwdMbDm2iU9eHhFDL9kPDx4UDtt1yX2S6fpTDpHkpT+duzQknW\n3eWBeT/0jZT1HrxfsJ3PQjsCBWSw0vFbrAcrGsrI3iOCopT3Lin46d/6nWJb\n7p0KunLEehdgcL8twOPY0bF7O8HYWx/qSxOTOytIfE0G0ROhQ7UPs6KdN3eu\nuqKQ2rT1Yf960pOjJjrCeJFMmF5uk2nL6+El0u/3CotIhW7fy86sotIYtJRc\nkYJgWH1UKuoL2fKdHonTYear04D3hE1WRJEvSBvEuPF2lULf2Am3IRM0HKGo\nG1Sh\r\n=ls6f\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCn1zcSaHzumwE4pUscOooNuTC3WzzTIVZMw8tuTzcwNQIhAKegpQCwjLSJovMC17kViVB5ZBMl/ftjVOwEY9QX7pSt"}]},"_npmUser":{"name":"material-admin","email":"aprigogin+npm@google.com"},"directories":{},"maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.26.0-canary.0af8ade5.0_1644271503775_0.9923735702044316"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.26.0":{"name":"@material/mwc-textfield","version":"0.26.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=14.0.0","@material/line-ripple":"=14.0.0","@material/mwc-base":"^0.26.0","@material/mwc-floating-label":"^0.26.0","@material/mwc-line-ripple":"^0.26.0","@material/mwc-notched-outline":"^0.26.0","@material/textfield":"=14.0.0","lit":"^2.0.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"^0.26.0","@material/notched-outline":"=14.0.0","@material/ripple":"=14.0.0","@material/shape":"=14.0.0","@material/theme":"=14.0.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"056b3ceffbe2fe3408dbdbb319932da85637e779","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.26.0","_nodeVersion":"16.14.2","_npmVersion":"lerna/3.22.1/node@v16.14.2+x64 (darwin)","dist":{"integrity":"sha512-EdkFKh2OIpxLsYvtYj2G3W22j2DjcV5PAdcMzJSirTzfKp/x+w1mXMFK+EFcMY/GksYXf5sOkFogc5XnXWGx9A==","shasum":"115803f1aa338741e88c65f9b2a19e5023fb6112","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.26.0.tgz","fileCount":13,"unpackedSize":202185,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCQXGdyA4lHDIKV+nMvaYsrmKL3z6H7XyeSRWVBL1K4SwIgDrxraiL+qWkecOM7sP/ZM3rlPNELgFfH/gKvIkj30qM="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJicWa5ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmobfA/+JSCRYuiCWjt+OqcbM+EzuslO48JTm7Mc/iH3/yqUiZHe3qjT\r\ngUzLF8g5SicaeCS1TvrPoJg5IZhljEXWgtQfrnS8sASGysrD0jmnKeglBO+K\r\nXTK4Y8L5sXnzPMGPYN8/IapU0QNm/4GhELeM2jSktrL8Q69N4EQ/i033UQRc\r\nqvJ3x4I0NUUsJO06zI6/ZjcY+sTp/qhRZydgh5zp+fZS4zP7iJcdfP2ofFtg\r\noRn90svu07CFnZDDW5HZO8d5Xqp1bG8Bj9GsAd2erG5c2EnfLiwgyKtdCgAN\r\n+IbgtVVKdBogdqHfECN2PWqzDOUSurMKt147DIh5EMM+15fw6H1kO9v/j1MO\r\nDnqqomOcrglyatsEDkAXi5lzebitXxsM2sWmGxU0Zx6fz+hinZIUBJHSm31L\r\nFyIL2uARn6otPKANuYL9cQzrK0qUFbrvjVUCAU3Y86eqLby6DZgFx7QrGjR4\r\n/fJxnIZzH3thSsD22rm+CMKhAHPod6QA49tg3fb6uMUtReN3PM0HkJVHyePj\r\nBrJ+vrQc+EdAy2fpKPlj3ggtHx57RzWl4vKKVsqsAZ5FMpFgGdd8gXUpRE7f\r\nffMTVOw0f3Jbgm52wZBk2MjasK7Jjqrq+jfbWGMxAi01qnZAvK73ACrbn6PK\r\nH7mxQfWA+ubqTjlkEgyuWomCAQYQTuXlXzs=\r\n=Uebr\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"asyncliz","email":"asyncliz@gmail.com"},"directories":{},"maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.26.0_1651599033438_0.3734553428324012"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.26.1":{"name":"@material/mwc-textfield","version":"0.26.1","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=14.0.0-canary.53b3cad2f.0","@material/line-ripple":"=14.0.0-canary.53b3cad2f.0","@material/mwc-base":"^0.26.1","@material/mwc-floating-label":"^0.26.1","@material/mwc-line-ripple":"^0.26.1","@material/mwc-notched-outline":"^0.26.1","@material/textfield":"=14.0.0-canary.53b3cad2f.0","lit":"^2.0.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"^0.26.1","@material/notched-outline":"=14.0.0-canary.53b3cad2f.0","@material/ripple":"=14.0.0-canary.53b3cad2f.0","@material/shape":"=14.0.0-canary.53b3cad2f.0","@material/theme":"=14.0.0-canary.53b3cad2f.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"06b516b7f91867acd0cbe5676767aea8f490cbee","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.26.1","_nodeVersion":"16.14.2","_npmVersion":"lerna/3.22.1/node@v16.14.2+x64 (darwin)","dist":{"integrity":"sha512-Kdb31R2PROUOM7hpyjb+pY4WIOu6BQSEQKeVy4hnLqwvhe14nTvnn9I7Fkkz4t9SNWPh3G+DQsAx9vhPuCgUyQ==","shasum":"06878a52ee49ccfe4d368741eabded541d08abc8","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.26.1.tgz","fileCount":13,"unpackedSize":202740,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC2OeCLjHrVJUv/mebxunTN0mwFMIM7ocZS15ssoqL2EwIhAN0B9J+9ef2Zj8smru22fQFwpyn7BXqhuraocEGylphW"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJieXo3ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpZAw/+MVSMWUwEY7L4Oze/z36sYe/EPS2u+K5Ud31LSeDNhRM/BSpQ\r\nAnNv6Hwu5e+/YHSj0ZanCjToyoa+j65G9hcYl34O82BPYS33JJEKIbQoBwcz\r\niubH1plscO/hUFgIvP68KBNJf1DAiUW9vQk1zJzGqg438Kb+tSew1d0cg/II\r\ndanoHhPEavBa5wfggDmtmEsNxTzHc61zChyZ/vwkBZwJVK5HonWJNlYiPSsB\r\noBz/4IoNnybJyhXmgHujxJzzF5Ml3+HJwcqQ6jSDGKMQKlnxZIx/i0EtQK3x\r\nA5sMFyA8u11GxR599C/PAQIPCTXV7YY74tBOooeE/cQrgAe9rsaLuTvQSbKE\r\nyDgCHk4YxEpz0KAAManwj7GJEq8hlSnnHs1a7tPYnDiR4zwrw6fcfEvpDmOF\r\nHSHJckrQ4XoQePV3A21D8Zxuw5wCfRam4hNuLx8A2uyQGk3Og5QgACZoSyjM\r\niA3RUpxB/UOhxVAqeSrYIfqAv4FTQPDYlTw2wv5bXrDDuwfw7K0moM4QnpF9\r\nOjiDkzUZlXRKcX5QCrZKdROB5RUKQ2UhYHY/49ew8iwaFkU8k+8T+oOnWQI9\r\nq/X0O9/Kjc6he40RjqSlB2RwQBoncLkxO68uXgeSbGnfcY3UEulO4fxYHVrM\r\nADVPfXwU75Dfe4weUrrv++hiWGU7qQZNW5U=\r\n=pV0L\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"asyncliz","email":"asyncliz@gmail.com"},"directories":{},"maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.26.1_1652128310876_0.12465556171782222"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"},"0.27.0":{"name":"@material/mwc-textfield","version":"0.27.0","description":"Material Design textfield web component","keywords":["material design","web components","textfield"],"main":"mwc-textfield.js","module":"mwc-textfield.js","repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"license":"Apache-2.0","dependencies":{"@material/floating-label":"=14.0.0-canary.53b3cad2f.0","@material/line-ripple":"=14.0.0-canary.53b3cad2f.0","@material/mwc-base":"^0.27.0","@material/mwc-floating-label":"^0.27.0","@material/mwc-line-ripple":"^0.27.0","@material/mwc-notched-outline":"^0.27.0","@material/textfield":"=14.0.0-canary.53b3cad2f.0","lit":"^2.0.0","tslib":"^2.0.1"},"devDependencies":{"@material/mwc-icon":"^0.27.0","@material/notched-outline":"=14.0.0-canary.53b3cad2f.0","@material/ripple":"=14.0.0-canary.53b3cad2f.0","@material/shape":"=14.0.0-canary.53b3cad2f.0","@material/theme":"=14.0.0-canary.53b3cad2f.0"},"scripts":{"build:style":"node ../../scripts/sass-to-lit-css/index.js mwc-textfield.scss"},"publishConfig":{"access":"public"},"gitHead":"c1e876a15bc028034781984538ea803ba67dbed3","bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"},"homepage":"https://github.com/material-components/material-components-web-components#readme","_id":"@material/mwc-textfield@0.27.0","_nodeVersion":"18.6.0","_npmVersion":"lerna/3.22.1/node@v18.6.0+arm64 (darwin)","dist":{"integrity":"sha512-4/OEeEVAWWQ1DzpjeMLYLsa9HMlifOPjAvi0681Yj1g/RYJs5ONZS80HZ8HOT+efAOlZDugshgM4gdNS3I0XFQ==","shasum":"07cdc6ec6b30ce5cb357a5381530689720c082ee","tarball":"https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.27.0.tgz","fileCount":13,"unpackedSize":202740,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBwSsJEbquVvFBLe/yQUzTQaxO+bwBUHsbberGkHvpDOAiEAtObg2Px+pGaZ8TaMJPqB4uVyqLWGsLZUdt65VG8/2nY="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi9qYIACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr/Fg//fVOPr5bwD7utVZeN62lOcUTeuixf4e5pERdZmREDcjYBuWG6\r\nyekHYrBUEZ70NLvxtVV22ZpF6sq1bNKvnZPPsUy08QCORsqN87GGbe/xGJD2\r\ne6Y0Yr08igeMemdjrfxDiXi2Eq9thX5gCVDNrPnHug7Hkvh4NGSUNPDO2WET\r\n4yG4XVDc0/XDdk3UWAQ8i9Ue+U05hhOujbIoTija54rgVwobg9U7PoA6z88Q\r\n1f0g7ttwkiqFzX/TPHsNSJ62xK3qA+infAKwEwki7TM0+QPqFwerULfmQ+/0\r\nIvbIveUjT6l2CO1q+Ma5exj4AnwNjNt550GFE4UsamuAufnR15GJ7dqQ6Emn\r\n8M4SWFnZkTw+J5BkmlVZLQhZkVz5d/IM+mFYpqbv6YZi683S3yVQvLuzm1q9\r\n2FDJq1QwgmNUfxPU2YmkmDRxvIvNw8OdyT1u3D7H5Az2jcLunoRMKGqw+YTI\r\nOrz9LTIUN82VDowmtoLG5l2WV0HYumrM4vd7aqK3NhskUk5i5x1BZpe/xTzS\r\nWtBSG9e0TN+4OVYmA+hfUtZdes0FYJilS1l1q2jN85E8dRXqsMP2k9L8f8R9\r\n/IzrYA4ewmYciqSanys48hOXM9a3vTzFWPaBZgFdidDU1FlzKtNKcsBQWiUS\r\nEiaJYjPJFAzM6jAGl5AfZlHsMz8xNj9x2Ks=\r\n=oWjz\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"emarquez","email":"emarquez@google.com"},"directories":{},"maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mwc-textfield_0.27.0_1660331528185_0.5014965600384731"},"_hasShrinkwrap":false,"deprecated":"MWC beta is longer supported. Please upgrade to @material/web"}},"time":{"created":"2019-08-27T21:23:52.390Z","0.7.0":"2019-08-27T21:23:52.738Z","modified":"2024-04-04T18:59:37.307Z","0.7.1":"2019-08-28T02:54:31.424Z","0.8.0":"2019-09-04T00:04:36.791Z","0.9.0":"2019-09-27T01:36:20.356Z","0.9.1":"2019-09-30T21:05:00.246Z","0.10.0":"2019-10-11T23:28:23.563Z","0.11.0":"2019-11-26T21:49:35.299Z","0.11.1":"2019-11-27T00:26:38.606Z","0.12.0":"2019-12-17T23:47:54.519Z","0.13.0":"2020-02-04T04:46:36.381Z","0.14.0-canary.f790f713.0":"2020-02-28T02:28:19.422Z","0.14.0-canary.c759cfbc.0":"2020-02-29T00:04:56.689Z","0.14.0-canary.97ef53d8.0":"2020-02-29T00:18:22.225Z","0.14.0-canary.24f5fa6e.0":"2020-02-29T01:08:44.941Z","0.14.0-canary.960e214f.0":"2020-02-29T03:09:06.173Z","0.14.0-canary.a2f046f5.0":"2020-03-03T00:56:41.489Z","0.14.0-canary.024f371a.0":"2020-03-03T01:28:57.800Z","0.14.0-canary.2f164110.0":"2020-03-03T21:33:50.099Z","0.14.0-canary.edd465cd.0":"2020-03-04T00:10:45.909Z","0.14.0-canary.2b02d017.0":"2020-03-04T20:19:12.407Z","0.14.0-canary.cbdfe453.0":"2020-03-04T21:44:48.486Z","0.14.0-canary.02aa8a98.0":"2020-03-06T22:53:26.418Z","0.14.0-canary.7cd5aad6.0":"2020-03-09T23:20:11.801Z","0.14.0-canary.3a79dfa6.0":"2020-03-10T02:56:18.058Z","0.14.0-canary.22e0f5c9.0":"2020-03-10T03:00:15.345Z","0.14.0-canary.f23a1d1b.0":"2020-03-10T20:56:33.830Z","0.14.0-canary.34b2d69a.0":"2020-03-10T21:14:49.760Z","0.14.0-canary.dc04abe1.0":"2020-03-10T22:02:18.336Z","0.14.0-canary.04ccbc88.0":"2020-03-11T00:34:57.887Z","0.14.0-canary.55338c25.0":"2020-03-11T06:31:29.678Z","0.14.0-canary.b7e388f3.0":"2020-03-11T20:19:47.190Z","0.14.0-canary.b3211481.0":"2020-03-11T20:23:57.909Z","0.14.0-canary.0b5c7f23.0":"2020-03-11T21:53:53.807Z","0.14.0-canary.6c0f0b27.0":"2020-03-12T21:17:12.436Z","0.14.0-canary.b6c53425.0":"2020-03-13T16:55:22.743Z","0.14.0-canary.306cabed.0":"2020-03-17T21:17:43.826Z","0.14.0-canary.4e250cbc.0":"2020-03-17T21:24:05.064Z","0.14.0-canary.ff82d9ec.0":"2020-03-18T18:19:40.585Z","0.14.0-canary.f50f48ef.0":"2020-03-19T18:55:21.492Z","0.14.0-canary.134cf877.0":"2020-03-19T20:39:17.098Z","0.14.0":"2020-03-19T21:28:37.084Z","0.15.0-canary.2c1a4913.0":"2020-03-19T23:00:54.534Z","0.15.0-canary.3a6e481a.0":"2020-03-20T18:13:11.101Z","0.15.0-canary.603d6eb3.0":"2020-03-20T21:35:51.814Z","0.15.0-canary.05c6a93c.0":"2020-03-23T16:36:29.237Z","0.14.1":"2020-03-23T17:57:40.332Z","0.15.0-canary.4e6be3f4.0":"2020-03-24T20:58:49.039Z","0.15.0-canary.c29a683d.0":"2020-03-24T21:16:35.131Z","0.15.0-canary.fca3dd9d.0":"2020-03-24T23:43:06.832Z","0.15.0-canary.1e73da49.0":"2020-03-25T21:29:55.014Z","0.15.0-canary.bb6dfc5a.0":"2020-03-27T01:23:01.026Z","0.15.0-canary.1884603d.0":"2020-03-27T19:55:23.534Z","0.15.0-canary.aff73cab.0":"2020-03-27T21:14:18.952Z","0.15.0-canary.63168f61.0":"2020-03-31T18:12:26.735Z","0.15.0-canary.9fb79b3e.0":"2020-03-31T21:20:12.448Z","0.15.0-canary.9bd3e9e2.0":"2020-04-01T00:16:17.636Z","0.15.0-canary.072084ab.0":"2020-04-01T18:39:44.414Z","0.15.0-canary.4dec04af.0":"2020-04-03T20:29:40.321Z","0.15.0-canary.9b676354.0":"2020-04-03T20:29:58.611Z","0.15.0-canary.6b946095.0":"2020-04-03T21:24:21.365Z","0.15.0-canary.5ccbfaa2.0":"2020-04-03T21:29:53.466Z","0.15.0-canary.a0ab8772.0":"2020-04-07T20:09:03.445Z","0.15.0-canary.8d352305.0":"2020-04-07T21:41:57.820Z","0.15.0-canary.31eac79f.0":"2020-04-07T21:57:25.190Z","0.15.0-canary.ba05565e.0":"2020-04-08T17:32:29.143Z","0.15.0-canary.25099f79.0":"2020-04-08T21:30:40.369Z","0.15.0-canary.447e31c6.0":"2020-04-09T01:16:29.586Z","0.15.0-canary.d6dd84f7.0":"2020-04-09T01:25:06.666Z","0.15.0-canary.9b03ee68.0":"2020-04-09T20:02:49.759Z","0.15.0-canary.bbc25b10.0":"2020-04-10T22:45:32.266Z","0.15.0-canary.339cbfd4.0":"2020-04-15T17:38:40.406Z","0.15.0-canary.b74ff19f.0":"2020-04-15T20:04:32.720Z","0.15.0-canary.aaa16853.0":"2020-04-15T22:41:00.014Z","0.15.0-canary.826b23e7.0":"2020-04-16T18:56:59.004Z","0.15.0-canary.e1ad2b2f.0":"2020-04-17T23:01:24.186Z","0.15.0-canary.bade5580.0":"2020-04-17T23:19:13.663Z","0.15.0-canary.dae38247.0":"2020-04-18T00:16:09.554Z","0.15.0-canary.a04c0b82.0":"2020-04-18T00:34:17.781Z","0.15.0-canary.715decfe.0":"2020-04-20T18:35:15.487Z","0.15.0-canary.c862cd04.0":"2020-04-20T21:34:20.939Z","0.15.0-canary.e9b01b35.0":"2020-04-20T23:29:25.448Z","0.15.0-canary.ee7e8989.0":"2020-04-21T00:51:18.272Z","0.15.0-canary.9bf47ffa.0":"2020-04-21T18:37:53.598Z","0.15.0-canary.078dbd98.0":"2020-04-21T21:12:14.145Z","0.15.0-canary.953015d6.0":"2020-04-21T21:35:35.194Z","0.15.0-canary.c360ec63.0":"2020-04-21T21:59:09.575Z","0.15.0-canary.d71b65aa.0":"2020-04-21T22:37:40.317Z","0.15.0-canary.58d51135.0":"2020-04-23T00:44:53.208Z","0.15.0-canary.d0af8ba3.0":"2020-04-23T18:10:10.794Z","0.15.0-canary.8872b17b.0":"2020-04-23T20:40:59.213Z","0.15.0-canary.eca1a610.0":"2020-04-23T21:42:58.702Z","0.15.0-canary.baaf529e.0":"2020-04-23T22:44:13.713Z","0.15.0-canary.7a7992a8.0":"2020-04-23T23:14:09.062Z","0.15.0-canary.1150d64d.0":"2020-04-24T00:18:37.654Z","0.15.0-canary.dad3f828.0":"2020-04-25T00:42:44.930Z","0.15.0-canary.1bcdb47e.0":"2020-04-28T01:12:53.314Z","0.15.0-canary.86ff1b9f.0":"2020-04-28T02:55:43.197Z","0.15.0-canary.54a86b20.0":"2020-04-28T03:18:00.469Z","0.15.0-canary.938fd24b.0":"2020-04-30T01:27:11.097Z","0.15.0-canary.39e9a008.0":"2020-04-30T02:13:40.728Z","0.15.0-canary.f3b365de.0":"2020-04-30T08:27:12.152Z","0.15.0-canary.cdbdf807.0":"2020-05-01T00:14:43.539Z","0.15.0-canary.9995ae17.0":"2020-05-01T18:45:17.050Z","0.15.0-canary.457bf035.0":"2020-05-01T20:50:49.925Z","0.15.0-canary.2381fd02.0":"2020-05-01T21:25:29.049Z","0.15.0-canary.b2ca9b57.0":"2020-05-01T21:36:20.539Z","0.15.0-canary.b2b088e7.0":"2020-05-01T22:33:36.856Z","0.15.0-canary.fdd8f69e.0":"2020-05-02T00:16:29.612Z","0.15.0-canary.730f45a8.0":"2020-05-03T20:44:50.921Z","0.15.0-canary.4219bd20.0":"2020-05-04T23:31:58.466Z","0.15.0-canary.1d83cf6d.0":"2020-05-05T17:12:05.240Z","0.15.0-canary.3bfc63aa.0":"2020-05-05T18:13:44.066Z","0.15.0":"2020-05-05T22:36:12.320Z","0.16.0-canary.1f4e3d1c.0":"2020-05-06T22:04:28.637Z","0.16.0-canary.bc8759d5.0":"2020-05-07T23:14:42.387Z","0.16.0-canary.d1379acf.0":"2020-05-08T17:41:25.395Z","0.16.0-canary.58d51fc0.0":"2020-05-08T19:17:30.805Z","0.16.0-canary.588062d7.0":"2020-05-08T21:23:43.276Z","0.16.0-canary.fa21f639.0":"2020-05-11T17:29:59.740Z","0.16.0-canary.2772c509.0":"2020-05-11T18:36:35.879Z","0.16.0-canary.fc4796d5.0":"2020-05-11T20:05:06.135Z","0.16.0-canary.0d1c5f2c.0":"2020-05-11T21:19:47.352Z","0.16.0-canary.d083d93a.0":"2020-05-12T00:18:16.351Z","0.16.0-canary.c95d429c.0":"2020-05-12T21:36:53.420Z","0.16.0-canary.0c1ad726.0":"2020-05-13T00:34:11.289Z","0.16.0-canary.8b6a4700.0":"2020-05-13T17:19:20.118Z","0.16.0-canary.3270effb.0":"2020-05-13T21:24:35.221Z","0.16.0-canary.832e64f7.0":"2020-05-14T00:52:07.954Z","0.16.0-canary.472fc4fc.0":"2020-05-14T03:36:19.401Z","0.16.0-canary.4dcd7dd5.0":"2020-05-14T16:24:43.886Z","0.16.0-canary.bcd3400d.0":"2020-05-15T22:49:48.524Z","0.16.0-canary.91f63179.0":"2020-05-16T00:34:29.444Z","0.16.0-canary.b8aafb56.0":"2020-05-18T18:31:34.829Z","0.16.0-canary.a564b194.0":"2020-05-18T23:03:31.203Z","0.16.0-canary.ef56465b.0":"2020-05-19T03:48:04.494Z","0.16.0-canary.c22dcd71.0":"2020-05-19T17:24:14.771Z","0.16.0-canary.6eb62388.0":"2020-05-19T20:38:21.920Z","0.16.0-canary.9bc3230c.0":"2020-05-19T21:38:32.855Z","0.16.0-canary.421a6856.0":"2020-05-20T05:24:13.541Z","0.16.0-canary.761aa6f2.0":"2020-05-20T21:30:48.675Z","0.16.0-canary.f8654c40.0":"2020-05-20T21:40:20.624Z","0.16.0-canary.05f3853e.0":"2020-05-21T17:33:15.946Z","0.16.0-canary.5fe61f4e.0":"2020-05-21T23:07:31.860Z","0.16.0-canary.17d33745.0":"2020-05-26T16:13:44.464Z","0.16.0-canary.e8b52f5b.0":"2020-05-26T18:42:39.519Z","0.16.0-canary.09afa0a9.0":"2020-05-26T21:44:01.235Z","0.16.0-canary.58bc9166.0":"2020-05-27T00:30:14.374Z","0.16.0-canary.43bde144.0":"2020-05-27T18:29:11.589Z","0.16.0-canary.51067bbc.0":"2020-05-27T20:03:09.919Z","0.16.0-canary.92751ffa.0":"2020-05-27T21:36:28.147Z","0.16.0-canary.aa2b40bb.0":"2020-05-28T19:14:56.369Z","0.16.0-canary.1a870a01.0":"2020-05-28T21:18:35.563Z","0.16.0-canary.ad57d086.0":"2020-05-29T23:49:08.031Z","0.16.0-canary.3bf2b4d5.0":"2020-05-30T00:36:36.903Z","0.16.0-canary.ac05f090.0":"2020-05-30T02:49:44.437Z","0.16.0-canary.0ba7b095.0":"2020-05-30T02:56:28.335Z","0.16.0-canary.5eaa9bac.0":"2020-06-01T23:28:42.785Z","0.16.0-canary.5677ac20.0":"2020-06-01T23:57:03.341Z","0.16.0-canary.7ac6bff4.0":"2020-06-02T00:15:35.947Z","0.16.0-canary.d45622aa.0":"2020-06-02T23:45:44.371Z","0.16.0-canary.dc26c709.0":"2020-06-05T20:20:58.845Z","0.16.0-canary.b9baf6db.0":"2020-06-05T20:22:19.936Z","0.16.0-canary.e0b8c9d0.0":"2020-06-05T23:04:38.492Z","0.16.0-canary.51552859.0":"2020-06-10T00:07:58.395Z","0.16.0-canary.2e269285.0":"2020-06-10T01:35:40.465Z","0.16.0-canary.be138b01.0":"2020-06-10T20:49:01.260Z","0.16.0-canary.04bccf5a.0":"2020-06-16T00:58:55.686Z","0.16.0-canary.b44dea36.0":"2020-06-16T20:57:39.388Z","0.16.0-canary.e2577e87.0":"2020-06-16T21:08:35.395Z","0.16.0-canary.58b73343.0":"2020-06-16T21:23:37.481Z","0.16.0-canary.f155c058.0":"2020-06-18T18:07:47.603Z","0.16.0-canary.309779d2.0":"2020-06-18T23:58:33.631Z","0.16.0-canary.e7649968.0":"2020-06-19T21:40:41.245Z","0.16.0-canary.8e21c78b.0":"2020-06-22T10:37:38.652Z","0.16.0-canary.6db76faf.0":"2020-06-22T21:12:56.346Z","0.16.0-canary.c4dd9684.0":"2020-06-23T15:14:56.027Z","0.16.0-canary.b3e53981.0":"2020-06-24T00:39:07.262Z","0.16.0-canary.b9468f77.0":"2020-06-24T21:54:17.963Z","0.16.0-canary.eb790e49.0":"2020-06-25T21:18:52.962Z","0.16.0-canary.9aa1a5c5.0":"2020-06-26T17:05:11.623Z","0.16.0-canary.d36e9861.0":"2020-06-26T17:36:32.663Z","0.16.0-canary.155c2f85.0":"2020-06-26T23:29:32.694Z","0.16.0-canary.340c9c40.0":"2020-06-26T23:38:12.522Z","0.16.0-canary.a3384d2d.0":"2020-06-30T21:00:18.747Z","0.17.0-canary.6d056c96.0":"2020-06-30T21:09:45.215Z","0.16.1":"2020-06-30T21:14:46.515Z","0.17.0-canary.f7e37607.0":"2020-06-30T21:44:20.314Z","0.18.0-canary.0afbfef2.0":"2020-07-01T19:44:09.374Z","0.17.0":"2020-07-01T19:44:27.730Z","0.18.0-canary.fd970958.0":"2020-07-01T23:33:23.694Z","0.18.0-canary.fd44be19.0":"2020-07-02T05:48:30.811Z","0.17.2":"2020-07-02T05:58:25.788Z","0.18.0-canary.ca6fc6de.0":"2020-07-02T05:59:19.814Z","0.18.0-canary.79f1ec2a.0":"2020-07-07T17:32:27.936Z","0.18.0-canary.a7bc45ae.0":"2020-07-09T17:23:06.443Z","0.18.0-canary.b184bc1c.0":"2020-07-09T17:32:19.089Z","0.18.0-canary.b39fde62.0":"2020-07-09T17:37:33.372Z","0.18.0-canary.dfdd8d6c.0":"2020-07-09T18:25:42.070Z","0.18.0-canary.11cf2694.0":"2020-07-09T20:43:26.234Z","0.18.0-canary.436d66e9.0":"2020-07-09T20:48:16.311Z","0.18.0-canary.3a44d36b.0":"2020-07-10T00:37:20.659Z","0.18.0-canary.ec11ae6e.0":"2020-07-10T17:52:57.360Z","0.18.0-canary.17f6cf27.0":"2020-07-10T18:32:45.880Z","0.18.0-canary.efdfbc21.0":"2020-07-10T18:44:27.105Z","0.18.0-canary.bae4339a.0":"2020-07-14T16:41:48.577Z","0.18.0-canary.28eac13b.0":"2020-07-14T22:23:23.071Z","0.18.0-canary.44966b65.0":"2020-07-15T18:04:50.161Z","0.18.0-canary.3ef0ef60.0":"2020-07-16T16:54:34.092Z","0.18.0-canary.fcebf9e6.0":"2020-07-20T18:46:01.478Z","0.18.0-canary.b6a772df.0":"2020-07-20T22:46:26.662Z","0.18.0-canary.f6a6ca38.0":"2020-07-21T16:40:49.107Z","0.18.0-canary.647dd6b7.0":"2020-07-21T18:44:01.762Z","0.18.0-canary.3cb7406f.0":"2020-07-22T18:57:27.692Z","0.18.0-canary.5717a5a1.0":"2020-07-22T21:39:52.908Z","0.18.0-canary.d84cd4b2.0":"2020-07-22T21:41:52.055Z","0.18.0-canary.f279e7fc.0":"2020-07-22T22:00:56.137Z","0.18.0-canary.f181e3bc.0":"2020-07-22T22:02:38.845Z","0.18.0-canary.346a622a.0":"2020-07-22T23:39:55.035Z","0.18.0-canary.c9e8a848.0":"2020-07-23T01:10:19.578Z","0.18.0-canary.718c385c.0":"2020-07-23T20:06:28.334Z","0.18.0-canary.cd516a27.0":"2020-07-24T19:10:49.271Z","0.18.0-canary.1f082191.0":"2020-07-24T19:16:03.948Z","0.18.0-canary.ea3e82dc.0":"2020-07-24T19:21:17.605Z","0.18.0-canary.94987b64.0":"2020-07-24T20:26:29.974Z","0.18.0-canary.ff49b7e2.0":"2020-07-27T19:04:47.655Z","0.18.0-canary.3d334ccc.0":"2020-07-28T16:15:08.761Z","0.18.0-canary.82ac569e.0":"2020-07-28T18:42:25.729Z","0.18.0-canary.99df7397.0":"2020-07-29T02:40:26.971Z","0.18.0-canary.45493e05.0":"2020-07-29T17:16:35.371Z","0.18.0-canary.f2ab0a95.0":"2020-07-29T17:21:28.100Z","0.18.0-canary.45f9eddc.0":"2020-07-30T00:54:49.775Z","0.18.0-canary.b64663ea.0":"2020-07-30T17:43:25.058Z","0.18.0-canary.9a1a4d2d.0":"2020-07-30T21:04:08.323Z","0.18.0-canary.887c2848.0":"2020-07-30T22:05:31.021Z","0.18.0-canary.354eb695.0":"2020-07-30T23:57:49.076Z","0.18.0-canary.7beb236c.0":"2020-07-31T17:40:28.224Z","0.18.0-canary.c44acc0c.0":"2020-07-31T21:11:02.256Z","0.18.0-canary.779853ff.0":"2020-08-03T17:23:20.645Z","0.18.0-canary.8aaf270b.0":"2020-08-03T18:40:41.520Z","0.18.0-canary.5cde9f12.0":"2020-08-03T19:01:03.437Z","0.18.0-canary.1607ec53.0":"2020-08-03T19:46:40.340Z","0.18.0-canary.678b30e3.0":"2020-08-03T19:50:30.669Z","0.18.0-canary.21c55569.0":"2020-08-03T19:56:34.847Z","0.19.0-canary.907d4d7d.0":"2020-08-03T21:22:17.521Z","0.18.0":"2020-08-03T21:24:29.028Z","0.19.0-canary.f7958e4a.0":"2020-08-04T02:06:48.109Z","0.19.0-canary.f8ceaf79.0":"2020-08-04T19:18:03.549Z","0.19.0-canary.6b9e385a.0":"2020-08-04T21:29:44.595Z","0.19.0-canary.9a7e6d2a.0":"2020-08-05T03:45:55.539Z","0.19.0-canary.188f3f1c.0":"2020-08-05T18:13:22.858Z","0.19.0-canary.b6106add.0":"2020-08-05T20:49:20.073Z","0.19.0-canary.ebb4c667.0":"2020-08-06T00:18:45.521Z","0.19.0-canary.aa44289e.0":"2020-08-06T18:27:23.911Z","0.19.0-canary.e6b0816b.0":"2020-08-07T18:43:44.215Z","0.19.0-canary.96d15938.0":"2020-08-07T20:28:51.208Z","0.19.0-canary.9d991c8c.0":"2020-08-07T22:08:25.507Z","0.19.0-canary.13bfbd72.0":"2020-08-10T19:27:22.564Z","0.19.0-canary.30b1b258.0":"2020-08-10T20:06:56.778Z","0.19.0-canary.1583e263.0":"2020-08-11T23:10:41.645Z","0.19.0-canary.fefb1a93.0":"2020-08-12T00:25:07.128Z","0.19.0-canary.1ac5b9d4.0":"2020-08-12T18:27:24.981Z","0.19.0-canary.f17f5052.0":"2020-08-13T17:14:31.058Z","0.19.0-canary.80b5d20d.0":"2020-08-13T18:17:15.320Z","0.19.0-canary.758635ed.0":"2020-08-14T17:16:36.126Z","0.19.0-canary.18d6b808.0":"2020-08-14T23:08:01.767Z","0.19.0-canary.5f8ffbd1.0":"2020-08-17T22:15:28.085Z","0.19.0-canary.8604d59e.0":"2020-08-18T01:02:27.389Z","0.19.0-canary.1d7d5e34.0":"2020-08-18T01:08:57.263Z","0.19.0-canary.9cc95c07.0":"2020-08-18T01:16:40.426Z","0.19.0-canary.9f65ced3.0":"2020-08-18T20:16:06.190Z","0.19.0-canary.5962b365.0":"2020-08-19T20:28:49.076Z","0.19.0-canary.9c9ec756.0":"2020-08-20T18:55:51.389Z","0.19.0-canary.fa0ad66a.0":"2020-08-20T20:34:59.513Z","0.19.0-canary.06ecdd6b.0":"2020-08-20T21:33:56.804Z","0.19.0-canary.2bca2318.0":"2020-08-21T17:52:23.398Z","0.19.0-canary.6aa47265.0":"2020-08-21T18:16:02.080Z","0.19.0-canary.e7202a07.0":"2020-08-21T19:23:31.605Z","0.19.0-canary.f208201e.0":"2020-08-24T19:03:09.873Z","0.19.0-canary.14a172db.0":"2020-08-25T19:47:45.108Z","0.19.0-canary.e6c1038d.0":"2020-08-27T19:37:01.388Z","0.19.0-canary.34012082.0":"2020-08-27T19:48:19.346Z","0.19.0-canary.c073f7b8.0":"2020-08-28T17:12:09.730Z","0.19.0-canary.b7ae68ff.0":"2020-08-29T01:27:04.336Z","0.19.0-canary.697e3879.0":"2020-09-02T00:13:10.245Z","0.19.0-canary.eafb7991.0":"2020-09-02T02:18:15.750Z","0.19.0-canary.606642ec.0":"2020-09-02T21:35:34.877Z","0.19.0-canary.ddf05c42.0":"2020-09-03T13:53:04.485Z","0.19.0-canary.b889e6dc.0":"2020-09-03T14:11:11.652Z","0.19.0-canary.aabeceb0.0":"2020-09-03T19:57:34.091Z","0.19.0-canary.d8cca3a6.0":"2020-09-03T21:31:33.986Z","0.19.0-canary.26d34b2e.0":"2020-09-03T21:56:49.262Z","0.19.0-canary.a1c44494.0":"2020-09-09T22:07:33.388Z","0.19.0-canary.be1cd1e9.0":"2020-09-10T16:41:04.228Z","0.19.0-canary.f094c0ce.0":"2020-09-10T17:36:14.681Z","0.19.0-canary.c1261e7d.0":"2020-09-11T02:26:16.874Z","0.19.0-canary.9b39ed1e.0":"2020-09-11T02:27:10.737Z","0.19.0-canary.e67214b3.0":"2020-09-11T02:31:31.189Z","0.19.0-canary.36f5da28.0":"2020-09-11T02:34:12.154Z","0.19.0-canary.3babab12.0":"2020-09-11T02:37:07.425Z","0.19.0-canary.a4481e6f.0":"2020-09-11T02:49:19.726Z","0.19.0-canary.a9177836.0":"2020-09-11T17:47:27.915Z","0.19.0-canary.b102a3c8.0":"2020-09-14T20:13:18.066Z","0.19.0-canary.a7fbc707.0":"2020-09-15T16:05:30.338Z","0.19.0-canary.ed6b8660.0":"2020-09-15T17:25:07.159Z","0.19.0-canary.9c2331f5.0":"2020-09-15T17:49:17.954Z","0.19.0-canary.63a5f088.0":"2020-09-16T21:37:52.809Z","0.19.0-canary.b7995e49.0":"2020-09-16T23:26:32.214Z","0.19.0-canary.0da3ec97.0":"2020-09-21T22:08:56.994Z","0.19.0-canary.a0793c96.0":"2020-09-22T17:04:30.689Z","0.19.0-canary.06998a3e.0":"2020-09-22T18:25:42.332Z","0.19.0-canary.3484a90d.0":"2020-09-22T22:04:07.334Z","0.19.0-canary.3f99af40.0":"2020-09-24T23:21:23.045Z","0.19.0-canary.72aa1129.0":"2020-09-25T21:07:16.802Z","0.19.0-canary.394fd3f6.0":"2020-09-28T14:12:27.158Z","0.19.0-canary.347110f1.0":"2020-09-28T16:50:21.776Z","0.19.0-canary.5e330bb9.0":"2020-09-30T22:01:11.524Z","0.19.0-canary.30b9e3a9.0":"2020-09-30T22:38:09.324Z","0.19.0-canary.7bb04b9a.0":"2020-10-01T23:22:48.371Z","0.19.0-canary.615d861d.0":"2020-10-02T01:33:23.817Z","0.19.0-canary.af110e86.0":"2020-10-02T23:49:53.371Z","0.19.0-canary.89d27ca5.0":"2020-10-06T01:27:05.166Z","0.19.0-canary.9ef2e7c2.0":"2020-10-07T00:14:21.139Z","0.19.0-canary.96c8bdc1.0":"2020-10-07T20:07:42.967Z","0.20.0-canary.6c21f034.0":"2020-10-07T22:30:31.377Z","0.19.0":"2020-10-07T22:33:26.763Z","0.20.0-canary.1f026aaa.0":"2020-10-08T22:53:42.225Z","0.19.1":"2020-10-08T23:05:58.101Z","0.20.0-canary.5f6894b1.0":"2020-10-08T23:07:05.797Z","0.20.0-canary.f6260d06.0":"2020-10-12T22:34:17.550Z","0.20.0-canary.2d1b08aa.0":"2020-10-13T19:22:10.852Z","0.20.0-canary.5bd58844.0":"2020-10-13T23:46:19.099Z","0.20.0-canary.bc846b29.0":"2020-10-14T18:15:49.150Z","0.20.0-canary.3280b686.0":"2020-10-16T00:04:45.403Z","0.20.0-canary.9e94cd38.0":"2020-10-16T21:14:24.238Z","0.20.0-canary.4773c773.0":"2020-10-16T22:34:12.232Z","0.20.0-canary.65787913.0":"2020-10-19T18:51:00.432Z","0.20.0-canary.5485fba3.0":"2020-10-19T21:24:29.642Z","0.20.0-canary.a39d0a92.0":"2020-10-23T21:23:50.516Z","0.20.0-canary.4eafcbc1.0":"2020-10-27T01:21:00.406Z","0.20.0-canary.32961593.0":"2020-10-28T00:39:28.147Z","0.20.0-canary.8e3a0601.0":"2020-10-29T21:36:58.031Z","0.20.0-canary.178c25b4.0":"2020-10-29T21:50:35.021Z","0.20.0-canary.124beb49.0":"2020-10-31T00:06:35.129Z","0.20.0-canary.5937f468.0":"2020-11-04T21:06:26.241Z","0.20.0-canary.a9bafaee.0":"2020-11-05T22:30:48.547Z","0.20.0-canary.184861ee.0":"2020-11-07T00:37:41.716Z","0.20.0-canary.6c6ae2d6.0":"2020-11-09T13:05:52.075Z","0.20.0-canary.ea2aa477.0":"2020-11-09T23:58:13.755Z","0.20.0-canary.a2c088dc.0":"2020-11-10T14:24:05.123Z","0.20.0-canary.b04d71d4.0":"2020-11-12T10:42:01.444Z","0.20.0-canary.2c553352.0":"2020-11-12T22:42:44.098Z","0.20.0-canary.6560d19a.0":"2020-11-13T20:48:26.805Z","0.20.0-canary.a28d5ec3.0":"2020-11-17T15:23:54.042Z","0.20.0-canary.03e7e778.0":"2020-11-17T19:25:52.142Z","0.20.0-canary.ac8ed597.0":"2020-11-17T22:11:46.655Z","0.20.0-canary.b6a60f60.0":"2020-11-17T22:52:08.552Z","0.20.0-canary.71cc24fb.0":"2020-11-17T23:16:41.141Z","0.20.0-canary.761027ff.0":"2020-11-18T22:14:03.732Z","0.20.0-canary.dc93d04c.0":"2020-11-18T22:19:51.424Z","0.20.0-canary.4a5d4eeb.0":"2020-11-19T11:30:35.793Z","0.20.0-canary.bd176a15.0":"2020-11-19T19:10:14.231Z","0.20.0-canary.e85aa60d.0":"2020-11-23T22:24:37.845Z","0.20.0-canary.72092360.0":"2020-11-24T04:18:08.917Z","0.20.0-canary.baf9d39f.0":"2020-11-25T21:48:38.233Z","0.20.0-canary.51aab0ad.0":"2020-12-01T01:05:12.935Z","0.20.0-canary.8fd4af5b.0":"2020-12-03T00:27:09.036Z","0.20.0-canary.26d14d2f.0":"2020-12-03T00:55:48.299Z","0.20.0-canary.1663d7e4.0":"2020-12-03T01:16:24.123Z","0.20.0-canary.cbe9fc12.0":"2020-12-03T19:07:07.291Z","0.20.0-canary.9755be10.0":"2020-12-03T19:25:15.202Z","0.20.0-canary.3f64270c.0":"2020-12-03T21:49:42.612Z","0.21.0-canary.d893b14a.0":"2020-12-03T22:25:57.026Z","0.20.0":"2020-12-03T22:28:46.796Z","0.21.0-canary.47c7d7e5.0":"2020-12-11T19:56:50.816Z","0.21.0-canary.b304a78b.0":"2020-12-15T20:03:52.897Z","0.21.0-canary.777c5fa4.0":"2020-12-16T21:53:56.204Z","0.21.0-canary.635c7996.0":"2020-12-17T23:31:43.973Z","0.21.0-canary.20b0045f.0":"2020-12-17T23:48:44.367Z","0.21.0-canary.41f77000.0":"2020-12-18T00:35:04.974Z","0.21.0-canary.afe4079a.0":"2020-12-22T17:39:39.826Z","0.21.0-canary.407ef8f9.0":"2020-12-30T23:02:38.684Z","0.21.0-canary.2e26e137.0":"2021-01-05T18:49:29.857Z","0.21.0-canary.9009f6c1.0":"2021-01-08T19:54:14.507Z","0.21.0-canary.ee99b646.0":"2021-01-11T23:08:05.410Z","0.21.0-canary.740ed33b.0":"2021-01-12T18:04:02.362Z","0.21.0-canary.c5c541b1.0":"2021-01-12T18:45:26.556Z","0.21.0-canary.06fe9d90.0":"2021-01-12T20:54:56.020Z","0.21.0-canary.269eed01.0":"2021-01-13T21:45:08.546Z","0.21.0-canary.8c075f35.0":"2021-01-13T23:06:54.243Z","0.21.0-canary.3cda381b.0":"2021-01-14T00:04:29.465Z","0.21.0-canary.bc113605.0":"2021-01-14T00:45:38.190Z","0.21.0-canary.0c1d6ff9.0":"2021-01-15T20:09:11.030Z","0.21.0-canary.b4332e00.0":"2021-01-15T22:07:24.068Z","0.21.0-canary.2899691d.0":"2021-01-16T01:44:28.632Z","0.21.0-canary.fe73953b.0":"2021-01-19T19:21:16.760Z","0.21.0-canary.d3a16455.0":"2021-01-19T19:52:15.018Z","0.21.0-canary.597ca1b6.0":"2021-01-20T01:00:09.283Z","0.21.0-canary.3c195efe.0":"2021-01-20T02:01:23.092Z","0.21.0-canary.f7b8755f.0":"2021-01-20T20:37:35.510Z","0.21.0-canary.f60de7df.0":"2021-01-20T23:36:35.148Z","0.21.0-canary.664a2927.0":"2021-01-21T19:18:31.055Z","0.21.0-canary.a6d312e5.0":"2021-01-21T21:47:28.550Z","0.21.0-canary.027365eb.0":"2021-01-22T21:07:23.864Z","0.21.0-canary.7e72b66d.0":"2021-01-22T23:26:48.186Z","0.21.0-canary.a6d6a1e7.0":"2021-01-22T23:32:45.799Z","0.21.0-canary.b95fe100.0":"2021-01-22T23:51:49.215Z","0.21.0-canary.c8797192.0":"2021-01-23T00:07:11.916Z","0.21.0-canary.946f5563.0":"2021-01-23T00:43:27.684Z","0.21.0-canary.43664f0e.0":"2021-01-25T22:40:00.661Z","0.21.0-canary.2e769e3c.0":"2021-01-26T00:06:13.097Z","0.21.0-canary.14e01610.0":"2021-01-27T19:51:25.162Z","0.21.0-canary.5de00c1b.0":"2021-01-27T20:17:05.224Z","0.21.0-canary.5a328336.0":"2021-01-28T19:54:36.877Z","0.21.0-canary.533b1251.0":"2021-01-29T15:11:36.843Z","0.21.0-canary.ab5c0a10.0":"2021-02-02T20:17:24.061Z","0.21.0-canary.b7a40b27.0":"2021-02-03T15:03:42.346Z","0.21.0-canary.0fdee204.0":"2021-02-03T18:34:02.311Z","0.21.0-canary.5160e548.0":"2021-02-05T23:51:15.512Z","0.21.0-canary.4fa2daec.0":"2021-02-09T00:18:58.337Z","0.21.0-canary.67f285fb.0":"2021-02-09T00:51:03.769Z","0.21.0-canary.58cd5a70.0":"2021-02-11T20:44:42.378Z","0.21.0-canary.8107ca43.0":"2021-02-11T23:28:54.113Z","0.21.0-canary.d35d64ef.0":"2021-02-11T23:43:01.415Z","0.21.0-canary.78bcf058.0":"2021-02-12T00:48:20.809Z","0.21.0-canary.0c6908fd.0":"2021-02-12T01:24:49.479Z","0.21.0-canary.f1f34ee0.0":"2021-02-12T20:18:01.579Z","0.21.0-canary.d84df029.0":"2021-02-16T19:08:27.275Z","0.21.0-canary.c525f471.0":"2021-02-17T20:53:26.551Z","0.21.0-canary.ba7a1b35.0":"2021-02-19T00:13:52.937Z","0.21.0-canary.9a566dda.0":"2021-02-19T18:38:01.641Z","0.21.0-canary.55addb8c.0":"2021-02-19T22:02:15.149Z","0.21.0-canary.85dd5e9b.0":"2021-02-23T02:19:12.529Z","0.21.0-canary.aa3e078e.0":"2021-02-23T17:15:21.076Z","0.21.0-canary.dccd254e.0":"2021-02-26T21:10:32.657Z","0.21.0-canary.7dd1a27d.0":"2021-03-01T22:01:06.295Z","0.21.0-canary.12574572.0":"2021-03-02T20:29:23.995Z","0.21.0-canary.1109a3d3.0":"2021-03-02T20:34:36.450Z","0.21.0-canary.b9cd8739.0":"2021-03-03T17:47:26.716Z","0.21.0-canary.71ee796a.0":"2021-03-03T20:10:59.665Z","0.21.0-canary.2be191ed.0":"2021-03-03T21:51:35.630Z","0.21.0-canary.6dc7b06f.0":"2021-03-05T00:22:12.235Z","0.21.0-canary.24fe7ba6.0":"2021-03-05T17:27:06.069Z","0.21.0-canary.12c477d1.0":"2021-03-08T22:23:31.265Z","0.21.0-canary.4c38f801.0":"2021-03-08T23:24:35.143Z","0.21.0-canary.8795b83f.0":"2021-03-09T18:27:27.855Z","0.21.0-canary.12b84cb7.0":"2021-03-10T00:41:10.145Z","0.21.0-canary.6ac6784b.0":"2021-03-10T00:51:20.645Z","0.21.0-canary.b6d92934.0":"2021-03-10T22:00:55.203Z","0.21.0-canary.99a55b9e.0":"2021-03-10T22:51:41.937Z","0.21.0-canary.bb14efb7.0":"2021-03-10T23:37:14.546Z","0.21.0-canary.9ecf3bdd.0":"2021-03-11T00:23:20.012Z","0.21.0-canary.7c0e02fd.0":"2021-03-11T01:46:39.496Z","0.21.0-canary.2d6d59cc.0":"2021-03-11T18:29:20.801Z","0.21.0-canary.0138863c.0":"2021-03-11T18:36:49.657Z","0.21.0-canary.926f5bad.0":"2021-03-11T20:18:45.211Z","0.21.0-canary.520290a9.0":"2021-03-11T22:27:56.486Z","0.21.0-canary.9ec431d1.0":"2021-03-11T22:32:18.393Z","0.21.0-canary.4246c082.0":"2021-03-11T22:39:21.273Z","0.21.0-canary.2d736253.0":"2021-03-15T22:35:48.377Z","0.21.0-canary.7033124d.0":"2021-03-16T18:37:33.720Z","0.21.0-canary.6c0ee901.0":"2021-03-16T22:39:01.293Z","0.21.0-canary.7f0d605e.0":"2021-03-17T18:04:39.887Z","0.21.0-canary.572107b5.0":"2021-03-18T23:54:16.379Z","0.21.0-canary.b7b220b1.0":"2021-03-19T00:20:01.192Z","0.21.0-canary.233b2de7.0":"2021-03-19T18:30:14.723Z","0.21.0-canary.0c1a2d97.0":"2021-03-19T21:21:16.290Z","0.21.0-canary.57ca2e73.0":"2021-03-19T22:40:50.941Z","0.21.0-canary.5c058f4b.0":"2021-03-23T23:08:29.374Z","0.21.0-canary.e27ef7cd.0":"2021-03-30T20:11:21.531Z","0.21.0-canary.15c09e74.0":"2021-03-31T16:47:38.823Z","0.21.0-canary.4dc32be3.0":"2021-03-31T23:48:15.019Z","0.21.0-canary.4b717f65.0":"2021-04-01T18:14:27.455Z","0.21.0-canary.c6870f20.0":"2021-04-01T23:42:06.397Z","0.21.0-canary.852f873c.0":"2021-04-02T05:22:09.329Z","0.21.0-canary.4a674a1d.0":"2021-04-02T14:44:21.788Z","0.21.0-canary.c5b29ff1.0":"2021-04-05T17:49:59.866Z","0.21.0-canary.583644a6.0":"2021-04-05T17:51:05.211Z","0.21.0-canary.02ac1e6b.0":"2021-04-06T18:36:21.122Z","0.21.0-canary.5ac5856e.0":"2021-04-06T18:42:39.267Z","0.21.0-canary.bb23dbc4.0":"2021-04-07T21:23:49.732Z","0.21.0-canary.e539904c.0":"2021-04-08T18:02:00.790Z","0.21.0-canary.a93ae333.0":"2021-04-09T20:11:28.543Z","0.21.0-canary.e142c144.0":"2021-04-12T14:50:36.360Z","0.21.0-canary.382d7eb0.0":"2021-04-12T22:05:29.114Z","0.21.0-canary.b16c7885.0":"2021-04-12T22:39:09.380Z","0.21.0-canary.0e92782b.0":"2021-04-13T14:41:51.365Z","0.21.0-canary.70b3a072.0":"2021-04-14T22:26:15.316Z","0.21.0-canary.ff79b092.0":"2021-04-15T18:59:53.439Z","0.21.0-canary.f35b2fd7.0":"2021-04-15T19:10:19.620Z","0.21.0-canary.11977cac.0":"2021-04-16T00:58:01.868Z","0.21.0-canary.018ff45e.0":"2021-04-22T22:50:59.043Z","0.21.0-canary.c99d1fa5.0":"2021-04-26T19:46:34.767Z","0.21.0-canary.eea9b304.0":"2021-04-27T22:53:06.827Z","0.21.0-canary.5dd85d0c.0":"2021-04-28T00:09:27.834Z","0.21.0-canary.cc813cff.0":"2021-04-30T21:19:16.189Z","0.21.0-canary.0875e898.0":"2021-04-30T21:27:26.716Z","0.21.0":"2021-04-30T23:58:10.293Z","0.22.0-canary.8f1e7e1b.0":"2021-05-01T00:05:14.624Z","0.22.0-canary.deb0e792.0":"2021-05-03T21:34:10.370Z","0.22.0-canary.a3ff615f.0":"2021-05-03T22:33:34.351Z","0.22.0-canary.948ccfb5.0":"2021-05-04T00:10:37.803Z","0.22.0-canary.9f8337d7.0":"2021-05-04T18:36:55.864Z","0.22.0-canary.5813480a.0":"2021-05-05T18:25:22.308Z","0.22.0-canary.ab7fc1bf.0":"2021-05-06T17:59:08.743Z","0.22.0-canary.25693d60.0":"2021-05-07T21:55:54.805Z","0.22.0-canary.c497962b.0":"2021-05-07T22:19:48.461Z","0.22.0-canary.e300688e.0":"2021-05-07T22:24:17.509Z","0.22.0-canary.d70287f2.0":"2021-05-10T19:29:11.839Z","0.22.0-canary.02e841b2.0":"2021-05-10T20:34:25.811Z","0.22.0-canary.badda2f0.0":"2021-05-11T00:34:33.805Z","0.22.0-canary.004aca62.0":"2021-05-11T18:06:15.270Z","0.22.0-canary.4af17446.0":"2021-05-11T18:46:03.417Z","0.22.0-canary.b94d7187.0":"2021-05-11T18:51:35.967Z","0.22.0-canary.4021b2f9.0":"2021-05-12T22:00:26.012Z","0.22.0-canary.6a5956a3.0":"2021-05-12T22:17:21.055Z","0.22.0-canary.b6e8a74b.0":"2021-05-12T23:03:21.511Z","0.22.0-canary.c94e1030.0":"2021-05-12T23:09:10.669Z","0.22.0-canary.40a34e35.0":"2021-05-12T23:58:19.594Z","0.22.0-canary.1be14d2c.0":"2021-05-13T17:50:07.915Z","0.22.0-canary.87dbd64f.0":"2021-05-14T20:58:25.511Z","0.22.0-canary.c452e4da.0":"2021-05-17T23:32:00.097Z","0.22.0-canary.2212691a.0":"2021-05-17T23:52:37.113Z","0.22.0-canary.f748ff2f.0":"2021-05-18T00:22:25.538Z","0.22.0-canary.cc04657a.0":"2021-05-18T01:21:12.969Z","0.22.0-canary.3a3114fa.0":"2021-05-19T23:40:10.465Z","0.22.0-canary.b46bdf83.0":"2021-05-20T01:50:58.271Z","0.22.0-canary.b401a081.0":"2021-05-21T23:22:57.876Z","0.22.0-canary.012c8dc0.0":"2021-05-22T00:16:24.141Z","0.22.0-canary.e01a1731.0":"2021-05-24T16:02:45.986Z","0.22.0-canary.59174b9f.0":"2021-05-25T18:02:13.246Z","0.22.0-canary.c96cb2e0.0":"2021-05-25T19:12:18.818Z","0.22.0-canary.b9b0e330.0":"2021-05-25T21:00:22.485Z","0.22.0-canary.ea2a8063.0":"2021-05-25T21:05:24.439Z","0.22.0-canary.60cd9178.0":"2021-05-25T23:14:02.409Z","0.22.0-canary.2e2c75f2.0":"2021-05-26T00:11:03.596Z","0.22.0-canary.b99c77d5.0":"2021-05-26T19:13:36.661Z","0.22.0-canary.0de82c12.0":"2021-05-26T21:31:04.387Z","0.22.0-canary.227a4614.0":"2021-05-27T16:03:12.498Z","0.22.0-canary.b3d21d31.0":"2021-05-27T18:45:14.560Z","0.22.0-canary.288c33ec.0":"2021-06-02T19:33:03.516Z","0.22.0-canary.7eb7ccb0.0":"2021-06-03T19:55:01.892Z","0.22.0-canary.7fcc0726.0":"2021-06-08T00:45:28.027Z","0.22.0-canary.220a4e5e.0":"2021-06-08T17:50:07.100Z","0.22.0-canary.6b2d6ab0.0":"2021-06-08T18:36:39.314Z","0.22.0-canary.2b20825e.0":"2021-06-11T23:49:01.295Z","0.22.0-canary.e1511867.0":"2021-06-12T00:57:18.233Z","0.22.0-canary.ef4a0c0d.0":"2021-06-15T19:51:50.522Z","0.22.0-canary.573d8913.0":"2021-06-18T23:26:40.753Z","0.22.0-canary.21dba001.0":"2021-06-21T21:40:31.759Z","0.22.0-canary.6f5bfd0f.0":"2021-06-24T22:56:01.483Z","0.22.0-canary.fd8360b4.0":"2021-06-25T19:09:03.362Z","0.22.0-canary.6f74432f.0":"2021-06-25T20:46:57.562Z","0.22.0-canary.b62f901d.0":"2021-06-25T22:17:13.010Z","0.22.0-canary.73122cba.0":"2021-06-30T19:36:40.746Z","0.22.0-canary.a6912af5.0":"2021-07-01T21:33:58.311Z","0.22.0-canary.134f24bf.0":"2021-07-01T22:32:20.064Z","0.22.0-canary.1debb78f.0":"2021-07-07T00:46:13.766Z","0.22.0-canary.d53edeb6.0":"2021-07-07T17:00:11.217Z","0.22.0-canary.2226489a.0":"2021-07-08T18:01:28.635Z","0.22.0-canary.d4801c11.0":"2021-07-08T20:02:41.221Z","0.22.0-canary.7ec5f2d6.0":"2021-07-12T17:16:44.996Z","0.22.0-canary.86cb4ca7.0":"2021-07-13T17:37:30.665Z","0.22.0-canary.bc9a724e.0":"2021-07-13T18:42:01.479Z","0.22.0-canary.7847b83a.0":"2021-07-14T17:18:36.501Z","0.22.0-canary.8cba18fa.0":"2021-07-14T20:26:35.243Z","0.22.1":"2021-07-14T22:52:52.678Z","0.23.0-canary.fbc09b4e.0":"2021-07-14T22:54:01.489Z","0.23.0-canary.73e9f83c.0":"2021-07-15T20:39:30.823Z","0.23.0-canary.cc0aa7a9.0":"2021-07-15T21:03:39.536Z","0.23.0-canary.a8fcac45.0":"2021-07-15T21:22:36.547Z","0.23.0-canary.3ca580d1.0":"2021-07-15T22:04:00.773Z","0.23.0-canary.9e41cb2e.0":"2021-07-15T23:09:05.992Z","0.23.0-canary.c180db74.0":"2021-07-16T17:24:56.817Z","0.23.0-canary.0d0a9267.0":"2021-07-16T17:57:12.196Z","0.23.0-canary.d234ec3f.0":"2021-07-16T18:07:45.519Z","0.23.0-canary.5cd4bcdb.0":"2021-07-16T21:12:04.616Z","0.23.0-canary.2b133cb2.0":"2021-07-16T22:06:33.441Z","0.23.0-canary.ae4f422b.0":"2021-07-16T23:54:02.535Z","0.23.0-canary.90ff8057.0":"2021-07-19T14:07:34.022Z","0.23.0-canary.dd7b75d1.0":"2021-07-19T17:50:42.098Z","0.23.0-canary.104debd5.0":"2021-07-19T22:53:33.774Z","0.23.0-canary.4612705d.0":"2021-07-20T16:04:36.542Z","0.23.0-canary.b36502a2.0":"2021-07-21T22:34:34.999Z","0.23.0-canary.2c392ab3.0":"2021-07-22T14:52:54.447Z","0.23.0-canary.e8bac95a.0":"2021-07-22T18:52:52.617Z","0.23.0-canary.38f29f8f.0":"2021-07-23T18:16:01.541Z","0.23.0-canary.e0693475.0":"2021-07-23T18:56:10.626Z","0.23.0-canary.d595e030.0":"2021-07-23T20:53:12.760Z","0.23.0-canary.fe7cca31.0":"2021-07-23T21:56:46.932Z","0.23.0-canary.fd9da483.0":"2021-07-26T21:24:50.913Z","0.23.0-canary.8a4c7e06.0":"2021-07-26T22:44:04.368Z","0.23.0-canary.5b395fd1.0":"2021-07-27T22:53:05.874Z","0.23.0-canary.e5efdcc0.0":"2021-07-28T17:22:24.579Z","0.23.0-canary.ab310900.0":"2021-07-28T20:21:22.135Z","0.23.0-canary.21dc9bc5.0":"2021-07-28T20:26:06.067Z","0.23.0-canary.68c7fe5c.0":"2021-07-29T18:31:49.166Z","0.23.0-canary.aebe39e8.0":"2021-07-30T19:13:46.054Z","0.23.0-canary.ea889c69.0":"2021-08-03T18:47:45.787Z","0.23.0-canary.21918905.0":"2021-08-03T21:14:27.007Z","0.23.0-canary.193c87be.0":"2021-08-04T18:07:39.776Z","0.23.0-canary.6fc52d8b.0":"2021-08-05T18:10:53.585Z","0.23.0-canary.e2e9777d.0":"2021-08-05T22:47:27.177Z","0.23.0-canary.72ff1e68.0":"2021-08-06T20:48:49.457Z","0.23.0-canary.c527e93b.0":"2021-08-06T21:10:30.512Z","0.23.0-canary.78b1eaac.0":"2021-08-09T18:03:53.509Z","0.23.0-canary.a8a4ddc9.0":"2021-08-10T18:46:57.556Z","0.23.0-canary.99fc0632.0":"2021-08-11T22:21:39.561Z","0.23.0-canary.3f47ae57.0":"2021-08-12T18:00:03.483Z","0.23.0-canary.6b9bfc32.0":"2021-08-12T18:24:12.401Z","0.23.0-canary.c89ecc63.0":"2021-08-16T17:16:59.411Z","0.23.0-canary.59de86bd.0":"2021-08-18T01:38:25.087Z","0.23.0-canary.dcda879b.0":"2021-08-18T22:23:20.257Z","0.23.0-canary.dbb8b366.0":"2021-08-19T23:00:22.791Z","0.23.0-canary.c6e3060c.0":"2021-08-19T23:02:14.290Z","0.23.0-canary.03120b7d.0":"2021-08-20T00:27:17.315Z","0.23.0-canary.d75a5f74.0":"2021-08-20T07:56:19.033Z","0.23.0-canary.3d79ffe7.0":"2021-08-20T17:21:31.537Z","0.23.0-canary.02213ebe.0":"2021-08-20T17:26:12.588Z","0.23.0-canary.90a999b9.0":"2021-08-20T18:42:39.826Z","0.23.0-canary.6db58716.0":"2021-08-23T09:07:58.147Z","0.23.0-canary.9fb5bc35.0":"2021-08-23T22:50:16.424Z","0.23.0-canary.ddaa5d8e.0":"2021-08-24T18:49:53.556Z","0.23.0-canary.756208fb.0":"2021-08-25T19:50:40.260Z","0.23.0-canary.9576dcd9.0":"2021-08-25T21:44:00.185Z","0.23.0-canary.7531cf97.0":"2021-08-26T17:26:14.369Z","0.23.0-canary.3bab26b4.0":"2021-08-26T21:44:53.657Z","0.23.0-canary.fab48bee.0":"2021-08-26T22:07:43.225Z","0.23.0-canary.dec18df7.0":"2021-08-30T08:28:58.012Z","0.23.0-canary.61fe5b17.0":"2021-08-30T19:28:44.586Z","0.23.0-canary.a8c31f54.0":"2021-08-30T20:31:34.189Z","0.23.0-canary.a096dba8.0":"2021-08-31T22:18:58.529Z","0.23.0-canary.7ec04d47.0":"2021-09-02T23:25:31.123Z","0.23.0-canary.d00b098d.0":"2021-09-03T21:26:44.497Z","0.23.0-canary.f29b3352.0":"2021-09-07T18:16:10.975Z","0.23.0-canary.4962a163.0":"2021-09-07T23:53:24.082Z","0.23.0-canary.33102bf4.0":"2021-09-08T00:13:35.116Z","0.23.0-canary.76c68381.0":"2021-09-08T20:13:47.473Z","0.23.0-canary.17d51f76.0":"2021-09-08T23:26:21.965Z","0.23.0-canary.3fae6c2d.0":"2021-09-10T18:32:57.500Z","0.23.0-canary.f1958c4b.0":"2021-09-13T19:20:41.326Z","0.23.0-canary.78abbd59.0":"2021-09-13T21:26:18.928Z","0.23.0":"2021-09-13T21:35:46.592Z","0.24.0-canary.9830d665.0":"2021-09-13T21:37:07.964Z","0.24.0-canary.20e2081c.0":"2021-09-13T23:32:11.756Z","0.24.0-canary.583613a9.0":"2021-09-14T16:55:18.462Z","0.24.0-canary.0e1bd56f.0":"2021-09-14T17:32:18.647Z","0.24.0-canary.7bb1818e.0":"2021-09-15T00:35:54.201Z","0.24.0-canary.b5e665a9.0":"2021-09-15T18:13:11.055Z","0.24.0-canary.ab1e177c.0":"2021-09-15T18:44:50.270Z","0.24.0-canary.8dff8894.0":"2021-09-15T19:08:36.860Z","0.24.0-canary.9cd7e927.0":"2021-09-15T20:32:13.855Z","0.24.0-canary.a7132082.0":"2021-09-15T21:45:42.635Z","0.24.0-canary.cd9110cd.0":"2021-09-16T17:45:36.825Z","0.24.0-canary.1e5a9883.0":"2021-09-17T20:39:06.889Z","0.24.0-canary.32c830ee.0":"2021-09-17T23:08:45.859Z","0.24.0-canary.1de87bb7.0":"2021-09-18T18:52:08.822Z","0.24.0-canary.f2ea80c4.0":"2021-09-20T17:54:53.986Z","0.24.0-canary.569d739f.0":"2021-09-20T21:23:48.372Z","0.24.0-canary.5a434a50.0":"2021-09-21T02:00:43.740Z","0.25.0":"2021-09-21T02:53:03.981Z","0.26.0-canary.b1c1ab52.0":"2021-09-21T03:12:10.278Z","0.25.1":"2021-09-21T03:12:42.681Z","0.26.0-canary.ae060177.0":"2021-09-21T14:38:06.989Z","0.26.0-canary.b6fe2a12.0":"2021-09-22T20:16:15.968Z","0.26.0-canary.07e91417.0":"2021-09-22T21:05:46.351Z","0.26.0-canary.e2203ffa.0":"2021-09-23T18:27:36.078Z","0.26.0-canary.4abe237e.0":"2021-09-24T17:31:07.426Z","0.26.0-canary.6278ee5d.0":"2021-09-27T18:31:21.435Z","0.26.0-canary.3a5d5f34.0":"2021-09-27T22:41:30.517Z","0.26.0-canary.143ed3c8.0":"2021-09-29T01:50:50.095Z","0.26.0-canary.e5923d68.0":"2021-09-30T00:05:49.094Z","0.26.0-canary.d8ed5109.0":"2021-09-30T23:33:52.844Z","0.26.0-canary.0efb9c2c.0":"2021-10-02T02:08:15.989Z","0.26.0-canary.1c9adcb3.0":"2021-10-04T17:33:33.138Z","0.26.0-canary.dfc00d60.0":"2021-10-09T00:57:14.429Z","0.26.0-canary.c3aa844c.0":"2021-10-11T23:14:20.783Z","0.25.2":"2021-10-11T23:18:33.205Z","0.26.0-canary.406d6fe1.0":"2021-10-13T20:59:27.245Z","0.26.0-canary.ca0a674f.0":"2021-10-18T21:36:55.535Z","0.26.0-canary.eefcf660.0":"2021-10-20T21:23:36.230Z","0.26.0-canary.d21acc8f.0":"2021-10-20T22:32:29.195Z","0.25.3":"2021-10-21T17:55:44.578Z","0.26.0-canary.60449b7b.0":"2021-10-21T18:17:25.719Z","0.26.0-canary.0d8084ed.0":"2021-10-28T17:44:54.398Z","0.26.0-canary.232327ee.0":"2021-11-01T20:15:45.845Z","0.26.0-canary.0a492ae8.0":"2021-11-02T10:00:24.276Z","0.26.0-canary.0aa18745.0":"2021-11-02T18:07:50.682Z","0.26.0-canary.f3e28323.0":"2021-11-02T18:59:33.204Z","0.26.0-canary.27e05c5d.0":"2021-11-03T18:44:58.876Z","0.26.0-canary.b9e44af7.0":"2021-11-03T19:04:01.609Z","0.26.0-canary.448f6cb9.0":"2021-11-04T18:07:54.382Z","0.26.0-canary.8067ce28.0":"2021-11-04T22:22:26.772Z","0.26.0-canary.345c2bb9.0":"2021-12-02T17:10:08.238Z","0.26.0-canary.0547aeeb.0":"2021-12-06T16:36:04.155Z","0.26.0-canary.3b2452cc.0":"2021-12-09T00:05:39.249Z","0.26.0-canary.cf7ba5a9.0":"2021-12-10T19:06:57.210Z","0.26.0-canary.e1bcf14e.0":"2021-12-28T20:45:36.055Z","0.26.0-canary.b9d35b69.0":"2022-01-05T18:27:02.737Z","0.26.0-canary.2afff08e.0":"2022-01-06T22:22:51.655Z","0.26.0-canary.893fc857.0":"2022-01-07T18:53:43.065Z","0.26.0-canary.69ba13b7.0":"2022-01-19T22:23:45.165Z","0.26.0-canary.0af8ade5.0":"2022-02-07T22:05:03.982Z","0.26.0":"2022-05-03T17:30:33.592Z","0.26.1":"2022-05-09T20:31:51.075Z","0.27.0":"2022-08-12T19:12:08.343Z"},"maintainers":[{"email":"abhiomkar@gmail.com","name":"abhiomkar"},{"email":"aomarks@gmail.com","name":"aomarks"},{"email":"andrey.prigogin@gmail.com","name":"aprigogin"},{"email":"asyncliz@gmail.com","name":"asyncliz"},{"email":"dfreedm2@gmail.com","name":"azakus"},{"email":"bicknellr@gmail.com","name":"bicknellr"},{"email":"wangchan518@gmail.com","name":"candysonya"},{"email":"emarquez@google.com","name":"emarquez"},{"email":"esgonzalez@google.com","name":"esgonzalez"},{"email":"aprigogin+npm@google.com","name":"material-admin"},{"email":"prodee@google.com","name":"patrickrodee"},{"email":"sayrisuarez@google.com","name":"ssuarez"},{"email":"brian.t.vann@gmail.com","name":"taylorv"},{"email":"hi@yef.im","name":"yefim"}],"description":"Material Design textfield web component","license":"Apache-2.0","readme":"# `<mwc-textfield>` [![Published on npm](https://img.shields.io/npm/v/@material/mwc-textfield.svg)](https://www.npmjs.com/package/@material/mwc-textfield)\n> IMPORTANT: The Material Web Components are a work in progress and subject to\n> major changes until 1.0 release.\n\nText fields let users enter and edit text.\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6347c3e1b0264cc34cad24e4e52a23e2100a4926/packages/textfield/images/standard.png\" width=\"244px\">\n\n[Material Design Guidelines: text fields](https://material.io/design/components/text-fields.html)\n\n[Demo](https://material-components.github.io/material-web/demos/textfield/)\n\n## Installation\n\n```sh\nnpm install @material/mwc-textfield\n```\n\n> NOTE: The Material Web Components are distributed as ES2017 JavaScript\n> Modules, and use the Custom Elements API. They are compatible with all modern\n> browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional\n> tooling step is required to resolve *bare module specifiers*, as well as\n> transpilation and polyfills for IE11. See\n> [here](https://github.com/material-components/material-components-web-components#quick-start)\n> for detailed instructions.\n\n## Example usage\n\n### Standard / Filled\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6347c3e1b0264cc34cad24e4e52a23e2100a4926/packages/textfield/images/standard.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield/mwc-textfield.js';\n</script>\n```\n\n### Icon - Leading\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6347c3e1b0264cc34cad24e4e52a23e2100a4926/packages/textfield/images/icon-leading.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" icon=\"event\"></mwc-textfield>\n\n<script type=\"module\">\n  import '@material/mwc-textfield/mwc-textfield.js';\n  import '@material/mwc-icon/mwc-icon-font.js';\n</script>\n```\n\n### Icon - Trailing\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6347c3e1b0264cc34cad24e4e52a23e2100a4926/packages/textfield/images/icon-trailing.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" iconTrailing=\"delete\"></mwc-textfield>\n```\n\n### Helper Text\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6347c3e1b0264cc34cad24e4e52a23e2100a4926/packages/textfield/images/helper.png\" width=\"244px\">\n\n```html\n<mwc-textfield label=\"My Textfield\" helper=\"Helper Text\"></mwc-textfield>\n```\n\n### Primary Color\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6347c3e1b0264cc34cad24e4e52a23e2100a4926/packages/textfield/images/color-primary.png\" width=\"244px\">\n\n```html\n<style>\n  mwc-textfield {\n    --mdc-theme-primary: green;\n  }\n</style>\n\n<mwc-textfield\n    label=\"My Textfield\"\n    iconTrailing=\"delete\"\n    required>\n</mwc-textfield>\n```\n\n## Variants\n\n### Outlined\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6347c3e1b0264cc34cad24e4e52a23e2100a4926/packages/textfield/images/outlined.png\" width=\"244px\">\n\n```html\n<mwc-textfield\n    outlined\n    label=\"My Textfield\"\n    iconTrailing=\"delete\">\n</mwc-textfield>\n```\n\n#### Shaped\n\n<img src=\"https://raw.githubusercontent.com/material-components/material-components-web-components/6347c3e1b0264cc34cad24e4e52a23e2100a4926/packages/textfield/images/shape.png\" width=\"233px\">\n\n```html\n<style>\n  mwc-textfield.rounded {\n    --mdc-shape-small: 28px;\n  }\n</style>\n\n<mwc-textfield\n    class=\"rounded\"\n    label=\"My Textfield\"\n    outlined>\n</mwc-textfield>\n```\n\n## API\n\n### Properties/Attributes\n\nName                      | Type                          | Description\n------------------------- | ----------------------------- | -----------\n`value`                   | `string`                      | The input control's value.\n`type`                    | `TextFieldType*`              | A string specifying the type of control to render.\n`label`                   | `string`                      | Sets floating label value.\n`placeholder`             | `string`                      | Sets disappearing input placeholder.\n`prefix`                  | `string`                      | Prefix text to display before the input.\n`suffix`                  | `string`                      | Suffix text to display after the input.\n`icon`                    | `string`                      | Leading icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`iconTrailing`            | `string`                      | Trailing icon to display in input. See [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon).\n`disabled`                | `boolean`                     | Whether or not the input should be disabled.\n`charCounter`             | `boolean`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.\n`outlined`                | `boolean`                     | Whether or not to show the material outlined variant.\n`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.\n`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.\n`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.\n`maxLength`               | `number`                      | Maximum length to accept input.\n`validationMessage`       | `string`                      | Message to show in the error color when the textfield is invalid. (Helper text will not be visible)\n`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`min`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`max`                     | `number`\\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)\n`size`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)\n`step`                    | `number`\\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)\n`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.\n`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textfield.\n`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)\n`validityTransform`       | `ValidityTransform**`\\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.\n`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.\n`name`                    | `string`                      | Sets the `name` attribute on the internal input.\\*\\*\\*\n\n\\*  `TextFieldType` is exported by `mwc-textfield` and `mwc-textfield-base`\n```ts\ntype TextFieldType = 'text'|'search'|'tel'|'url'|'email'|'password'|\n    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';\n```\n\n\\*\\* `ValidityTransform` is not exported. See the [validation section](#Validation) for more details.\n```ts\ntype ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\n\\*\\*\\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).\n\n### Methods\n\n| Name     | Description\n| -------- | -------------\n| `checkValidity() => boolean`   | Returns `true` if the textfield passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textfield otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textfield initial boot up, you may have to await `<mwc-textfield>.updateComplete`.\n| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.\n| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.\n| `layout() => Promise<void>`   | Re-calculate layout. If a textfield is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.\n\n### CSS Custom Properties\n\nInherits CSS Custom properties from:\n\n* [`mwc-ripple`](https://github.com/material-components/material-web/tree/master/packages/ripple)\n* [`mwc-notched-outline`](https://github.com/material-components/material-web/tree/master/packages/notched-outline).\n* [`mwc-icon`](https://github.com/material-components/material-web/tree/master/packages/icon)\n\n| Name                                              | Default               | Description\n| ------------------------------------------------- | --------------------- |------------\n| `--mdc-text-field-filled-border-radius`           | `4px 4px 0 0`         | Border radius of the standard / filled textfield's background filling.\n| `--mdc-text-field-idle-line-color`                | `rgba(0, 0, 0, 0.42)` | Color of the filled textfield's bottom line when idle.\n| `--mdc-text-field-hover-line-color`               | `rgba(0, 0, 0, 0.87)` | Color of the filled textfield's bottom line when hovering.\n| `--mdc-text-field-disabled-line-color`            | `rgba(0, 0, 0, 0.06)` | Color of the filled textfield's bottom line when disabled.\n| `--mdc-text-field-outlined-idle-border-color`     | `rgba(0, 0, 0, 0.38)` | Color of the outlined textfield's  outline when idle.\n| `--mdc-text-field-outlined-hover-border-color`    | `rgba(0, 0, 0, 0.87)` | Color of the outlined textfield's outline when hovering.\n| `--mdc-text-field-outlined-disabled-border-color` | `rgba(0, 0, 0, 0.06)` | Color of the outlined textfield's outline when disabled.\n| `--mdc-text-field-fill-color`                     | `rgb(245, 245, 245)`  | Color of the textfield's background fill (non-outlined).\n| `--mdc-text-field-disabled-fill-color`            | `rgb(250, 250, 250)`  | Color of the textfield's background fill (non-outlined) when disabled.\n| `--mdc-text-field-ink-color`                      | `rgba(0, 0, 0, 0.87)` | Color of the input text.\n| `--mdc-text-field-label-ink-color`                | `rgba(0, 0, 0, 0.6)`  | Color of the non-focused floating label, helper text, char counter, and placeholder.\n| `--mdc-text-field-disabled-ink-color`             | `rgba(0, 0, 0, 0.37)` | Color of the input text, the floating label, helper text, char counter, and placeholder of a disabled textfield.\n\n#### Global Custom Properties\n\nThis component exposes the following global [theming](https://github.com/material-components/material-components-web-components/blob/master/docs/theming.md)\ncustom properties.\n\n| Name                 | Description\n| -------------------- | -----------\n| `--mdc-theme-primary`  | Color when active of the underline ripple, the outline, and the caret.\n| `--mdc-theme-error`    | Color when errored of the underline, the outline, the caret, and the icons.\n| `--mdc-typography-subtitle1-<PROPERTY>` | Styles the typography of the textfield.\n\n### Validation\n\n`<mwc-textfield>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).\nIt exposes:\n\n* `required`\n* `maxLength`\n* `pattern`\n* `min`\n* `max`\n* `step`\n* `validity`\n* `willValidate`\n* `checkValidity()`\n* `reportValidity()`\n* `setCustomValidity(message)`\n\nAdditionally, it implements more features such as:\n\n* `validationMessage`\n* `validateOnInitialRender`\n* and `validityTransform`\n\nBy default, `<mwc-textfield>` will report validation on `blur`.\n\n#### Custom validation logic\n\nThe `validityTransform` property is a function that can be set on `<mwc-textfield>` to\nimplement custom validation logic that transforms the `ValidityState` of the\ninput control. The type of a `ValidityTransform` is the following:\n\n```ts\n(value: string, nativeValidity: ValidityState) => Partial<ValidityState>\n```\n\nWhere `value` is the new value in the textfield to be validated and\n`nativeValidity` is an interface of\n[`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)\nof the native input control. For example:\n\n```html\n<mwc-textfield\n    id=\"my-textfield\"\n    pattern=\"[0-9]+\"\n    value=\"doggos\">\n</mwc-textfield>\n<script>\n  const textfield = document.querySelector('#my-textfield');\n  textfield.validityTransform = (newValue, nativeValidity) => {\n    if (!nativeValidity.valid) {\n      if (nativeValidity.patternMismatch) {\n        const hasDog = newValue.includes('dog');\n        // changes to make to the nativeValidity\n        return {\n          valid: hasDog,\n          patternMismatch: !hasDog;\n        };\n      } else {\n        // no changes\n        return {};\n      }\n    } else {\n      const isValid = someExpensiveOperation(newValue);\n      // changes to make to the native validity\n      return {\n        valid: isValid,\n        // or whatever type of ValidityState prop you would like to set (if any)\n        customError: !isValid,\n      };\n    }\n  }\n</script>\n```\n\nIn this example we first check the native validity which is invalid due to the\npattern mismatching (the value is `doggos` which is not a number). The value\nincludes `dog`, thus we make it valid and undo the pattern mismatch.\n\nIn this example, we also skip an expensive validity check by short-circuiting\nthe validation by checking the native validation.\n\n*Note:* the UI will only update as valid / invalid by checking the `valid`\nproperty of the transformed `ValidityState`.\n\n## Additional references\n\n- [MDC Web textfields](https://material.io/develop/web/components/input-controls/text-field/)\n","readmeFilename":"README.md","homepage":"https://github.com/material-components/material-components-web-components#readme","keywords":["material design","web components","textfield"],"repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web-components.git","directory":"packages/textfield"},"bugs":{"url":"https://github.com/material-components/material-components-web-components/issues"}}